All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/libsepol: fix reallocarray detection
@ 2024-08-17 17:42 Waldemar Brodkorb
  2024-08-18  9:03 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Waldemar Brodkorb @ 2024-08-17 17:42 UTC (permalink / raw)
  To: buildroot

For some toolchains the detection of reallocarray fails with:
ld: final link failed: file truncated

It is hard to tell if it is a new feature of gcc or binutils
or even an architecture specific bug.
See here for example for an old bug where it was a HPPA specific
binutils problem:
https://sourceware.org/bugzilla/show_bug.cgi?id=19526

Fixes:
 - http://autobuild.buildroot.net/results/335/335aad5ecba2a4d21772767aa3a80d7d5631f4e4

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 package/libsepol/0002-remove-o-dev-null.patch | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 package/libsepol/0002-remove-o-dev-null.patch

diff --git a/package/libsepol/0002-remove-o-dev-null.patch b/package/libsepol/0002-remove-o-dev-null.patch
new file mode 100644
index 0000000000..b6559f6dbd
--- /dev/null
+++ b/package/libsepol/0002-remove-o-dev-null.patch
@@ -0,0 +1,23 @@
+From 7a9b8b4329285215e5608c3393394bef435b2220 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <wbx@openadk.org>
+Date: Sat, 17 Aug 2024 19:05:42 +0200
+Subject: [PATCH] remove -o /dev/null
+
+With -o /dev/null there is following error happening:
+ld: final link failed: file truncated
+
+Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
+Upstream: https://github.com/SELinuxProject/selinux/issues/438
+---
+diff -Nur libsepol-3.6.orig/src/Makefile libsepol-3.6/src/Makefile
+--- libsepol-3.6.orig/src/Makefile	2023-12-13 15:46:22.000000000 +0100
++++ libsepol-3.6/src/Makefile	2024-08-17 19:37:14.447327553 +0200
+@@ -31,7 +31,7 @@
+ 
+ # check for reallocarray(3) availability
+ H := \#
+-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include <stdlib.h>\nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
++ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include <stdlib.h>\nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c - >/dev/null 2>&1 && echo yes))
+ override CFLAGS += -DHAVE_REALLOCARRAY
+ endif
+ 
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/libsepol: fix reallocarray detection
  2024-08-17 17:42 [Buildroot] [PATCH] package/libsepol: fix reallocarray detection Waldemar Brodkorb
@ 2024-08-18  9:03 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2024-08-18  9:03 UTC (permalink / raw)
  To: Waldemar Brodkorb; +Cc: buildroot

Waldemar, All,

On 2024-08-17 19:42 +0200, Waldemar Brodkorb spake thusly:
> For some toolchains the detection of reallocarray fails with:
> ld: final link failed: file truncated
> 
> It is hard to tell if it is a new feature of gcc or binutils
> or even an architecture specific bug.
> See here for example for an old bug where it was a HPPA specific
> binutils problem:
> https://sourceware.org/bugzilla/show_bug.cgi?id=19526
> 
> Fixes:
>  - http://autobuild.buildroot.net/results/335/335aad5ecba2a4d21772767aa3a80d7d5631f4e4
> 
> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> ---
>  package/libsepol/0002-remove-o-dev-null.patch | 23 +++++++++++++++++++
>  1 file changed, 23 insertions(+)
>  create mode 100644 package/libsepol/0002-remove-o-dev-null.patch
> 
> diff --git a/package/libsepol/0002-remove-o-dev-null.patch b/package/libsepol/0002-remove-o-dev-null.patch
> new file mode 100644
> index 0000000000..b6559f6dbd
> --- /dev/null
> +++ b/package/libsepol/0002-remove-o-dev-null.patch
> @@ -0,0 +1,23 @@
> +From 7a9b8b4329285215e5608c3393394bef435b2220 Mon Sep 17 00:00:00 2001
> +From: Waldemar Brodkorb <wbx@openadk.org>
> +Date: Sat, 17 Aug 2024 19:05:42 +0200
> +Subject: [PATCH] remove -o /dev/null
> +
> +With -o /dev/null there is following error happening:
> +ld: final link failed: file truncated
> +
> +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> +Upstream: https://github.com/SELinuxProject/selinux/issues/438

The "Upstream" tag is to refer to what the status of the patch is. So,
rather than point to an upstream issue, you should rather submit the
patch anmd add the URL to that as an upstream tag.

It is nice to refer to the corrsponding issue, though, of course, but
then it should not be an "Upstream" tag, and just a pointer, like:

    Issue reported upstream: https://github.com/SELinuxProject/selinux/issues/438

Can you look into sending the patch upstream, and adding that as an
Upstream tag, please?

Regards,
Yann E. MORIN.

> +---
> +diff -Nur libsepol-3.6.orig/src/Makefile libsepol-3.6/src/Makefile
> +--- libsepol-3.6.orig/src/Makefile	2023-12-13 15:46:22.000000000 +0100
> ++++ libsepol-3.6/src/Makefile	2024-08-17 19:37:14.447327553 +0200
> +@@ -31,7 +31,7 @@
> + 
> + # check for reallocarray(3) availability
> + H := \#
> +-ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include <stdlib.h>\nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
> ++ifeq (yes,$(shell printf '${H}define _GNU_SOURCE\n${H}include <stdlib.h>\nint main(void){void*p=reallocarray(NULL, 1, sizeof(char));return 0;}' | $(CC) -x c - >/dev/null 2>&1 && echo yes))
> + override CFLAGS += -DHAVE_REALLOCARRAY
> + endif
> + 
> -- 
> 2.30.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-08-18  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-17 17:42 [Buildroot] [PATCH] package/libsepol: fix reallocarray detection Waldemar Brodkorb
2024-08-18  9:03 ` Yann E. MORIN

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.