void-packages/srcpkgs/chromium/patches/cross-build.patch
Duncaen cea371b26f chromium: update to 96.0.4664.45.
- enable aarch64* cross build
- use -fdebug-prefix-map for better ccache hits with -o debug
2021-11-17 01:00:58 +01:00

65 lines
2 KiB
Diff

--- a/build/config/compiler/BUILD.gn.orig
+++ b/build/config/compiler/BUILD.gn
@@ -58,6 +58,10 @@
}
declare_args() {
+ is_musl = false
+}
+
+declare_args() {
# Normally, Android builds are lightly optimized, even for debug builds, to
# keep binary size down. Setting this flag to true disables such optimization
android_full_debug = false
@@ -880,8 +884,13 @@
}
} else if (current_cpu == "arm64") {
if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
- cflags += [ "--target=aarch64-linux-gnu" ]
- ldflags += [ "--target=aarch64-linux-gnu" ]
+ if (is_musl) {
+ cflags += [ "--target=aarch64-linux-musl" ]
+ ldflags += [ "--target=aarch64-linux-musl" ]
+ } else {
+ cflags += [ "--target=aarch64-linux-gnu" ]
+ ldflags += [ "--target=aarch64-linux-gnu" ]
+ }
}
} else if (current_cpu == "mipsel" && !is_nacl) {
ldflags += [ "-Wl,--hash-style=sysv" ]
--- a/build/toolchain/linux/unbundle/BUILD.gn.orig
+++ b/build/toolchain/linux/unbundle/BUILD.gn
@@ -39,3 +39,22 @@
current_os = host_os
}
}
+
+gcc_toolchain("v8_snapshot_cross") {
+ cc = getenv("BUILD_CC")
+ cxx = getenv("BUILD_CXX")
+ ar = getenv("BUILD_AR")
+ nm = getenv("BUILD_NM")
+ ld = cxx
+
+ extra_cflags = getenv("BUILD_CFLAGS")
+ extra_cppflags = getenv("BUILD_CPPFLAGS")
+ extra_cxxflags = getenv("BUILD_CXXFLAGS")
+ extra_ldflags = getenv("BUILD_LDFLAGS")
+
+ toolchain_args = {
+ current_cpu = host_cpu
+ current_os = host_os
+ v8_current_cpu = target_cpu
+ }
+}
--- a/build/config/linux/pkg_config.gni.orig
+++ b/build/config/linux/pkg_config.gni
@@ -91,7 +91,7 @@
assert(defined(invoker.packages),
"Variable |packages| must be defined to be a list in pkg_config.")
config(target_name) {
- if (host_toolchain == current_toolchain) {
+ if (current_cpu != target_cpu) {
args = host_pkg_config_args + invoker.packages
} else {
args = pkg_config_args + invoker.packages