git: 5dd0d5fcb9b6 - main - net/oha: fix build on powerpc64le

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sun, 23 Feb 2025 19:36:04 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5dd0d5fcb9b60b2dfcbb75b2f03899a1c16dd4f3

commit 5dd0d5fcb9b60b2dfcbb75b2f03899a1c16dd4f3
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2025-02-23 13:30:30 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2025-02-23 19:35:46 +0000

    net/oha: fix build on powerpc64le
    
      In file included from /wrkdirs/usr/ports/net/oha/work/oha-1.7.0/cargo-crates/aws-lc-sys-0.25.0/aws-lc/crypto/fipsmodule/bcm.c:86:
      /wrkdirs/usr/ports/net/oha/work/oha-1.7.0/cargo-crates/aws-lc-sys-0.25.0/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c:72:28: error: call to undeclared function 'getauxval'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2);
                                 ^
      1 error generated.
---
 ...s-0.25.0_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/net/oha/files/patch-cargo-crates_aws-lc-sys-0.25.0_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c b/net/oha/files/patch-cargo-crates_aws-lc-sys-0.25.0_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c
new file mode 100644
index 000000000000..07c2af81aae6
--- /dev/null
+++ b/net/oha/files/patch-cargo-crates_aws-lc-sys-0.25.0_aws-lc_crypto_fipsmodule_cpucap_cpu__ppc64le.c
@@ -0,0 +1,14 @@
+--- cargo-crates/aws-lc-sys-0.25.0/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c.orig	2006-07-24 01:21:28 UTC
++++ cargo-crates/aws-lc-sys-0.25.0/aws-lc/crypto/fipsmodule/cpucap/cpu_ppc64le.c
+@@ -69,7 +69,11 @@ void OPENSSL_cpuid_setup(void) {
+ 
+ void OPENSSL_cpuid_setup(void) {
+ #if defined(AT_HWCAP2)
++# if defined(__linux__)
+   OPENSSL_ppc64le_hwcap2 = getauxval(AT_HWCAP2);
++#elif defined(__FreeBSD__)
++  elf_aux_info(AT_HWCAP2, &OPENSSL_ppc64le_hwcap2, sizeof(OPENSSL_ppc64le_hwcap2));
++#endif
+ #else
+   OPENSSL_ppc64le_hwcap2 = 0;
+ #endif