* [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection
@ 2021-08-03 22:41 Giulio Benetti
2021-08-04 10:02 ` Giulio Benetti
2021-08-04 20:57 ` Arnout Vandecappelle
0 siblings, 2 replies; 4+ messages in thread
From: Giulio Benetti @ 2021-08-03 22:41 UTC (permalink / raw)
To: buildroot; +Cc: Giulio Benetti, Asaf Kahlon
Add a patch to fix symver wrong detection. As explained into the patch
pending upstream[1] __has attribute() gives false positive when an
attribute is not supported[2] and this leads to assuming symver attribute
is present but it's not. This consequentely leads to build failure. I.e.
Microblaze doesn't really support it since it doesn't include include
elfos.h in config.gcc that determine symver to be available.
[1]: https://github.com/libfuse/libfuse/pull/620
[2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
...on.build-fix-wrong-.symver-detection.patch | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)
create mode 100644 package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
diff --git a/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
new file mode 100644
index 0000000000..da20c26f19
--- /dev/null
+++ b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
@@ -0,0 +1,61 @@
+From 3aba09a5c56e017746c5c1652dbc845f4db7374a Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Tue, 3 Aug 2021 23:39:46 +0200
+Subject: [PATCH] meson.build: fix wrong .symver detection
+
+As pointed here [1] __has_attribute() is broken for many attributes and
+if it doesn't support the specific attribute it returns true, so we
+can't really rely on that for this check. This lead to Buildroot
+libfuse3 build failure [2] where that shows up with:
+```
+error: symver is only supported on ELF platforms
+```
+Indeed Microblaze doesn't support ELF since it doesn't include elfos.h,
+but __has_attribute(symver) returns true.
+
+So let's substitute the #ifdef __has_attribute() with a stronger test on
+a function foo() with __attribute__((symver ("test@TEST"))).
+
+[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
+[2]: http://autobuild.buildroot.net/results/d6c/d6cfaf2aafaeda3c12d127f6a2d2e175b25e654f/build-end.log
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ meson.build | 16 +++++++---------
+ 1 file changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index b0250ee..a7281f3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -96,20 +96,18 @@ endif
+ # to have __has_attribute, then they are too old to support symver)
+ # other compilers might not have __has_attribute, but in those cases
+ # it is safe for this check to fail and for us to fallback to the old _asm_
+-# method for symver
++# method for symver. Anyway the attributes not supported by __has_attribute()
++# unfortunately return true giving a false positive. So let's try to build
++# using __attribute__ ((symver )) and see the result.
+ code = '''
+-#if defined __has_attribute
+-# if !__has_attribute (symver)
+-# error symver attribute not supported
+-# endif
+-#else
+-#error __has_attribute not defined, assume we do not have symver
+-#endif
++__attribute__ ((symver ("test@TEST")))
++void foo(void) {
++}
+
+ int main(void) {
+ return 0;
+ }'''
+-if cc.compiles(code, args: [ '-O0', '-c'])
++if cc.compiles(code, args: [ '-O0', '-c', '-Werror'])
+ message('Compiler supports symver attribute')
+ add_project_arguments('-DHAVE_SYMVER_ATTRIBUTE', language: 'c')
+ else
+--
+2.25.1
+
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection
2021-08-03 22:41 [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection Giulio Benetti
@ 2021-08-04 10:02 ` Giulio Benetti
2021-08-04 20:57 ` Arnout Vandecappelle
1 sibling, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2021-08-04 10:02 UTC (permalink / raw)
To: buildroot; +Cc: Asaf Kahlon
I've forgotten to add...
On 8/4/21 12:41 AM, Giulio Benetti wrote:
> Add a patch to fix symver wrong detection. As explained into the patch
> pending upstream[1] __has attribute() gives false positive when an
> attribute is not supported[2] and this leads to assuming symver attribute
> is present but it's not. This consequentely leads to build failure. I.e.
> Microblaze doesn't really support it since it doesn't include include
> elfos.h in config.gcc that determine symver to be available.
>
> [1]: https://github.com/libfuse/libfuse/pull/620
> [2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
Fixes:
http://autobuild.buildroot.net/results/d6c/d6cfaf2aafaeda3c12d127f6a2d2e175b25e654f/
can you please reword while committing? Otherwise I can send a v2.
Also the PR[1] has been merged.
Kind regards
--
Giulio Benetti
Benetti Engineering sas
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> ...on.build-fix-wrong-.symver-detection.patch | 61 +++++++++++++++++++
> 1 file changed, 61 insertions(+)
> create mode 100644 package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
>
> diff --git a/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
> new file mode 100644
> index 0000000000..da20c26f19
> --- /dev/null
> +++ b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
> @@ -0,0 +1,61 @@
> +From 3aba09a5c56e017746c5c1652dbc845f4db7374a Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Tue, 3 Aug 2021 23:39:46 +0200
> +Subject: [PATCH] meson.build: fix wrong .symver detection
> +
> +As pointed here [1] __has_attribute() is broken for many attributes and
> +if it doesn't support the specific attribute it returns true, so we
> +can't really rely on that for this check. This lead to Buildroot
> +libfuse3 build failure [2] where that shows up with:
> +```
> +error: symver is only supported on ELF platforms
> +```
> +Indeed Microblaze doesn't support ELF since it doesn't include elfos.h,
> +but __has_attribute(symver) returns true.
> +
> +So let's substitute the #ifdef __has_attribute() with a stronger test on
> +a function foo() with __attribute__((symver ("test@TEST"))).
> +
> +[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
> +[2]: http://autobuild.buildroot.net/results/d6c/d6cfaf2aafaeda3c12d127f6a2d2e175b25e654f/build-end.log
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + meson.build | 16 +++++++---------
> + 1 file changed, 7 insertions(+), 9 deletions(-)
> +
> +diff --git a/meson.build b/meson.build
> +index b0250ee..a7281f3 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -96,20 +96,18 @@ endif
> + # to have __has_attribute, then they are too old to support symver)
> + # other compilers might not have __has_attribute, but in those cases
> + # it is safe for this check to fail and for us to fallback to the old _asm_
> +-# method for symver
> ++# method for symver. Anyway the attributes not supported by __has_attribute()
> ++# unfortunately return true giving a false positive. So let's try to build
> ++# using __attribute__ ((symver )) and see the result.
> + code = '''
> +-#if defined __has_attribute
> +-# if !__has_attribute (symver)
> +-# error symver attribute not supported
> +-# endif
> +-#else
> +-#error __has_attribute not defined, assume we do not have symver
> +-#endif
> ++__attribute__ ((symver ("test@TEST")))
> ++void foo(void) {
> ++}
> +
> + int main(void) {
> + return 0;
> + }'''
> +-if cc.compiles(code, args: [ '-O0', '-c'])
> ++if cc.compiles(code, args: [ '-O0', '-c', '-Werror'])
> + message('Compiler supports symver attribute')
> + add_project_arguments('-DHAVE_SYMVER_ATTRIBUTE', language: 'c')
> + else
> +--
> +2.25.1
> +
>
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection
2021-08-03 22:41 [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection Giulio Benetti
2021-08-04 10:02 ` Giulio Benetti
@ 2021-08-04 20:57 ` Arnout Vandecappelle
2021-08-05 7:00 ` Giulio Benetti
1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2021-08-04 20:57 UTC (permalink / raw)
To: Giulio Benetti, buildroot; +Cc: Asaf Kahlon
On 04/08/2021 00:41, Giulio Benetti wrote:
> Add a patch to fix symver wrong detection. As explained into the patch
> pending upstream[1] __has attribute() gives false positive when an
> attribute is not supported[2] and this leads to assuming symver attribute
> is present but it's not. This consequentely leads to build failure. I.e.
> Microblaze doesn't really support it since it doesn't include include
> elfos.h in config.gcc that determine symver to be available.
>
> [1]: https://github.com/libfuse/libfuse/pull/620
> [2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
Excellent explanation!
Applied to master (after adding the Fixes: line), thanks.
Regards,
Arnout
>
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> ...on.build-fix-wrong-.symver-detection.patch | 61 +++++++++++++++++++
> 1 file changed, 61 insertions(+)
> create mode 100644 package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
>
> diff --git a/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
> new file mode 100644
> index 0000000000..da20c26f19
> --- /dev/null
> +++ b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
> @@ -0,0 +1,61 @@
> +From 3aba09a5c56e017746c5c1652dbc845f4db7374a Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Tue, 3 Aug 2021 23:39:46 +0200
> +Subject: [PATCH] meson.build: fix wrong .symver detection
> +
> +As pointed here [1] __has_attribute() is broken for many attributes and
> +if it doesn't support the specific attribute it returns true, so we
> +can't really rely on that for this check. This lead to Buildroot
> +libfuse3 build failure [2] where that shows up with:
> +```
> +error: symver is only supported on ELF platforms
> +```
> +Indeed Microblaze doesn't support ELF since it doesn't include elfos.h,
> +but __has_attribute(symver) returns true.
> +
> +So let's substitute the #ifdef __has_attribute() with a stronger test on
> +a function foo() with __attribute__((symver ("test@TEST"))).
> +
> +[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
> +[2]: http://autobuild.buildroot.net/results/d6c/d6cfaf2aafaeda3c12d127f6a2d2e175b25e654f/build-end.log
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + meson.build | 16 +++++++---------
> + 1 file changed, 7 insertions(+), 9 deletions(-)
> +
> +diff --git a/meson.build b/meson.build
> +index b0250ee..a7281f3 100644
> +--- a/meson.build
> ++++ b/meson.build
> +@@ -96,20 +96,18 @@ endif
> + # to have __has_attribute, then they are too old to support symver)
> + # other compilers might not have __has_attribute, but in those cases
> + # it is safe for this check to fail and for us to fallback to the old _asm_
> +-# method for symver
> ++# method for symver. Anyway the attributes not supported by __has_attribute()
> ++# unfortunately return true giving a false positive. So let's try to build
> ++# using __attribute__ ((symver )) and see the result.
> + code = '''
> +-#if defined __has_attribute
> +-# if !__has_attribute (symver)
> +-# error symver attribute not supported
> +-# endif
> +-#else
> +-#error __has_attribute not defined, assume we do not have symver
> +-#endif
> ++__attribute__ ((symver ("test@TEST")))
> ++void foo(void) {
> ++}
> +
> + int main(void) {
> + return 0;
> + }'''
> +-if cc.compiles(code, args: [ '-O0', '-c'])
> ++if cc.compiles(code, args: [ '-O0', '-c', '-Werror'])
> + message('Compiler supports symver attribute')
> + add_project_arguments('-DHAVE_SYMVER_ATTRIBUTE', language: 'c')
> + else
> +--
> +2.25.1
> +
>
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection
2021-08-04 20:57 ` Arnout Vandecappelle
@ 2021-08-05 7:00 ` Giulio Benetti
0 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2021-08-05 7:00 UTC (permalink / raw)
To: Arnout Vandecappelle; +Cc: Asaf Kahlon, buildroot
> Il giorno 4 ago 2021, alle ore 22:58, Arnout Vandecappelle <arnout@mind.be> ha scritto:
>
>
>
>> On 04/08/2021 00:41, Giulio Benetti wrote:
>> Add a patch to fix symver wrong detection. As explained into the patch
>> pending upstream[1] __has attribute() gives false positive when an
>> attribute is not supported[2] and this leads to assuming symver attribute
>> is present but it's not. This consequentely leads to build failure. I.e.
>> Microblaze doesn't really support it since it doesn't include include
>> elfos.h in config.gcc that determine symver to be available.
>>
>> [1]: https://github.com/libfuse/libfuse/pull/620
>> [2]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
>
> Excellent explanation!
Thanks a lot :-)
>
> Applied to master (after adding the Fixes: line), thanks.
>
> Regards,
> Arnout
>
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> ...on.build-fix-wrong-.symver-detection.patch | 61 +++++++++++++++++++
>> 1 file changed, 61 insertions(+)
>> create mode 100644 package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
>>
>> diff --git a/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
>> new file mode 100644
>> index 0000000000..da20c26f19
>> --- /dev/null
>> +++ b/package/libfuse3/0001-meson.build-fix-wrong-.symver-detection.patch
>> @@ -0,0 +1,61 @@
>> +From 3aba09a5c56e017746c5c1652dbc845f4db7374a Mon Sep 17 00:00:00 2001
>> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +Date: Tue, 3 Aug 2021 23:39:46 +0200
>> +Subject: [PATCH] meson.build: fix wrong .symver detection
>> +
>> +As pointed here [1] __has_attribute() is broken for many attributes and
>> +if it doesn't support the specific attribute it returns true, so we
>> +can't really rely on that for this check. This lead to Buildroot
>> +libfuse3 build failure [2] where that shows up with:
>> +```
>> +error: symver is only supported on ELF platforms
>> +```
>> +Indeed Microblaze doesn't support ELF since it doesn't include elfos.h,
>> +but __has_attribute(symver) returns true.
>> +
>> +So let's substitute the #ifdef __has_attribute() with a stronger test on
>> +a function foo() with __attribute__((symver ("test@TEST"))).
>> +
>> +[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
>> +[2]: http://autobuild.buildroot.net/results/d6c/d6cfaf2aafaeda3c12d127f6a2d2e175b25e654f/build-end.log
>> +
>> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> +---
>> + meson.build | 16 +++++++---------
>> + 1 file changed, 7 insertions(+), 9 deletions(-)
>> +
>> +diff --git a/meson.build b/meson.build
>> +index b0250ee..a7281f3 100644
>> +--- a/meson.build
>> ++++ b/meson.build
>> +@@ -96,20 +96,18 @@ endif
>> + # to have __has_attribute, then they are too old to support symver)
>> + # other compilers might not have __has_attribute, but in those cases
>> + # it is safe for this check to fail and for us to fallback to the old _asm_
>> +-# method for symver
>> ++# method for symver. Anyway the attributes not supported by __has_attribute()
>> ++# unfortunately return true giving a false positive. So let's try to build
>> ++# using __attribute__ ((symver )) and see the result.
>> + code = '''
>> +-#if defined __has_attribute
>> +-# if !__has_attribute (symver)
>> +-# error symver attribute not supported
>> +-# endif
>> +-#else
>> +-#error __has_attribute not defined, assume we do not have symver
>> +-#endif
>> ++__attribute__ ((symver ("test@TEST")))
>> ++void foo(void) {
>> ++}
>> +
>> + int main(void) {
>> + return 0;
>> + }'''
>> +-if cc.compiles(code, args: [ '-O0', '-c'])
>> ++if cc.compiles(code, args: [ '-O0', '-c', '-Werror'])
>> + message('Compiler supports symver attribute')
>> + add_project_arguments('-DHAVE_SYMVER_ATTRIBUTE', language: 'c')
>> + else
>> +--
>> +2.25.1
>> +
>>
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-05 7:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 22:41 [Buildroot] [PATCH] package/libfuse3: fix build failure on Microblaze due to wrong symver attribute detection Giulio Benetti
2021-08-04 10:02 ` Giulio Benetti
2021-08-04 20:57 ` Arnout Vandecappelle
2021-08-05 7:00 ` Giulio Benetti
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 NNTP newsgroup(s).