libsepol: make reallocarray check more robust

Some cross-compiler toolchains dislike the usage of -o /dev/null and fail
with: ld: final link failed: file truncated

As stdin and stdout is already redirected to /dev/null there is
no need for gcc -o /dev/null.

This fixes an Buildroot autobuild failure for libsepol package:
http://autobuild.buildroot.net/results/72b/72baaab4658254f4c5b3348298af1d5c891cacd6/

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
This commit is contained in:
Waldemar Brodkorb 2024-08-22 04:34:08 +02:00
parent e79a14c77b
commit 48b84ecdcb

View File

@ -31,7 +31,7 @@ endif
# check for reallocarray(3) availability
H := \#
ifeq (yes,$(shell printf '${H}include <stdlib.h>\nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
ifeq (yes,$(shell printf '${H}include <stdlib.h>\nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c - >/dev/null 2>&1 && echo yes))
override CFLAGS += -DHAVE_REALLOCARRAY
endif