void-packages/srcpkgs/qt6-pdf/patches/0120-cross-build.patch

66 lines
2.3 KiB
Diff

--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn
@@ -59,6 +59,10 @@ if (!is_clang) {
}
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
@@ -1190,8 +1194,13 @@ config("compiler_cpu_abi") {
} 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" ]
+ 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/src/3rdparty/chromium/build/toolchain/linux/unbundle/BUILD.gn
+++ b/src/3rdparty/chromium/build/toolchain/linux/unbundle/BUILD.gn
@@ -39,3 +39,22 @@ gcc_toolchain("host") {
current_os = current_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/src/3rdparty/chromium/build/config/linux/pkg_config.gni
+++ b/src/3rdparty/chromium/build/config/linux/pkg_config.gni
@@ -92,7 +92,7 @@ template("pkg_config") {
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 = common_pkg_config_args + host_pkg_config_args + invoker.packages
} else {
args = common_pkg_config_args + pkg_config_args + invoker.packages