--- ./build/config/compiler/BUILD.gn.orig +++ ./build/config/compiler/BUILD.gn @@ -604,24 +604,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" ] @@ -1062,20 +1044,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) { @@ -1130,7 +1098,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") { @@ -1234,8 +1201,8 @@ if (current_cpu == "x64") { if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_chromeos_device) { - cflags += [ "--target=x86_64-unknown-linux-gnu" ] - ldflags += [ "--target=x86_64-unknown-linux-gnu" ] + cflags += [ "--target=x86_64-alpine-linux-musl" ] + ldflags += [ "--target=x86_64-alpine-linux-musl" ] } else { cflags += [ "-m64" ] ldflags += [ "-m64" ] @@ -1243,8 +1210,8 @@ cflags += [ "-msse3" ] } else if (current_cpu == "x86") { if (is_clang && !is_android && !is_nacl && !is_chromeos_device) { - cflags += [ "--target=i386-unknown-linux-gnu" ] - ldflags += [ "--target=i386-unknown-linux-gnu" ] + cflags += [ "--target=i586-alpine-linux-musl" ] + ldflags += [ "--target=i586-alpine-linux-musl" ] } else { cflags += [ "-m32" ] ldflags += [ "-m32" ] @@ -1257,8 +1224,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 += [ @@ -1272,8 +1239,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" ] @@ -2262,7 +2229,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 @@ -188,13 +188,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") { @@ -213,31 +213,27 @@ # The thumbv7 vs. armv7 distinction is for legacy reasons and both # targets in fact target Thumb, see: # https://github.com/rust-lang/rust/issues/44722 - if (arm_use_neon) { - rust_abi_target = "thumbv7neon-unknown-linux-gnueabi" + float_suffix - } else { - 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 if (current_cpu == "ppc64") { - rust_abi_target = "powerpc64le-unknown-linux-gnu" + rust_abi_target = "powerpc64le-alpine-linux-musl" cargo_target_abi = "" } else if (current_cpu == "s390x") { - rust_abi_target = "s390x-unknown-linux-gnu" + rust_abi_target = "s390x-alpine-linux-musl" cargo_target_abi = "" } else if (current_cpu == "loong64") { - rust_abi_target = "loongarch64-unknown-linux-gnu" + rust_abi_target = "loongarch64-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 + "-unknown-linux-musl" cargo_target_abi = "" } } else if (is_android) { --- ./build/config/clang/BUILD.gn.orig +++ ./build/config/clang/BUILD.gn @@ -208,16 +208,17 @@ assert(false) # Unhandled cpu type } } 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 if (current_cpu == "loong64") { - _dir = "loongarch64-unknown-linux-gnu" + _suffix = "-loongarch64" } 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") { --- ./third_party/rust/bytemuck/v1/BUILD.gn.orig +++ ./third_party/rust/bytemuck/v1/BUILD.gn @@ -50,7 +50,6 @@ "bytemuck_derive", "derive", "min_const_generics", - "nightly_portable_simd", ] library_configs -= [ "//build/config/compiler:disallow_unstable_features" ] executable_configs -= [ "//build/config/compiler:disallow_unstable_features" ] --- ./third_party/crabbyavif/BUILD.gn.orig +++ ./third_party/crabbyavif/BUILD.gn @@ -162,12 +162,7 @@ "dav1d", "libyuv", "capi", - "disable_cfi", ] - - # Required for disable_cfi feature. - configs -= [ "//build/config/compiler:disallow_unstable_features" ] - rustflags = [ "-Zallow-features=no_sanitize" ] public_deps = [ ":header_files" ] deps = [