On 2025/02/22 11:29, Hiroki Tagato wrote:
On 2025/02/20 1:26, Mark Millard wrote:
On Feb 19, 2025, at 06:42, Hiroki Tagato <tagat...@freebsd.org> wrote:
On 2025/02/19 18:05, Jason E. Hale wrote:
On Wed, Feb 19, 2025 at 3:20 AM Hiroki Tagato <tagat...@freebsd.org>
wrote:
On 2025/02/18 19:03, Mark Millard wrote:
On Feb 17, 2025, at 22:27, Mark Millard <mark...@yahoo.com> wrote:
On Feb 17, 2025, at 19:38, Mark Millard <mark...@yahoo.com> wrote:
I was doing a poudriere(-devel) "bulk -ca" test on an aarch64
system and ran into electron33 failing for multiple examples
of:
In file included from ../../third_party/unrar/src/crypt.cpp:1:
In file included from ../../third_party/unrar/src/rar.hpp:6:
../../third_party/unrar/src/os.hpp:167:10: fatal error: 'asm/
hwcap.h'
file not found
167 | #include <asm/hwcap.h>
| ^~~~~~~~~~~~~
1 error generated.
(Note: electron31 and electron32 are still building.)
It would seem appropriate to avoid wasting time on bad
build attempts as long as this is the case: while it is
not yet fixed, it likely should be marked as BROKEN_aarch64
in the Makefile involved.
electron32 got the same sort of failures:
2.3.0/pulseaudio-16.1/src -DPA_MAJOR=16 -c ../../third_party/unrar/
google/unrar_wrapper.cc -o obj/third_party/unrar/unrar/
unrar_wrapper.o
In file included from ../../third_party/unrar/google/
unrar_wrapper.cc:13:
In file included from ../../third_party/unrar/src/rar.hpp:6:
../../third_party/unrar/src/os.hpp:167:10: fatal error: 'asm/
hwcap.h'
file not found
167 | #include <asm/hwcap.h>
| ^~~~~~~~~~~~~
1 error generated.
Note: electron31 is still building.
I'll also note that chromium got the same sort of error:
In file included from ../../third_party/unrar/google/
unrar_wrapper.cc:13:
In file included from ../../third_party/unrar/src/rar.hpp:6:
../../third_party/unrar/src/os.hpp:167:10: fatal error: 'asm/
hwcap.h'
file not found
167 | #include <asm/hwcap.h>
| ^~~~~~~~~~~~~
1 error generated.
Note: ungoogled-chromium is still building, as is
iridium-browser .
By contrast:
electron31 and iridium-browser built just fine.
Note: ungoogled-chromium is still building.
Thanks for the report. I agree that electron{32,33} should be
marked as
BROKEN_aarch64 until a patch for fixing the issue is provided.
Unrar version 7 used by electron 32 and onward tries to include the
header in question. Older version (v6) of unrar, which is in turn used
by electron 31, does not.
Best regards,
Hiroki
Hi all,
I maintain archivers/libunrar and after seeing this, I just committed
a patch [1] to my port to fix this problem. The libunrar patches have
some additional guff to add openssl support that should not be
included for chromium-based projects, but the concept is basically the
same. Should be pretty easy to adapt.
[1] https://cgit.freebsd.org/ports/commit/?
id=96e53c0c65faa691e18c0a5558d8f445e6010a70
Hi Jason,
Thanks a lot for letting me know the commit. I will shortly prepare a
patch for electron ports based on that.
FYI:
I'll note that, while chromium did not build to completion,
ungoogled-chromium-132.0.6834.159.pkg built just fine in
the same "bulk -a" run. In my original reporting, it had
not yet completed but I forgot to report the completion at
the time I noticed it.
Hi Mark,
There was a report from mikael@ that electron32 built fine on aarch64
hardware. So I suspect you have some custom settings in make.conf and/or
poudriere.conf.
Do you have custom settings?
Anyway, I have prepared a patch for electron 32 and 33 based on the commit:
https://cgit.freebsd.org/ports/commit/?id=96e53c0c65faa691e18c0a5558d8f445e6010a70
Can you try again with the attached patch if/when you have available
resources?
# I don't have an aarch64 hardware so I can't test it by myself.
Best regards,
Hiroki
diff --git a/devel/electron32/Makefile b/devel/electron32/Makefile
index cb9ecf8985ac..d2e6e1a78a54 100644
--- a/devel/electron32/Makefile
+++ b/devel/electron32/Makefile
@@ -26,7 +26,6 @@ LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/electron/LICENSE
ONLY_FOR_ARCHS= aarch64 amd64 i386
-BROKEN_aarch64= fails to build: fatal error: 'asm/hwcap.h' file not found
FETCH_DEPENDS= yarn${NODEJS_SUFFIX}>0:www/yarn${NODEJS_SUFFIX}
EXTRACT_DEPENDS=yarn${NODEJS_SUFFIX}>0:www/yarn${NODEJS_SUFFIX}
diff --git a/devel/electron32/files/patch-third__party_unrar_src_crc.cpp b/devel/electron32/files/patch-third__party_unrar_src_crc.cpp
new file mode 100644
index 000000000000..ba777a00bd08
--- /dev/null
+++ b/devel/electron32/files/patch-third__party_unrar_src_crc.cpp
@@ -0,0 +1,22 @@
+--- third_party/unrar/src/crc.cpp.orig 2025-02-21 07:45:09 UTC
++++ third_party/unrar/src/crc.cpp
+@@ -43,12 +43,18 @@ void InitCRC32(uint *CRCTab)
+ }
+
+ #ifdef USE_NEON_CRC32
+- #ifdef _APPLE
++ #if defined(_APPLE)
+ // getauxval isn't available in OS X
+ uint Value=0;
+ size_t Size=sizeof(Value);
+ int RetCode=sysctlbyname("hw.optional.armv8_crc32",&Value,&Size,NULL,0);
+ CRC_Neon=RetCode==0 && Value!=0;
++ #elif defined(__FreeBSD__)
++ // getauxval isn't available on FreeBSD
++ uint64 Reg=READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_CRC32_VAL(Reg) == ID_AA64ISAR0_CRC32_BASE) {
++ CRC_Neon=true;
++ }
+ #else
+ CRC_Neon=(getauxval(AT_HWCAP) & HWCAP_CRC32)!=0;
+ #endif
diff --git a/devel/electron32/files/patch-third__party_unrar_src_os.hpp b/devel/electron32/files/patch-third__party_unrar_src_os.hpp
new file mode 100644
index 000000000000..e498ec39577e
--- /dev/null
+++ b/devel/electron32/files/patch-third__party_unrar_src_os.hpp
@@ -0,0 +1,16 @@
+--- third_party/unrar/src/os.hpp.orig 2025-02-21 07:47:52 UTC
++++ third_party/unrar/src/os.hpp
+@@ -162,9 +162,12 @@
+
+ #if defined(__aarch64__) && (defined(__ARM_FEATURE_CRYPTO) || defined(__ARM_FEATURE_CRC32))
+ #include <arm_neon.h>
+-#ifndef _APPLE
++#if !defined(_APPLE) && !defined(__FreeBSD__)
+ #include <sys/auxv.h>
+ #include <asm/hwcap.h>
++#endif
++#ifdef __FreeBSD__
++#include <machine/armreg.h>
+ #endif
+ #ifdef __ARM_FEATURE_CRYPTO
+ #define USE_NEON_AES
diff --git a/devel/electron32/files/patch-third__party_unrar_src_rijndael.cpp b/devel/electron32/files/patch-third__party_unrar_src_rijndael.cpp
new file mode 100644
index 000000000000..c01e3b9817bc
--- /dev/null
+++ b/devel/electron32/files/patch-third__party_unrar_src_rijndael.cpp
@@ -0,0 +1,24 @@
+--- third_party/unrar/src/rijndael.cpp.orig 2025-02-21 07:49:13 UTC
++++ third_party/unrar/src/rijndael.cpp
+@@ -116,7 +116,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint
+ #endif
+
+ #elif defined(USE_NEON_AES)
+- #ifdef _APPLE
++ #if defined(_APPLE)
+ // getauxval isn't available in OS X
+ uint Value=0;
+ size_t Size=sizeof(Value);
+@@ -126,6 +126,12 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint
+ // because "hw.optional.arm.FEAT_AES" was missing in OS X 11, but AES
+ // still was supported by Neon.
+ AES_Neon=RetCode!=0 || Value!=0;
++ #elif defined(__FreeBSD__)
++ // getauxval isn't available on FreeBSD
++ uint64 Reg=READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_AES_VAL(Reg) == ID_AA64ISAR0_AES_BASE) {
++ AES_Neon=true;
++ }
+ #else
+ AES_Neon=(getauxval(AT_HWCAP) & HWCAP_AES)!=0;
+ #endif
diff --git a/devel/electron33/Makefile b/devel/electron33/Makefile
index 577b5d6e97aa..b7508f009164 100644
--- a/devel/electron33/Makefile
+++ b/devel/electron33/Makefile
@@ -26,7 +26,6 @@ LICENSE_COMB= multi
LICENSE_FILE= ${WRKSRC}/electron/LICENSE
ONLY_FOR_ARCHS= aarch64 amd64 i386
-BROKEN_aarch64= fails to build: fatal error: 'asm/hwcap.h' file not found
FETCH_DEPENDS= yarn${NODEJS_SUFFIX}>0:www/yarn${NODEJS_SUFFIX}
EXTRACT_DEPENDS=yarn${NODEJS_SUFFIX}>0:www/yarn${NODEJS_SUFFIX}
diff --git a/devel/electron33/files/patch-third__party_unrar_src_crc.cpp b/devel/electron33/files/patch-third__party_unrar_src_crc.cpp
new file mode 100644
index 000000000000..ba777a00bd08
--- /dev/null
+++ b/devel/electron33/files/patch-third__party_unrar_src_crc.cpp
@@ -0,0 +1,22 @@
+--- third_party/unrar/src/crc.cpp.orig 2025-02-21 07:45:09 UTC
++++ third_party/unrar/src/crc.cpp
+@@ -43,12 +43,18 @@ void InitCRC32(uint *CRCTab)
+ }
+
+ #ifdef USE_NEON_CRC32
+- #ifdef _APPLE
++ #if defined(_APPLE)
+ // getauxval isn't available in OS X
+ uint Value=0;
+ size_t Size=sizeof(Value);
+ int RetCode=sysctlbyname("hw.optional.armv8_crc32",&Value,&Size,NULL,0);
+ CRC_Neon=RetCode==0 && Value!=0;
++ #elif defined(__FreeBSD__)
++ // getauxval isn't available on FreeBSD
++ uint64 Reg=READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_CRC32_VAL(Reg) == ID_AA64ISAR0_CRC32_BASE) {
++ CRC_Neon=true;
++ }
+ #else
+ CRC_Neon=(getauxval(AT_HWCAP) & HWCAP_CRC32)!=0;
+ #endif
diff --git a/devel/electron33/files/patch-third__party_unrar_src_os.hpp b/devel/electron33/files/patch-third__party_unrar_src_os.hpp
new file mode 100644
index 000000000000..e498ec39577e
--- /dev/null
+++ b/devel/electron33/files/patch-third__party_unrar_src_os.hpp
@@ -0,0 +1,16 @@
+--- third_party/unrar/src/os.hpp.orig 2025-02-21 07:47:52 UTC
++++ third_party/unrar/src/os.hpp
+@@ -162,9 +162,12 @@
+
+ #if defined(__aarch64__) && (defined(__ARM_FEATURE_CRYPTO) || defined(__ARM_FEATURE_CRC32))
+ #include <arm_neon.h>
+-#ifndef _APPLE
++#if !defined(_APPLE) && !defined(__FreeBSD__)
+ #include <sys/auxv.h>
+ #include <asm/hwcap.h>
++#endif
++#ifdef __FreeBSD__
++#include <machine/armreg.h>
+ #endif
+ #ifdef __ARM_FEATURE_CRYPTO
+ #define USE_NEON_AES
diff --git a/devel/electron33/files/patch-third__party_unrar_src_rijndael.cpp b/devel/electron33/files/patch-third__party_unrar_src_rijndael.cpp
new file mode 100644
index 000000000000..c01e3b9817bc
--- /dev/null
+++ b/devel/electron33/files/patch-third__party_unrar_src_rijndael.cpp
@@ -0,0 +1,24 @@
+--- third_party/unrar/src/rijndael.cpp.orig 2025-02-21 07:49:13 UTC
++++ third_party/unrar/src/rijndael.cpp
+@@ -116,7 +116,7 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint
+ #endif
+
+ #elif defined(USE_NEON_AES)
+- #ifdef _APPLE
++ #if defined(_APPLE)
+ // getauxval isn't available in OS X
+ uint Value=0;
+ size_t Size=sizeof(Value);
+@@ -126,6 +126,12 @@ void Rijndael::Init(bool Encrypt,const byte *key,uint
+ // because "hw.optional.arm.FEAT_AES" was missing in OS X 11, but AES
+ // still was supported by Neon.
+ AES_Neon=RetCode!=0 || Value!=0;
++ #elif defined(__FreeBSD__)
++ // getauxval isn't available on FreeBSD
++ uint64 Reg=READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_AES_VAL(Reg) == ID_AA64ISAR0_AES_BASE) {
++ AES_Neon=true;
++ }
+ #else
+ AES_Neon=(getauxval(AT_HWCAP) & HWCAP_AES)!=0;
+ #endif