void-packages/srcpkgs/qt6-webengine/patches/0107-chromium-cross-build.p...

66 lines
2.4 KiB
Diff

--- qt6-webengine-6.4.2.orig/src/3rdparty/chromium/build/config/compiler/BUILD.gn
+++ qt6-webengine-6.4.2/src/3rdparty/chromium/build/config/compiler/BUILD.gn
@@ -58,6 +58,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
@@ -970,8 +974,13 @@ config("compiler_cpu_abi") {
}
} 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" ]
+ }
}
if (is_android) {
# Outline atomics crash on Exynos 9810. http://crbug.com/1272795
--- qt6-webengine-6.4.2.orig/src/3rdparty/chromium/build/toolchain/linux/unbundle/BUILD.gn
+++ qt6-webengine-6.4.2/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
+ }
+}
--- qt6-webengine-6.4.2.orig/src/3rdparty/chromium/build/config/linux/pkg_config.gni
+++ qt6-webengine-6.4.2/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