Date: Wed, 6 Jun 2018 13:53:04 +0000 (UTC) From: Adriaan de Groot <adridg@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r471843 - head/www/qt5-webengine/files Message-ID: <201806061353.w56Dr4g5019901@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adridg Date: Wed Jun 6 13:53:04 2018 New Revision: 471843 URL: https://svnweb.freebsd.org/changeset/ports/471843 Log: Fix www/qt5-webengine to build on ARM Fix build for aarch64 and armv7. Chasing Chromium patches into Qt5-Webengine is a slow process. Multiple build successes have been reported with this patch, although I have not been able to try it myself. I hope I got all the attributions right. PR: 228603 228708 Submitted by: mikael.urankar@gmail.com Reported by: mikael.urankar@gmail.com, usenet@ulrich-grey.de Obtained from: mmel Added: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_cpu.h (contents, props changed) head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_arm_cpu-arm.cc (contents, props changed) head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_base_cpu.cc (contents, props changed) head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc (contents, props changed) head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_libsampler_sampler.cc (contents, props changed) Modified: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn Modified: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn ============================================================================== --- head/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn Wed Jun 6 13:47:33 2018 (r471842) +++ head/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn Wed Jun 6 13:53:04 2018 (r471843) @@ -1,6 +1,6 @@ ---- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2017-01-26 00:49:07 UTC +--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2018-01-15 11:39:43 UTC +++ src/3rdparty/chromium/build/config/compiler/BUILD.gn -@@ -150,7 +150,7 @@ config("compiler") { +@@ -156,7 +156,7 @@ config("compiler") { configs += [ "//build/config/win:compiler" ] } else if (is_android) { configs += [ "//build/config/android:compiler" ] @@ -9,7 +9,7 @@ configs += [ "//build/config/linux:compiler" ] } else if (is_nacl) { configs += [ "//build/config/nacl:compiler" ] -@@ -277,7 +277,7 @@ config("compiler") { +@@ -290,7 +290,7 @@ config("compiler") { # Linux/Android common flags setup. # --------------------------------- @@ -18,7 +18,7 @@ cflags += [ "-fPIC", "-pipe", # Use pipes for communicating between sub-processes. Faster. -@@ -401,14 +401,14 @@ config("compiler") { +@@ -414,14 +414,14 @@ config("compiler") { # clang-cl (used if is_win) doesn't expose this flag. # Currently disabled for nacl since its toolchain lacks this flag (too old). # TODO(zforman): Once nacl's toolchain is updated, remove check. @@ -35,7 +35,7 @@ # gnu++11 instead of c++11 is needed because some code uses typeof() (a # GNU extension). # TODO(thakis): Eventually switch this to c++11 instead, -@@ -458,7 +458,7 @@ config("compiler") { +@@ -475,7 +475,7 @@ config("compiler") { ] # Apply a lower LTO optimization level as the default is too slow. @@ -44,7 +44,7 @@ if (use_lld) { ldflags += [ "-Wl,--lto-O1" ] } else { -@@ -478,7 +478,7 @@ config("compiler") { +@@ -495,7 +495,7 @@ config("compiler") { # targeting ARM, without this flag, LTO produces a .text section that is # larger than the maximum call displacement, preventing the linker from # relocating calls (http://llvm.org/PR22999). @@ -53,7 +53,30 @@ ldflags += [ "-Wl,-plugin-opt,-function-sections" ] } } -@@ -742,7 +742,7 @@ config("compiler_codegen") { +@@ -541,11 +541,11 @@ config("compiler_cpu_abi") { + ] + } + } else if (current_cpu == "arm") { +- if (is_clang && !is_android && !is_nacl) { ++ if (is_clang && !is_android && !is_nacl && !is_bsd) { + cflags += [ "--target=arm-linux-gnueabihf" ] + ldflags += [ "--target=arm-linux-gnueabihf" ] + } +- if (!is_nacl) { ++ if (!is_nacl && !is_bsd) { + cflags += [ + "-march=$arm_arch", + "-mfloat-abi=$arm_float_abi", +@@ -555,7 +555,7 @@ config("compiler_cpu_abi") { + cflags += [ "-mtune=$arm_tune" ] + } + } else if (current_cpu == "arm64") { +- if (is_clang && !is_android && !is_nacl) { ++ if (is_clang && !is_android && !is_nacl && !is_bsd) { + cflags += [ "--target=aarch64-linux-gnu" ] + ldflags += [ "--target=aarch64-linux-gnu" ] + } +@@ -758,7 +758,7 @@ config("compiler_codegen") { # configs -= [ "//build/config/compiler:clang_stackrealign" ] # See https://crbug.com/556393 for details of where it must be avoided. config("clang_stackrealign") { @@ -62,7 +85,7 @@ cflags = [ # Align the stack on 16-byte boundaries, http://crbug.com/418554. "-mstack-alignment=16", -@@ -788,7 +788,7 @@ config("runtime_library") { +@@ -804,7 +804,7 @@ config("runtime_library") { # smaller. if (is_win) { configs += [ "//build/config/win:runtime_library" ] @@ -71,7 +94,7 @@ configs += [ "//build/config/linux:runtime_library" ] } else if (is_ios) { configs += [ "//build/config/ios:runtime_library" ] -@@ -1038,7 +1038,7 @@ config("default_warnings") { +@@ -1054,7 +1054,7 @@ config("default_warnings") { "-Wno-nonportable-include-path", # TODO(hans): https://crbug.com/637306 @@ -80,7 +103,7 @@ ] } } -@@ -1070,7 +1070,7 @@ config("chromium_code") { +@@ -1086,7 +1086,7 @@ config("chromium_code") { ] if (!is_debug && !using_sanitizer && @@ -89,7 +112,7 @@ # _FORTIFY_SOURCE isn't really supported by Clang now, see # http://llvm.org/bugs/show_bug.cgi?id=16821. # It seems to work fine with Ubuntu 12 headers though, so use it in -@@ -1128,7 +1128,7 @@ config("no_chromium_code") { +@@ -1144,7 +1144,7 @@ config("no_chromium_code") { ] } Added: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_cpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_include_openssl_cpu.h Wed Jun 6 13:53:04 2018 (r471843) @@ -0,0 +1,11 @@ +--- src/3rdparty/chromium/third_party/boringssl/src/include/openssl/cpu.h.orig 2018-03-21 07:29:16 UTC ++++ src/3rdparty/chromium/third_party/boringssl/src/include/openssl/cpu.h +@@ -95,7 +95,7 @@ extern uint32_t OPENSSL_ia32cap_P[4]; + + #if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + +-#if defined(OPENSSL_APPLE) ++#if defined(OPENSSL_APPLE) || defined(__FreeBSD__) + /* iOS builds use the static ARM configuration. */ + #define OPENSSL_STATIC_ARMCAP + #endif Added: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_arm_cpu-arm.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_arm_cpu-arm.cc Wed Jun 6 13:53:04 2018 (r471843) @@ -0,0 +1,23 @@ +--- src/3rdparty/chromium/v8/src/arm/cpu-arm.cc.orig 2017-09-25 11:16:57 UTC ++++ src/3rdparty/chromium/v8/src/arm/cpu-arm.cc +@@ -17,6 +17,11 @@ + #include "src/assembler.h" + #include "src/macro-assembler.h" + ++#if V8_OS_FREEBSD ++#include <sys/types.h> ++#include <machine/sysarch.h> ++#endif ++ + namespace v8 { + namespace internal { + +@@ -24,6 +29,8 @@ void CpuFeatures::FlushICache(void* start, size_t size + #if !defined(USE_SIMULATOR) + #if V8_OS_QNX + msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE); ++#elif V8_OS_FREEBSD ++ __clear_cache(start, reinterpret_cast<char*>(start) + size); + #else + register uint32_t beg asm("r0") = reinterpret_cast<uint32_t>(start); + register uint32_t end asm("r1") = beg + size; Added: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_base_cpu.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_base_cpu.cc Wed Jun 6 13:53:04 2018 (r471843) @@ -0,0 +1,19 @@ +--- src/3rdparty/chromium/v8/src/base/cpu.cc.orig 2018-03-20 07:26:22 UTC ++++ src/3rdparty/chromium/v8/src/base/cpu.cc +@@ -600,7 +600,7 @@ CPU::CPU() + #endif + + #elif V8_HOST_ARCH_ARM64 +- ++#if V8_OS_LINUX + CPUInfo cpu_info; + + // Extract implementor from the "CPU implementer" field. +@@ -634,6 +634,7 @@ CPU::CPU() + } + delete[] part; + } ++#endif // V8_OS_LINUX + + #elif V8_HOST_ARCH_PPC + Added: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc Wed Jun 6 13:53:04 2018 (r471843) @@ -0,0 +1,25 @@ +--- src/3rdparty/chromium/v8/src/base/platform/platform-freebsd.cc.orig 2017-09-25 11:52:56 UTC ++++ src/3rdparty/chromium/v8/src/base/platform/platform-freebsd.cc +@@ -36,6 +36,22 @@ namespace v8 { + namespace base { + + ++#ifdef __arm__ ++bool OS::ArmUsingHardFloat() { ++#if defined(__ARM_PCS_VFP) ++ return true; ++#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \ ++ !defined(__VFP_FP__) ++ return false; ++#else ++#error "Your compiler does not report the FP ABI compiled for." \ ++ "Please report it on this issue" \ ++ "http://code.google.com/p/v8/issues/detail?id=2140" ++#endif ++} ++#endif ++ ++ + const char* OS::LocalTimezone(double time, TimezoneCache* cache) { + if (std::isnan(time)) return ""; + time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); Added: head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_libsampler_sampler.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/qt5-webengine/files/patch-src_3rdparty_chromium_v8_src_libsampler_sampler.cc Wed Jun 6 13:53:04 2018 (r471843) @@ -0,0 +1,15 @@ +--- src/3rdparty/chromium/v8/src/libsampler/sampler.cc.orig 2018-03-20 07:19:58 UTC ++++ src/3rdparty/chromium/v8/src/libsampler/sampler.cc +@@ -499,9 +499,9 @@ void SignalHandler::FillRegisterState(void* context, R + state->sp = reinterpret_cast<void*>(mcontext.mc_rsp); + state->fp = reinterpret_cast<void*>(mcontext.mc_rbp); + #elif V8_HOST_ARCH_ARM +- state->pc = reinterpret_cast<void*>(mcontext.mc_r15); +- state->sp = reinterpret_cast<void*>(mcontext.mc_r13); +- state->fp = reinterpret_cast<void*>(mcontext.mc_r11); ++ state->pc = reinterpret_cast<void*>(mcontext.__gregs[_REG_PC]); ++ state->sp = reinterpret_cast<void*>(mcontext.__gregs[_REG_SP]); ++ state->fp = reinterpret_cast<void*>(mcontext.__gregs[_REG_FP]); + #endif // V8_HOST_ARCH_* + #elif V8_OS_NETBSD + #if V8_HOST_ARCH_IA32
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806061353.w56Dr4g5019901>