Description: point clang to the toolchain provided by the gcc-mozilla package (version 7 required for C++ 17), and statically link against libstdc++ Author: Olivier Tilloy Bug-Ubuntu: https://launchpad.net/bugs/1856861 --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -1252,6 +1252,7 @@ try_compile(includes=['cstddef'], "#endif", ] ), + flags=["--gcc-toolchain=/usr/lib/gcc-mozilla"], check_msg="for new enough STL headers from libstdc++", when=needs_libstdcxx_newness_check, onerror=die_on_old_libstdcxx, @@ -1433,6 +1434,10 @@ set_config('_DEPEND_CFLAGS', depend_cfla set_config("_HOST_DEPEND_CFLAGS", depend_cflags(host_c_compiler)) +add_old_configure_assignment("CFLAGS", ["--gcc-toolchain=/usr/lib/gcc-mozilla"]) +add_old_configure_assignment("CXXFLAGS", ["--gcc-toolchain=/usr/lib/gcc-mozilla"]) + + @depends(c_compiler) def preprocess_option(compiler): # The uses of PREPROCESS_OPTION depend on the spacing for -o/-Fi. @@ -2137,6 +2142,7 @@ def linker_ldflags(linker, macos_sdk, ho if host.cpu == "arm": flags.append("-Wl,--no-keep-memory") + flags.append("-static-libstdc++") if sysroot_path and multiarch_dir: # Non-Debian-patched binutils linkers (both BFD and gold) don't lookup # in multi-arch directories. --- a/servo/components/style/build_gecko.rs +++ b/servo/components/style/build_gecko.rs @@ -149,6 +149,8 @@ impl BuilderExt for Builder { builder = builder.with_rustfmt(path); } + builder = builder.clang_arg("--gcc-toolchain=/usr/lib/gcc-mozilla"); + for dir in SEARCH_PATHS.iter() { builder = builder.clang_arg("-I").clang_arg(dir.to_str().unwrap()); } --- a/layout/style/test/moz.build +++ b/layout/style/test/moz.build @@ -18,6 +18,7 @@ DIRS += ['gtest'] "host_ListCSSProperties", ] ) +HOST_CXXFLAGS += ["--gcc-toolchain=/usr/lib/gcc-mozilla"] MOCHITEST_MANIFESTS += [ "mochitest.ini",