diff options
author | Michal Klocek <michal.klocek@qt.io> | 2020-01-13 15:00:21 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2020-01-16 15:03:04 +0000 |
commit | ca751a77e45f6f3914236ff0b62603f42884a3e1 (patch) | |
tree | a4d30db1b3827229ca7104c61944664be0140936 | |
parent | b7ce677ea5c389d4187454e90466b889a3fec0aa (diff) | |
download | qtwebengine-chromium-ca751a77e45f6f3914236ff0b62603f42884a3e1.tar.gz |
Add fat build support
Gn support fat builds with additional_target_cpus,
however this expects only fat builds for same type of
architecture like for ex. arm and arm64. Qt build
does fat builds for arm64 and x64, this is tricky to support
and would require some changes to support parsing builds
with two acitve toolchains.
Add poor man workaround to compile x64 together with arm64, by
using Xarch to separate parameters. Unfortunately arm64
includes neon files by default which can not be compiled
for x64. Therefore for release builds it is adviced
to do CONFIG-=simulator, which will not compile for
simulator, however will include NEON for arm64.
Task-number: QTBUG-77931
Change-Id: I26f9a656187a205ce8448eb3b888201c786476c7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r-- | chromium/build/config/arm.gni | 2 | ||||
-rw-r--r-- | chromium/build/config/ios/BUILD.gn | 44 | ||||
-rw-r--r-- | chromium/build/config/ios/ios_sdk.gni | 2 | ||||
-rw-r--r-- | chromium/build/config/sysroot.gni | 3 | ||||
-rw-r--r-- | chromium/third_party/libjpeg_turbo/BUILD.gn | 4 |
5 files changed, 43 insertions, 12 deletions
diff --git a/chromium/build/config/arm.gni b/chromium/build/config/arm.gni index 29434eba92f..8eee2dee38c 100644 --- a/chromium/build/config/arm.gni +++ b/chromium/build/config/arm.gni @@ -123,5 +123,7 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { } else if (current_cpu == "arm64" || v8_current_cpu == "arm64") { # arm64 supports only "hard". arm_float_abi = "hard" + declare_args() { arm_use_neon = true + } } diff --git a/chromium/build/config/ios/BUILD.gn b/chromium/build/config/ios/BUILD.gn index 47d36fc2fb9..edba8d2675d 100644 --- a/chromium/build/config/ios/BUILD.gn +++ b/chromium/build/config/ios/BUILD.gn @@ -22,6 +22,7 @@ declare_args() { # That is not a limitation for now as Xcode mandates the presence of bitcode # only when building bitcode-enabled projects for real devices (ARM CPUs). enable_ios_bitcode = false + use_qt_fat_lib = false } # This is included by reference in the //build/config/compiler config that @@ -46,11 +47,23 @@ config("compiler") { "-arch", "armv7", ] + if (use_qt_fat_lib) { + common_ios_flags += [ + "-arch", + "i386", + ] + } } else if (current_cpu == "arm64") { common_ios_flags += [ "-arch", "arm64", ] + if (use_qt_fat_lib) { + common_ios_flags += [ + "-arch", + "x86_64", + ] + } } # This is here so that all files get recompiled after an Xcode update. @@ -73,17 +86,30 @@ config("compiler") { # that is iOS-only. Please see that target for advice on what should go in # :runtime_library vs. :compiler. config("runtime_library") { - common_flags = [ - "-isysroot", - sysroot, + if (use_qt_fat_lib) { + common_flags = [ + "-Xarch_arm64", + "-isysroot" + sysroot, + "-Xarch_x86_64", + "-isysroot" + additional_target_sysroot[0], + "-stdlib=libc++", + ] + common_flags += [ "-Xarch_x86_64","-mios-simulator-version-min=$ios_deployment_target" ] + common_flags += [ "-Xarch_arm64","-miphoneos-version-min=$ios_deployment_target" ] + } else { - "-stdlib=libc++", - ] + common_flags = [ + "-isysroot", + sysroot, + "-stdlib=libc++", + ] + + if (use_ios_simulator) { + common_flags += [ "-mios-simulator-version-min=$ios_deployment_target" ] + } else { + common_flags += [ "-miphoneos-version-min=$ios_deployment_target" ] + } - if (use_ios_simulator) { - common_flags += [ "-mios-simulator-version-min=$ios_deployment_target" ] - } else { - common_flags += [ "-miphoneos-version-min=$ios_deployment_target" ] } if (use_xcode_clang && enable_ios_bitcode && !use_ios_simulator) { diff --git a/chromium/build/config/ios/ios_sdk.gni b/chromium/build/config/ios/ios_sdk.gni index 06bbfa7757a..20d36ae668b 100644 --- a/chromium/build/config/ios/ios_sdk.gni +++ b/chromium/build/config/ios/ios_sdk.gni @@ -4,6 +4,7 @@ import("//build/config/ios/ios_sdk_overrides.gni") import("//build/toolchain/toolchain.gni") +import("//build/config/sysroot.gni") assert(use_system_xcode, "Hermetic xcode doesn't work for ios.") @@ -95,6 +96,7 @@ if (ios_sdk_path == "") { script_name = "//build/config/mac/sdk_info.py" _ios_sdk_result = exec_script(script_name, ios_sdk_info_args, "scope") ios_sdk_path = _ios_sdk_result.sdk_path + assert(ios_sdk_path == target_sysroot, "qt ios sdk path != gn ios sdk path") ios_sdk_version = _ios_sdk_result.sdk_version ios_sdk_platform_path = _ios_sdk_result.sdk_platform_path ios_sdk_build = _ios_sdk_result.sdk_build diff --git a/chromium/build/config/sysroot.gni b/chromium/build/config/sysroot.gni index 50b7d3adf7d..79f73f28985 100644 --- a/chromium/build/config/sysroot.gni +++ b/chromium/build/config/sysroot.gni @@ -11,7 +11,8 @@ declare_args() { # The absolute path of the sysroot that is applied when compiling using # the target toolchain. target_sysroot = "" - + # used for fat library on ios + additional_target_sysroot = [] # The absolute path to directory containing linux sysroot images target_sysroot_dir = "//build/linux" diff --git a/chromium/third_party/libjpeg_turbo/BUILD.gn b/chromium/third_party/libjpeg_turbo/BUILD.gn index ac73468452d..dd20ff56535 100644 --- a/chromium/third_party/libjpeg_turbo/BUILD.gn +++ b/chromium/third_party/libjpeg_turbo/BUILD.gn @@ -8,7 +8,7 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/features.gni") -if (current_cpu == "arm") { +if (current_cpu == "arm" || current_cpu == "arm64") { import("//build/config/arm.gni") } @@ -159,7 +159,7 @@ static_library("simd") { "simd/arm/arm/jsimd_neon.S", "simd/arm/common/jdsample-neon.c", ] - } else if (current_cpu == "arm64") { + } else if (current_cpu == "arm64" && arm_use_neon) { sources = [ "simd/arm/arm64/jsimd.c", "simd/arm/arm64/jsimd_neon.S", |