Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/xz: fix microblaze compiles
@ 2023-02-07 17:03 Vincent Fazio
  2023-02-07 22:06 ` Thomas Petazzoni via buildroot
  2023-02-28 15:48 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Vincent Fazio @ 2023-02-07 17:03 UTC (permalink / raw)
  To: buildroot; +Cc: Vincent Fazio

From: Vincent Fazio <vfazio@gmail.com>

Patch xz to check if __attribute__((symver ..)) is supported via a
compile check during configure.

Fixes:
  http://autobuild.buildroot.org/results/c0d/c0de72e5a34b379e0c516ad08984bb2c4b0abb5c//

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
---
 ...0001-Detect-symver-attribute-support.patch | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 package/xz/0001-Detect-symver-attribute-support.patch

diff --git a/package/xz/0001-Detect-symver-attribute-support.patch b/package/xz/0001-Detect-symver-attribute-support.patch
new file mode 100644
index 0000000000..9ec43ea7a0
--- /dev/null
+++ b/package/xz/0001-Detect-symver-attribute-support.patch
@@ -0,0 +1,61 @@
+From 231add523328ad9e021d8f2b02697b6a11719430 Mon Sep 17 00:00:00 2001
+From: Vincent Fazio <vfazio@gmail.com>
+Date: Tue, 7 Feb 2023 08:51:24 -0600
+Subject: [PATCH] Detect symver attribute support
+
+On non-ELF platforms, such as microblaze, builds will fail when trying
+to add symver information because  __attribute__((symver ..)) is not
+supported even though __has_attribute(__symver__) returns true.
+
+Support for symver needs to be detected via a compile test since
+__has_attribute can report false positives [0].
+
+Add a configure compile check for __attribute__((symver ..)) to ensure
+it is supported and define a variable to advertise support.
+
+[0] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766#c1
+
+Upstream: https://github.com/tukaani-project/xz/pull/32
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Signed-off-by: Vincent Fazio <vfazio@gmail.com>
+---
+ configure.ac                | 9 +++++++++
+ src/liblzma/common/common.h | 2 +-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5ad5589..08c623a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -791,6 +791,15 @@ else
+ 				time with Libtool if neither --with-pic nor
+ 				--without-pic is used). This define must be
+ 				used together with liblzma_linux.map.])
++			OLD_CFLAGS="$CFLAGS"
++			CFLAGS="$CFLAGS -Werror"  # we need -Werror to make sure the attribute is not ignored
++			AC_COMPILE_IFELSE([AC_LANG_SOURCE(
++				[__attribute__ ((symver ("test@TEST"))) void foo(void) { }
++				])],
++				[AC_DEFINE([HAVE_SYMVER_ATTRIBUTE], [1],
++					[Define to 1 if GCC supports the symver attribute])],
++				[])
++			CFLAGS="$OLD_CFLAGS"
+ 			;;
+ 		*)
+ 			enable_symbol_versions=generic
+diff --git a/src/liblzma/common/common.h b/src/liblzma/common/common.h
+index 11fec52..1d2ef9c 100644
+--- a/src/liblzma/common/common.h
++++ b/src/liblzma/common/common.h
+@@ -76,7 +76,7 @@
+ // too (which doesn't support __symver__) so use it to detect if __symver__
+ // is available. This should be far more reliable than looking at compiler
+ // version macros as nowadays especially __GNUC__ is defined by many compilers.
+-#	if lzma_has_attribute(__symver__)
++#	if defined(HAVE_SYMVER_ATTRIBUTE) 
+ #		define LZMA_SYMVER_API(extnamever, type, intname) \
+ 			extern __attribute__((__symver__(extnamever))) \
+ 					LZMA_API(type) intname
+-- 
+2.25.1
+
-- 
2.25.1

_______________________________________________
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 1/1] package/xz: fix microblaze compiles
  2023-02-07 17:03 [Buildroot] [PATCH 1/1] package/xz: fix microblaze compiles Vincent Fazio
@ 2023-02-07 22:06 ` Thomas Petazzoni via buildroot
  2023-02-28 15:48 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-07 22:06 UTC (permalink / raw)
  To: Vincent Fazio; +Cc: Vincent Fazio, buildroot

On Tue,  7 Feb 2023 11:03:03 -0600
Vincent Fazio <vfazio@xes-inc.com> wrote:

> From: Vincent Fazio <vfazio@gmail.com>
> 
> Patch xz to check if __attribute__((symver ..)) is supported via a
> compile check during configure.
> 
> Fixes:
>   http://autobuild.buildroot.org/results/c0d/c0de72e5a34b379e0c516ad08984bb2c4b0abb5c//
> 
> Signed-off-by: Vincent Fazio <vfazio@gmail.com>
> ---
>  ...0001-Detect-symver-attribute-support.patch | 61 +++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 package/xz/0001-Detect-symver-attribute-support.patch

Applied to master, thanks.

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 1/1] package/xz: fix microblaze compiles
  2023-02-07 17:03 [Buildroot] [PATCH 1/1] package/xz: fix microblaze compiles Vincent Fazio
  2023-02-07 22:06 ` Thomas Petazzoni via buildroot
@ 2023-02-28 15:48 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-02-28 15:48 UTC (permalink / raw)
  To: Vincent Fazio; +Cc: Vincent Fazio, buildroot

>>>>> "Vincent" == Vincent Fazio <vfazio@xes-inc.com> writes:

 > From: Vincent Fazio <vfazio@gmail.com>
 > Patch xz to check if __attribute__((symver ..)) is supported via a
 > compile check during configure.

 > Fixes:
 >   http://autobuild.buildroot.org/results/c0d/c0de72e5a34b379e0c516ad08984bb2c4b0abb5c//

 > Signed-off-by: Vincent Fazio <vfazio@gmail.com>

Committed to 2022.11.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:[~2023-02-28 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-07 17:03 [Buildroot] [PATCH 1/1] package/xz: fix microblaze compiles Vincent Fazio
2023-02-07 22:06 ` Thomas Petazzoni via buildroot
2023-02-28 15:48 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox