All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/zlib-ng: Add upstream patch to fix build with uclibc
@ 2022-06-14 15:18 Ben Hutchings
  2022-07-22 21:00 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2022-06-14 15:18 UTC (permalink / raw)
  To: buildroot

Fix the following build failure with uclibc on arm architectures (and
similar on powerpc):

/home/buildroot/autobuild/instance-2/output-1/build/zlib-ng-2.0.6/arch/arm/armfeature.c:4:12: fatal error: sys/auxv.h: No such file or directory
    4 | #  include <sys/auxv.h>
      |            ^~~~~~~~~~~~
compilation terminated.

Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
---
 ...-sys-auxv.h-exists-at-configure-time.patch | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)
 create mode 100644 package/zlib-ng/0003-zlib-ng-check-that-sys-auxv.h-exists-at-configure-time.patch

diff --git a/package/zlib-ng/0003-zlib-ng-check-that-sys-auxv.h-exists-at-configure-time.patch b/package/zlib-ng/0003-zlib-ng-check-that-sys-auxv.h-exists-at-configure-time.patch
new file mode 100644
index 0000000000..ba8297cda7
--- /dev/null
+++ b/package/zlib-ng/0003-zlib-ng-check-that-sys-auxv.h-exists-at-configure-time.patch
@@ -0,0 +1,90 @@
+From e1baa6b439c06f3d0e6be3e381cc746ffb55aee1 Mon Sep 17 00:00:00 2001
+From: Mika Lindqvist <postmaster@raasu.org>
+Date: Wed, 13 Apr 2022 01:22:29 +0300
+Subject: [PATCH] Check that sys/auxv.h exists at configure time and add
+ preprocessor define for it. * Protect including sys/auxv.h in all relevant
+ files with the new preprocessor define * Test for both existence of both
+ sys/auxv.h and getauxval() with both cmake and configure
+
+[Ben Hutchings: Backport to 2.0.6:
+ - Drop the s390 changes
+ - Change some filenames]
+
+Backported from: e1baa6b439c06f3d0e6be3e381cc746ffb55aee1
+Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
+---
+ CMakeLists.txt        |    4 ++++
+ arch/arm/armfeature.c |    2 +-
+ arch/power/power.c    |    5 ++++-
+ configure             |   13 +++++++++++++
+ 4 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0dd196130..e4e4b7332 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -338,6 +338,10 @@ endif()
+ #
+ # Check for standard/system includes
+ #
++check_include_file(sys/auxv.h  HAVE_SYS_AUXV_H)
++if(HAVE_SYS_AUXV_H)
++    add_definitions(-DHAVE_SYS_AUXV_H)
++endif()
+ check_include_file(sys/sdt.h   HAVE_SYS_SDT_H)
+ if(HAVE_SYS_SDT_H)
+     add_definitions(-DHAVE_SYS_SDT_H)
+diff --git a/arch/arm/arm_features.c b/arch/arm/arm_features.c
+index 195c94992..f6b67687f 100644
+--- a/arch/arm/armfeature.c
++++ b/arch/arm/armfeature.c
+@@ -1,6 +1,6 @@
+ #include "../../zutil.h"
+ 
+-#if defined(__linux__)
++#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
+ #  include <sys/auxv.h>
+ #  ifdef ARM_ASM_HWCAP
+ #    include <asm/hwcap.h>
+diff --git a/arch/power/power_features.c b/arch/power/power_features.c
+index 9186b40d8..65599d9a7 100644
+--- a/arch/power/power.c
++++ b/arch/power/power.c
+@@ -1,9 +1,12 @@
+ /* POWER feature check
+  * Copyright (C) 2020 Matheus Castanho <msc@linux.ibm.com>, IBM
++ * Copyright (C) 2021-2022 Mika T. Lindqvist <postmaster@raasu.org>
+  * For conditions of distribution and use, see copyright notice in zlib.h
+  */
+ 
+-#include <sys/auxv.h>
++#ifdef HAVE_SYS_AUXV_H
++#  include <sys/auxv.h>
++#endif
+ #include "../../zutil.h"
+ 
+ Z_INTERNAL int power_cpu_has_arch_2_07;
+diff --git a/configure b/configure
+index aed1909cc..a357e1c8a 100755
+--- a/configure
++++ b/configure
+@@ -776,6 +776,19 @@ else
+   echo "Checking for strerror... No." | tee -a configure.log
+ fi
+ 
++# check for getauxval() for architecture feature detection at run-time
++cat > $test.c <<EOF
++#include <sys/auxv.h>
++int main() { return getauxval(0); }
++EOF
++if try $CC $CFLAGS -o $test $test.c $LDSHAREDLIBC; then
++  echo "Checking for getauxval() in sys/auxv.h... Yes." | tee -a configure.log
++  CFLAGS="${CFLAGS} -DHAVE_SYS_AUXV_H"
++  SFLAGS="${SFLAGS} -DHAVE_SYS_AUXV_H"
++else
++  echo "Checking for getauxval() in sys/auxv.h... No." | tee -a configure.log
++fi
++
+ # We need to remove zconf.h from source directory if building outside of it
+ if [ "$SRCDIR" != "$BUILDDIR" ]; then
+     rm -f $SRCDIR/zconf${SUFFIX}.h
-- 
2.30.2

