@@ -77,10 +77,7 @@ git apply "$COMMAND_DIR/patches/ssl_verify_callback_with_native_handle.patch" -v
7777git apply " $COMMAND_DIR /patches/add_deps.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7878git apply " $COMMAND_DIR /patches/fix_desktop_capture_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
7979git apply " $COMMAND_DIR /patches/external_audio_source.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
80- git apply " $COMMAND_DIR /patches/fix_payload_type_picker_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
8180git apply " $COMMAND_DIR /patches/fix_pipewire_utils_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
82- git apply " $COMMAND_DIR /patches/fix_ssl_stream_adapter_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
83- git apply " $COMMAND_DIR /patches/fix_copy_on_write_buffer_compile.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
8481
8582# Disable CREL (compact relocations). Chromium's build enables experimental
8683# CREL via -Wa,--crel which causes segfaults on aarch64-linux (and is known
@@ -89,6 +86,15 @@ git apply "$COMMAND_DIR/patches/fix_copy_on_write_buffer_compile.patch" -v --ign
8986# See: https://github.com/zed-industries/zed/pull/51433#discussion_r2944567608
9087git -C build apply " $COMMAND_DIR /patches/disable_crel.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
9188
89+ # is_clang=false selects the //build/toolchain/linux GCC toolchains, which pass a bare
90+ # "ar" to be resolved from PATH. gcc_toolchain.gni rebases that against root_out_dir and
91+ # declares the result as an input, so ninja refuses to run any alink edge.
92+ git -C build apply " $COMMAND_DIR /patches/fix_gcc_toolchain_ar_input.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
93+
94+ # GCC reports -Wchanges-meaning as an error rather than a warning, so
95+ # treat_warnings_as_errors=false does not cover it and WebRTC does not build without this.
96+ git -C build apply " $COMMAND_DIR /patches/disable_gcc_changes_meaning.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
97+
9298cd third_party
9399
94100git apply " $COMMAND_DIR /patches/david_disable_gun_source_macro.patch" -v --ignore-space-change --ignore-whitespace --whitespace=nowarn
111117# Note: use_clang_modules=false is required to avoid C++ module compilation issues.
112118# Without this flag, the build may fail partway through, resulting in missing
113119# or incomplete artifacts.
120+ #
121+ # The C++ standard library choice is an ABI contract with webrtc-sys, which is compiled
122+ # by the cc crate against whatever the host toolchain provides:
123+ #
124+ # use_custom_libcxx=false keeps every std type in libwebrtc.a mangled the way
125+ # libstdc++ mangles it, instead of Chromium's std::__Cr:: ABI namespace.
126+ # use_sysroot=false makes the build use the host's libstdc++ headers rather
127+ # than the bundled Debian Bullseye sysroot's libstdc++ 10. This matters beyond
128+ # mangling: libstdc++ reordered the members of std::span in GCC 15, so a libwebrtc
129+ # built against libstdc++ 10 headers and a webrtc-sys built against 15 agree on the
130+ # mangled name of CopyOnWriteBuffer::Set(std::span<const uint8_t>) while disagreeing
131+ # on which register holds the pointer and which holds the length.
132+ # is_clang=false builds with the host GCC, so the compiler matches too.
114133args=" is_debug=$debug \
115134 target_os=\" linux\" \
116135 target_cpu=\" $arch \" \
@@ -119,6 +138,8 @@ args="is_debug=$debug \
119138 use_llvm_libatomic=false \
120139 use_custom_libcxx=false \
121140 use_custom_libcxx_for_host=false \
141+ use_sysroot=false \
142+ is_clang=false \
122143 use_clang_modules=false \
123144 rtc_include_tests=false \
124145 rtc_build_tools=false \
0 commit comments