On an rpi3 running FreeBSD 13.0-CURRENT r344791 GENERIC arm64 with ports at Revision: 495224 attempts to compile www/chromium using make -DBATCH MAKE_UNSAFE_JOBS=yes DISABLE_VULNERABILITIES=yes > make.log & result in make stopping with /usr/include/machine/ucontext.h:46:2: error: unknown type name '__uint128_t' __uint128_t fp_q[32]; ^ 1 error generated.
The underlying problem appears to be these compiler flags: --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -mfpu=neon -mthumb It's trying to compile for 32 bit ARM on a 64 bit system.
Created attachment 203376 [details] patch can you try this patch?
(In reply to mikael.urankar from comment #2) Mikael, patch-third__party_boringssl_src_crypto_cpu-aarch64-linux.c fails to apply cleanly. Would you mind regenerating patches after r498279? Thanks
Created attachment 203677 [details] patch Regenerate patch after r498279.
Created attachment 203682 [details] patch Regen patch. I have this issue later in the build, does it build fine on amd64? In file included from ../../third_party/swiftshader/third_party/llvm-7.0/llvm/lib/Support/Process.cpp:94: In file included from ../../third_party/swiftshader/third_party/llvm-7.0/llvm/lib/Support/Unix/Process.inc:40: /usr/include/malloc.h:3:2: error: "<malloc.h> has been replaced by <stdlib.h>" #error "<malloc.h> has been replaced by <stdlib.h>" ^ In file included from ../../third_party/swiftshader/third_party/llvm-7.0/llvm/lib/Support/Process.cpp:94: ../../third_party/swiftshader/third_party/llvm-7.0/llvm/lib/Support/Unix/Process.inc:89:19: error: variable has incomplete type 'struct mallinfo' struct mallinfo mi; ^ ../../third_party/swiftshader/third_party/llvm-7.0/llvm/lib/Support/Unix/Process.inc:89:10: note: forward declaration of 'mallinfo' struct mallinfo mi; ^ ../../third_party/swiftshader/third_party/llvm-7.0/llvm/lib/Support/Unix/Process.inc:90:10: error: no member named 'mallinfo' in the global namespace mi = ::mallinfo(); ~~^ 3 errors generated.
(In reply to mikael.urankar from comment #5) Try to tweak third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h --- third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h.orig 2019-04-15 10:32:41 UTC +++ third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/config.h @@ -122,7 +122,7 @@ /* #undef HAVE_MALLCTL */ /* Define to 1 if you have the `mallinfo' function. */ -#define HAVE_MALLINFO 1 +/* #define HAVE_MALLINFO 1 */ /* Define to 1 if you have the <malloc.h> header file. */ #define HAVE_MALLOC_H 1
(In reply to Carlos J. Puga Medina from comment #6) More patches to unbreak build on arm64 -- third_party/swiftshader/src/Reactor/BUILD.gn.orig 2019-04-15 10:31:54 UTC +++ third_party/swiftshader/src/Reactor/BUILD.gn @@ -170,9 +170,6 @@ config("swiftshader_reactor_private_config") { ] } else { cflags = [ "-Wno-unused-local-typedef" ] - if(target_cpu == "arm64") { - cflags += [ "-Wno-defaulted-function-deleted" ] - } defines = [ "__STDC_CONSTANT_MACROS", "__STDC_LIMIT_MACROS", --- third_party/swiftshader/third_party/llvm-7.0/BUILD.gn.orig 2019-04-15 10:31:14 UTC +++ third_party/swiftshader/third_party/llvm-7.0/BUILD.gn @@ -61,10 +61,6 @@ config("swiftshader_llvm_private_config") { } } - if(target_cpu == "arm64") { - cflags += [ "-Wno-defaulted-function-deleted" ] - } - cflags += [ "-Wno-attributes", "-Wno-deprecated-declarations",
I started a new build on amd64, let's see what happens.
more patches are needed (third_party/zlib/arm_features.c), java is also needed What do you prefer for swiftshader (I still don't understand how it can compiles on amd64) - I patch third_party/swiftshader/third_party/llvm-7.0/configs/linux/include/llvm/Config/* - I create a new dir 'bsd' with our stuff in it: --- third_party/swiftshader/third_party/llvm-7.0/BUILD.gn.orig 2019-04-15 16:11:25.681968000 +0200 +++ third_party/swiftshader/third_party/llvm-7.0/BUILD.gn 2019-04-15 12:02:01.926709000 +0200 @@ -98,7 +98,9 @@ llvm_include_dirs = [ "configs/common/lib/Transforms/InstCombine/", ] -if (is_linux) { +if (is_bsd) { + llvm_include_dirs += [ "configs/bsd/include/" ] +} else if (is_linux) { llvm_include_dirs += [ "configs/linux/include/" ] } else if (is_fuchsia) { llvm_include_dirs += [ "configs/fuchsia/include/" ]
(In reply to mikael.urankar from comment #9) I prefer whatever is more comfortable to maintain these patches, but I leave the final decision in your hands :)
We can drop third_party/zlib/arm_features.c and patch third_party/zlib/BUILD.gn https://codesearch.chromium.org/chromium/src/third_party/zlib/BUILD.gn?q=third_party/zlib/BUILD.gn&sq=package:chromium&dr&l=1
(In reply to Carlos J. Puga Medina from comment #10) sure thing, here is an inline patch: --- Makefile (revision 498947) +++ Makefile (working copy) @@ -66,6 +66,7 @@ noto-basic>0:x11-fonts/noto-basic BROKEN_FreeBSD_11_aarch64= components/safe_browsing_db/v4_rice.cc:120:18: use of overloaded operator '&' is ambiguous +BROKEN_aarch64= use www/firefox instead ONLY_FOR_ARCHS= aarch64 amd64 i386 :p
(In reply to Carlos J. Puga Medina from comment #11) This should work :P --- third_party/zlib/BUILD.gn.orig 2019-04-15 18:44:25.862148000 +0200 +++ third_party/zlib/BUILD.gn 2019-04-15 18:45:56.556127000 +0200 @@ -67,7 +67,7 @@ # implement the CRC32* instructions. These are optional in ARMv8.0." # - Fuchsia just added a syscall for feature detection. # TODO(cavalcantii): crbug.com/810125. - if (!is_ios && !is_fuchsia) { + if (!is_ios && !is_fuchsia && !is_freebsd) { defines = [ "CRC32_ARMV8_CRC32" ] if (is_android) { defines += [ "ARMV8_OS_ANDROID" ] @@ -80,7 +80,7 @@ source_set("zlib_arm_crc32") { visibility = [ ":*" ] - if (is_clang && (!is_ios && !is_fuchsia)) { + if (is_clang && (!is_ios && !is_fuchsia && !is_freebsd)) { include_dirs = [ "." ] if (is_android) {
Created attachment 203732 [details] patch
(In reply to mikael.urankar from comment #14) Testing patch on FreeBSD 13.0-CURRENT/amd64.
A commit references this bug: Author: cpm Date: Wed Apr 17 20:46:32 UTC 2019 New revision: 499210 URL: https://svnweb.freebsd.org/changeset/ports/499210 Log: www/chromium: Unbreak on arm64 PR: 236441 Submitted by: Mikael Urankar <mikael.urankar@gmail.com> MFH: 2019Q2 Changes: head/www/chromium/Makefile head/www/chromium/files/patch-build_detect__host__arch.py head/www/chromium/files/patch-third__party_boringssl_src_crypto_cpu-aarch64-linux.c head/www/chromium/files/patch-third__party_crc32c_src_src_crc32c__arm64__linux__check.h head/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_config.h head/www/chromium/files/patch-third__party_swiftshader_third__party_llvm-7.0_configs_linux_include_llvm_Config_llvm-config.h head/www/chromium/files/patch-third__party_zlib_arm__features.c head/www/chromium/files/patch-tools_gn_util_sys__info.cc
Committed, thanks!