-- 
Ben Hutchings · Senior Embedded Software Engineer, Essensium-Mind · mind.be
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] package/zlib-ng: Add upstream patch to fix build with uclibc
  2022-06-14 15:18 [Buildroot] [PATCH] package/zlib-ng: Add upstream patch to fix build with uclibc Ben Hutchings
@ 2022-07-22 21:00 ` Thomas Petazzoni via buildroot
  2022-08-11 19:29   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-07-22 21:00 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: buildroot

On Tue, 14 Jun 2022 17:18:57 +0200
Ben Hutchings <ben.hutchings@mind.be> wrote:

> Fix the following build failure with uclibc on arm architectures (and
> similar on powerpc):
> 
> /home/buildroot/autobuild/instance-2/output-1/build/zlib-ng-2.0.6/arch/arm/armfeature.c:4:12: fatal error: sys/auxv.h: No such file or directory
>     4 | #  include <sys/auxv.h>
>       |            ^~~~~~~~~~~~
> compilation terminated.
> 
> Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
> ---
>  ...-sys-auxv.h-exists-at-configure-time.patch | 90 +++++++++++++++++++
>  1 file changed, 90 insertions(+)
>  create mode 100644 package/zlib-ng/0003-zlib-ng-check-that-sys-auxv.h-exists-at-configure-time.patch

Applied to master after adding a reference to an autobuilder failure
that this is fixing.

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] package/zlib-ng: Add upstream patch to fix build with uclibc
  2022-07-22 21:00 ` Thomas Petazzoni via buildroot
@ 2022-08-11 19:29   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-08-11 19:29 UTC (permalink / raw)
  To: Thomas Petazzoni via buildroot; +Cc: Ben Hutchings, Thomas Petazzoni

>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:

 > On Tue, 14 Jun 2022 17:18:57 +0200
 > Ben Hutchings <ben.hutchings@mind.be> wrote:

 >> Fix the following build failure with uclibc on arm architectures (and
 >> similar on powerpc):
 >> 
 >> /home/buildroot/autobuild/instance-2/output-1/build/zlib-ng-2.0.6/arch/arm/armfeature.c:4:12: fatal error: sys/auxv.h: No such file or directory
 >> 4 | #  include <sys/auxv.h>
 >> |            ^~~~~~~~~~~~
 >> compilation terminated.
 >> 
 >> Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
 >> ---
 >> ...-sys-auxv.h-exists-at-configure-time.patch | 90 +++++++++++++++++++
 >> 1 file changed, 90 insertions(+)
 >> create mode 100644 package/zlib-ng/0003-zlib-ng-check-that-sys-auxv.h-exists-at-configure-time.patch

 > Applied to master after adding a reference to an autobuilder failure
 > that this is fixing.

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-11 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-14 15:18 [Buildroot] [PATCH] package/zlib-ng: Add upstream patch to fix build with uclibc Ben Hutchings
2022-07-22 21:00 ` Thomas Petazzoni via buildroot
2022-08-11 19:29   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.