2024-06-02 23:02:17 +00:00
|
|
|
--- ./build/config/compiler/BUILD.gn.orig
|
|
|
|
+++ ./build/config/compiler/BUILD.gn
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -568,24 +568,6 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-11-01 13:59:14 +00:00
|
|
|
- # TODO(crbug.com/40283598): This causes binary size growth and potentially
|
2024-06-02 23:02:17 +00:00
|
|
|
- # other problems.
|
2024-11-01 13:59:14 +00:00
|
|
|
- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version.
|
2024-06-02 23:02:17 +00:00
|
|
|
- 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" ]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
2024-11-01 13:59:14 +00:00
|
|
|
# TODO(crbug.com/40192287): Investigate why/if this should be needed.
|
2024-06-02 23:02:17 +00:00
|
|
|
if (is_win) {
|
|
|
|
cflags += [ "/clang:-ffp-contract=off" ]
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -998,17 +980,6 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
# `-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) {
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -1175,8 +1146,8 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
} 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 += [
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -1190,8 +1161,8 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
} 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" ]
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -1982,7 +1953,7 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
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
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -185,11 +185,11 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
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"
|
2024-11-01 13:59:14 +00:00
|
|
|
@@ -198,15 +198,15 @@
|
2024-06-02 23:02:17 +00:00
|
|
|
}
|
|
|
|
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
|
|
|
|
}
|
2024-11-01 13:59:14 +00:00
|
|
|
} else if (current_cpu == "riscv64") {
|
|
|
|
- rust_abi_target = "riscv64gc-unknown-linux-gnu"
|
|
|
|
+ rust_abi_target = "riscv64-alpine-linux-musl"
|
2024-06-02 23:02:17 +00:00
|
|
|
} 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
|
|
|
|
}
|