--- ./build/config/compiler/BUILD.gn.orig +++ ./build/config/compiler/BUILD.gn @@ -591,24 +591,6 @@ } } - # TODO(crbug.com/40283598): This causes binary size growth and potentially - # other problems. - # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version. - if (default_toolchain != "//build/toolchain/cros:target" && - !llvm_android_mainline) { - cflags += [ - "-mllvm", - "-split-threshold-for-reg-with-hint=0", - ] - if (use_thin_lto && is_a_target_toolchain) { - if (is_win) { - ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ] - } else { - ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ] - } - } - } - # TODO(crbug.com/40192287): Investigate why/if this should be needed. if (is_win) { cflags += [ "/clang:-ffp-contract=off" ] @@ -1045,20 +1027,6 @@ # `-nodefaultlibs` from the linker invocation from Rust, which would be used # to compile dylibs on Android, such as for constructing unit test APKs. "-Cdefault-linker-libraries", - - # To make Rust .d files compatible with ninja - "-Zdep-info-omit-d-target", - - # If a macro panics during compilation, show which macro and where it is - # defined. - "-Zmacro-backtrace", - - # For deterministic builds, keep the local machine's current working - # directory from appearing in build outputs. - "-Zremap-cwd-prefix=.", - - # We use clang-rt sanitizer runtimes. - "-Zexternal-clangrt", ] if (!is_win || force_rustc_color_output) { @@ -1107,7 +1075,6 @@ # Don't allow unstable features to be enabled by `#![feature()]` without # additional command line flags. config("disallow_unstable_features") { - rustflags = [ "-Zallow-features=" ] } config("libcxx_hardening") { @@ -1242,8 +1209,8 @@ } } else if (current_cpu == "arm") { if (is_clang && !is_android && !is_nacl && !is_chromeos_device) { - cflags += [ "--target=arm-linux-gnueabihf" ] - ldflags += [ "--target=arm-linux-gnueabihf" ] + cflags += [ "--target=armv7-alpine-linux-musleabihf" ] + ldflags += [ "--target=armv7-alpine-linux-musleabihf" ] } if (!is_nacl) { cflags += [ @@ -1257,8 +1224,8 @@ } else if (current_cpu == "arm64") { if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_chromeos_device) { - cflags += [ "--target=aarch64-linux-gnu" ] - ldflags += [ "--target=aarch64-linux-gnu" ] + cflags += [ "--target=aarch64-alpine-linux-musl" ] + ldflags += [ "--target=aarch64-alpine-linux-musl" ] } } else if (current_cpu == "mipsel" && !is_nacl) { ldflags += [ "-Wl,--hash-style=sysv" ] @@ -2086,7 +2053,7 @@ defines = [ "_HAS_NODISCARD" ] } } else { - cflags = [ "-Wall" ] + cflags = [] if (is_clang) { # Enable extra warnings for chromium_code when we control the compiler. cflags += [ "-Wextra" ] --- ./build/config/rust.gni.orig +++ ./build/config/rust.gni @@ -198,13 +198,13 @@ rust_abi_target = "" if (is_linux || is_chromeos) { if (current_cpu == "arm64") { - rust_abi_target = "aarch64-unknown-linux-gnu" + rust_abi_target = "aarch64-alpine-linux-musl" cargo_target_abi = "" } else if (current_cpu == "x86") { - rust_abi_target = "i686-unknown-linux-gnu" + rust_abi_target = "i586-alpine-linux-musl" cargo_target_abi = "" } else if (current_cpu == "x64") { - rust_abi_target = "x86_64-unknown-linux-gnu" + rust_abi_target = "x86_64-alpine-linux-musl" cargo_target_abi = "" } else if (current_cpu == "arm") { if (arm_float_abi == "hard") { @@ -214,18 +214,18 @@ } if (arm_arch == "armv7-a" || arm_arch == "armv7") { # No way to inform Rust about the -a suffix. - rust_abi_target = "armv7-unknown-linux-gnueabi" + float_suffix + rust_abi_target = "armv7-alpine-linux-musleabi" + float_suffix cargo_target_abi = "eabi" + float_suffix } else { - rust_abi_target = "arm-unknown-linux-gnueabi" + float_suffix + rust_abi_target = "armv6-alpine-linux-musleabi" + float_suffix cargo_target_abi = "eabi" + float_suffix } } else if (current_cpu == "riscv64") { - rust_abi_target = "riscv64gc-unknown-linux-gnu" + rust_abi_target = "riscv64-alpine-linux-musl" cargo_target_abi = "" } else { # Best guess for other future platforms. - rust_abi_target = current_cpu + "-unknown-linux-gnu" + rust_abi_target = current_cpu + "-alpine-linux-musl" cargo_target_abi = "" } } else if (is_android) { --- ./build/config/clang/BUILD.gn.orig +++ ./build/config/clang/BUILD.gn @@ -128,14 +128,15 @@ } else if (is_apple) { _dir = "darwin" } else if (is_linux || is_chromeos) { + _dir = "linux" if (current_cpu == "x64") { - _dir = "x86_64-unknown-linux-gnu" + _suffix = "-x86_64" } else if (current_cpu == "x86") { - _dir = "i386-unknown-linux-gnu" + _suffix = "-i386" } else if (current_cpu == "arm") { - _dir = "armv7-unknown-linux-gnueabihf" + _suffix = "-armhf" } else if (current_cpu == "arm64") { - _dir = "aarch64-unknown-linux-gnu" + _suffix = "-aarch64" } else { assert(false) # Unhandled cpu type } --- ./build/config/gcc/BUILD.gn.orig +++ ./build/config/gcc/BUILD.gn @@ -32,7 +32,6 @@ # See http://gcc.gnu.org/wiki/Visibility config("symbol_visibility_hidden") { cflags = [ "-fvisibility=hidden" ] - rustflags = [ "-Zdefault-visibility=hidden" ] # Visibility attribute is not supported on AIX. if (current_os != "aix") {