package/libsepol: fix reallocarray detection
PATCH v2 1/1 package/libsepol: fix reallocarray detection
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 <[email protected]>
---v1->v2:
- Upstream should be a pull request, suggested by Yann
--- 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
package/libsepol/0002-remove-o-dev-null.patch new file +23 -0
@@ -0,0 +1,23 @@ +From 7a9b8b4329285215e5608c3393394bef435b2220 Mon Sep 17 00:00:00 2001 +From: Waldemar Brodkorb <[email protected]> +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 <[email protected]> +Upstream: https://github.com/SELinuxProject/selinux/pull/439 +--- +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 +
Signature · 6 lines
2.30.2 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot