Buildroot Archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Subject: [Buildroot] [git commit] package/zlib-ng: fix riscv build with uclibc
Date: Mon, 13 May 2024 22:40:48 +0200	[thread overview]
Message-ID: <20240513204453.D4F4387163@busybox.osuosl.org> (raw)

commit: https://git.buildroot.net/buildroot/commit/?id=36e417efc85141001df13a1e50f73dae682da4f3
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Fix the following riscv build failure with uclibc-ng < 1.0.43 raised
since bump to version 2.1.6 in commit
47b6737e841baf8b666ea9f37edc5f169652e88d and
https://github.com/zlib-ng/zlib-ng/commit/6ff8b52cefe56a824fae1d53fdd687bcde2e53c9:

/home/autobuild/autobuild/instance-2/output-1/build/zlib-ng-2.1.6/arch/riscv/riscv_features.c:4:10: fatal error: sys/auxv.h: No such file or directory
    4 | #include <sys/auxv.h>
      |          ^~~~~~~~~~~~

Fixes: 47b6737e841baf8b666ea9f37edc5f169652e88d
 - http://autobuild.buildroot.org/results/06a7d8e59ec4de7c711d3f4a4624f67b97d78afe

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 ...h-riscv-riscv-features-c-fix-uclibc-build.patch | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/package/zlib-ng/0001-arch-riscv-riscv-features-c-fix-uclibc-build.patch b/package/zlib-ng/0001-arch-riscv-riscv-features-c-fix-uclibc-build.patch
new file mode 100644
index 0000000000..39cc93f929
--- /dev/null
+++ b/package/zlib-ng/0001-arch-riscv-riscv-features-c-fix-uclibc-build.patch
@@ -0,0 +1,51 @@
+From 3f35bfccff2d1dacdfe9844712be1e042d028700 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 17 Mar 2024 21:56:53 +0100
+Subject: [PATCH] arch/riscv/riscv_features.c: fix uclibc build
+
+Fix the following uclibc build failure raised since version 2.1.4 and
+https://github.com/zlib-ng/zlib-ng/commit/6ff8b52cefe56a824fae1d53fdd687bcde2e53c9:
+
+/home/autobuild/autobuild/instance-2/output-1/build/zlib-ng-2.1.6/arch/riscv/riscv_features.c:4:10: fatal error: sys/auxv.h: No such file or directory
+    4 | #include <sys/auxv.h>
+      |          ^~~~~~~~~~~~
+
+Fixes:
+ - http://autobuild.buildroot.org/results/06a7d8e59ec4de7c711d3f4a4624f67b97d78afe
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/zlib-ng/zlib-ng/commit/3f35bfccff2d1dacdfe9844712be1e042d028700
+---
+ arch/riscv/riscv_features.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/arch/riscv/riscv_features.c b/arch/riscv/riscv_features.c
+index 506b480c11..1e3f45e0a7 100644
+--- a/arch/riscv/riscv_features.c
++++ b/arch/riscv/riscv_features.c
+@@ -1,9 +1,12 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <sys/auxv.h>
+ #include <sys/utsname.h>
+ 
++#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
++#  include <sys/auxv.h>
++#endif
++
+ #include "../../zbuild.h"
+ #include "riscv_features.h"
+ 
+@@ -33,7 +36,11 @@ void Z_INTERNAL riscv_check_features_compile_time(struct riscv_cpu_features *fea
+ }
+ 
+ void Z_INTERNAL riscv_check_features_runtime(struct riscv_cpu_features *features) {
++#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
+     unsigned long hw_cap = getauxval(AT_HWCAP);
++#else
++    unsigned long hw_cap = 0;
++#endif
+     features->has_rvv = hw_cap & ISA_V_HWCAP;
+ }
+ 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

                 reply	other threads:[~2024-05-13 20:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240513204453.D4F4387163@busybox.osuosl.org \
    --to=buildroot@buildroot.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).