--- ./build/config/compiler/BUILD.gn.orig +++ ./build/config/compiler/BUILD.gn @@ -568,24 +568,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" ] @@ -998,17 +980,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=.", ] if (!is_win || force_rustc_color_output) { @@ -1175,8 +1146,8 @@ } else if (current_cpu == "arm") { if (is_clang && !is_android && !is_nacl && !(is_chromeos_lacros && 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 += [ @@ -1190,8 +1161,8 @@ } else if (current_cpu == "arm64") { if (is_clang && !is_android && !is_nacl && !is_fuchsia && !(is_chromeos_lacros && 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" ] @@ -1982,7 +1953,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 @@ -185,11 +185,11 @@ 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" } else if (current_cpu == "x86") { - rust_abi_target = "i686-unknown-linux-gnu" + rust_abi_target = "i586-alpine-linux-musl" } else if (current_cpu == "x64") { - rust_abi_target = "x86_64-unknown-linux-gnu" + rust_abi_target = "x86_64-alpine-linux-musl" } else if (current_cpu == "arm") { if (arm_float_abi == "hard") { float_suffix = "hf" @@ -198,15 +198,15 @@ } 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 } else { - rust_abi_target = "arm-unknown-linux-gnueabi" + float_suffix + rust_abi_target = "armv6-alpine-linux-musleabi" + float_suffix } } else if (current_cpu == "riscv64") { - rust_abi_target = "riscv64gc-unknown-linux-gnu" + rust_abi_target = "riscv64-alpine-linux-musl" } else { # Best guess for other future platforms. - rust_abi_target = current_cpu + "-unknown-linux-gnu" + rust_abi_target = current_cpu + "-alpine-linux-musl" } } else if (is_android) { import("//build/config/android/abi.gni") --- ./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 }