* [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms
@ 2022-12-24 4:46 Tan En De
2022-12-27 20:48 ` Thomas Petazzoni via buildroot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tan En De @ 2022-12-24 4:46 UTC (permalink / raw)
To: buildroot; +Cc: Stephan Mueller, Tan En De
The following error is observed on Microblaze [1] build:
```
error: symver is only supported on ELF platforms
```
due to using __attribute__((symver)) on non-ELF platform.
So, revert to using .symver in such case.
[1]: http://autobuild.buildroot.net/results/447/4470efb5a078c0e368f6bd4f5ec455eea5eeebb5/build-end.log
Upstream status: commit f630ed1f807e26de04b3a5dfd7f1b39d1c5cb642
https://github.com/smuellerDD/libkcapi/pull/147
Signed-off-by: Tan En De <ende.tan@starfivetech.com>
Signed-off-by: Stephan Mueller <smueller@chronox.de>
---
...ver-build-error-on-non-ELF-platforms.patch | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 package/libkcapi/0003-Fix-symver-build-error-on-non-ELF-platforms.patch
diff --git a/package/libkcapi/0003-Fix-symver-build-error-on-non-ELF-platforms.patch b/package/libkcapi/0003-Fix-symver-build-error-on-non-ELF-platforms.patch
new file mode 100644
index 0000000000..206ac7ec4a
--- /dev/null
+++ b/package/libkcapi/0003-Fix-symver-build-error-on-non-ELF-platforms.patch
@@ -0,0 +1,84 @@
+From f630ed1f807e26de04b3a5dfd7f1b39d1c5cb642 Mon Sep 17 00:00:00 2001
+From: Tan En De <ende.tan@starfivetech.com>
+Date: Sat, 26 Nov 2022 07:47:39 +0800
+Subject: [PATCH] Fix symver build error on non-ELF platforms
+
+The following error is observed on Microblaze [1] build:
+```
+error: symver is only supported on ELF platforms
+```
+due to using __attribute__((symver)) on non-ELF platform.
+So, revert to using .symver in such case.
+
+[1]: http://autobuild.buildroot.net/results/447/4470efb5a078c0e368f6bd4f5ec455eea5eeebb5/build-end.log
+
+Signed-off-by: Tan En De <ende.tan@starfivetech.com>
+Signed-off-by: Stephan Mueller <smueller@chronox.de>
+---
+Upstream status: commit f630ed1f807e26de04b3a5dfd7f1b39d1c5cb642
+
+ configure.ac | 2 ++
+ lib/internal.h | 2 +-
+ m4/ac_check_attribute_symver.m4 | 24 ++++++++++++++++++++++++
+ 3 files changed, 27 insertions(+), 1 deletion(-)
+ create mode 100644 m4/ac_check_attribute_symver.m4
+
+diff --git a/configure.ac b/configure.ac
+index e230577..ba17404 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,6 +76,8 @@ AX_ADD_FORTIFY_SOURCE
+
+ AC_CHECK_API_VERSION
+
++AC_CHECK_ATTRIBUTE_SYMVER
++
+ AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], [Disable -Werror])], [with_werror=$enableval], [with_werror=yes])
+ AM_CONDITIONAL([ENABLE_WERROR], [test "x$with_werror" = "xyes"])
+
+diff --git a/lib/internal.h b/lib/internal.h
+index 14844a9..7977b04 100644
+--- a/lib/internal.h
++++ b/lib/internal.h
+@@ -352,7 +352,7 @@ static inline int io_getevents(__attribute__((unused)) aio_context_t ctx,
+ * Auxiliary macros
+ ************************************************************/
+
+-#if __GNUC__ >= 10
++#if HAVE_ATTRIBUTE_SYMVER && __GNUC__ >= 10
+ # define IMPL_SYMVER(name, version) \
+ __attribute__((__symver__("kcapi_" #name "@@LIBKCAPI_" version)))
+
+diff --git a/m4/ac_check_attribute_symver.m4 b/m4/ac_check_attribute_symver.m4
+new file mode 100644
+index 0000000..b484c5e
+--- /dev/null
++++ b/m4/ac_check_attribute_symver.m4
+@@ -0,0 +1,24 @@
++dnl Check compiler support for symver function attribute
++AC_DEFUN([AC_CHECK_ATTRIBUTE_SYMVER], [
++ saved_CFLAGS=$CFLAGS
++ CFLAGS="-O0 -Werror"
++ AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM(
++ [[
++ void _test_attribute_symver(void);
++ __attribute__((__symver__("sym@VER_1.2.3"))) void _test_attribute_symver(void) {}
++ ]],
++ [[
++ _test_attribute_symver()
++ ]]
++ )],
++ [
++ AC_DEFINE([HAVE_ATTRIBUTE_SYMVER], 1, [Define to 1 if __attribute__((symver)) is supported])
++ ],
++ [
++ AC_DEFINE([HAVE_ATTRIBUTE_SYMVER], 0, [Define to 0 if __attribute__((symver)) is not supported])
++ ]
++ )
++ CFLAGS=$saved_CFLAGS
++])
++
+--
+2.34.1
+
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms
2022-12-24 4:46 [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms Tan En De
@ 2022-12-27 20:48 ` Thomas Petazzoni via buildroot
[not found] ` <2665585.mvXUDI8C0e@positron.chronox.de>
2023-01-02 7:25 ` Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-12-27 20:48 UTC (permalink / raw)
To: Tan En De; +Cc: Stephan Mueller, buildroot
On Sat, 24 Dec 2022 12:46:16 +0800
Tan En De <ende.tan@starfivetech.com> wrote:
> The following error is observed on Microblaze [1] build:
> ```
> error: symver is only supported on ELF platforms
> ```
> due to using __attribute__((symver)) on non-ELF platform.
> So, revert to using .symver in such case.
>
> [1]: http://autobuild.buildroot.net/results/447/4470efb5a078c0e368f6bd4f5ec455eea5eeebb5/build-end.log
>
> Upstream status: commit f630ed1f807e26de04b3a5dfd7f1b39d1c5cb642
> https://github.com/smuellerDD/libkcapi/pull/147
>
> Signed-off-by: Tan En De <ende.tan@starfivetech.com>
> Signed-off-by: Stephan Mueller <smueller@chronox.de>
> ---
> ...ver-build-error-on-non-ELF-platforms.patch | 84 +++++++++++++++++++
> 1 file changed, 84 insertions(+)
> create mode 100644 package/libkcapi/0003-Fix-symver-build-error-on-non-ELF-platforms.patch
Applied to master, thanks. This macro AC_CHECK_ATTRIBUTE_SYMVER is
actually very good, and I believe a few other packages in Buildroot
could potentially benefit from it.
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] 4+ messages in thread
* Re: [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms
[not found] ` <2665585.mvXUDI8C0e@positron.chronox.de>
@ 2022-12-28 1:42 ` EnDe Tan
0 siblings, 0 replies; 4+ messages in thread
From: EnDe Tan @ 2022-12-28 1:42 UTC (permalink / raw)
To: Stephan Müller, buildroot
Hi Stephan Müller,
> -----Original Message-----
> From: Stephan Müller <smueller@chronox.de>
> Sent: Wednesday, 28 December, 2022 3:39 AM
> To: buildroot@buildroot.org; EnDe Tan <ende.tan@starfivetech.com>
> Cc: EnDe Tan <ende.tan@starfivetech.com>
> Subject: Re: [1/1] package/libkcapi: Fix symver build error on non-ELF
> platforms
>
> Am Samstag, 24. Dezember 2022, 05:46:16 CET schrieb Tan En De:
>
> Hi Tan,
>
>
> > The following error is observed on Microblaze [1] build:
> > ```
> > error: symver is only supported on ELF platforms ``` due to using
> > __attribute__((symver)) on non-ELF platform.
> > So, revert to using .symver in such case.
>
> Can you please help me what you want me to do? Does the patch you
> provided not work for you?
Nothing to do, I Cc'd you just to inform that I submitted this Buildroot patch corresponding to my merged pull request that day (https://github.com/smuellerDD/libkcapi/pull/147). Thanks :-)
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms
2022-12-24 4:46 [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms Tan En De
2022-12-27 20:48 ` Thomas Petazzoni via buildroot
[not found] ` <2665585.mvXUDI8C0e@positron.chronox.de>
@ 2023-01-02 7:25 ` Peter Korsgaard
2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2023-01-02 7:25 UTC (permalink / raw)
To: Tan En De; +Cc: Stephan Mueller, buildroot
>>>>> "Tan" == Tan En De <ende.tan@starfivetech.com> writes:
> The following error is observed on Microblaze [1] build:
> ```
> error: symver is only supported on ELF platforms
> ```
> due to using __attribute__((symver)) on non-ELF platform.
> So, revert to using .symver in such case.
> [1]: http://autobuild.buildroot.net/results/447/4470efb5a078c0e368f6bd4f5ec455eea5eeebb5/build-end.log
> Upstream status: commit f630ed1f807e26de04b3a5dfd7f1b39d1c5cb642
> https://github.com/smuellerDD/libkcapi/pull/147
> Signed-off-by: Tan En De <ende.tan@starfivetech.com>
> Signed-off-by: Stephan Mueller <smueller@chronox.de>
Committed to 2022.11.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-01-02 7:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-24 4:46 [Buildroot] [1/1] package/libkcapi: Fix symver build error on non-ELF platforms Tan En De
2022-12-27 20:48 ` Thomas Petazzoni via buildroot
[not found] ` <2665585.mvXUDI8C0e@positron.chronox.de>
2022-12-28 1:42 ` EnDe Tan
2023-01-02 7:25 ` 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.