This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Fix failure of elf/tst-audit2 when compiled with GCC-5
- From: Andreas Schwab <schwab at suse dot de>
- To: libc-alpha at sourceware dot org
- Date: Thu, 22 Jan 2015 18:10:51 +0100
- Subject: [PATCH] Fix failure of elf/tst-audit2 when compiled with GCC-5
- Authentication-results: sourceware.org; auth=none
GCC-5 translates a malloc call that is followed by memset on the return
value into a call to calloc, which will of course call our calloc
recursively. Prevent that by passing -fno-builtin.
Tested on x86_64-suse-linux.
Andreas.
* elf/Makefile (CFLAGS-tst-audit2.c): Define.
---
elf/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/elf/Makefile b/elf/Makefile
index e5b142c..7a1093b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1016,6 +1016,8 @@ $(objpfx)tst-audit1.out: $(objpfx)tst-auditmod1.so
tst-audit1-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
$(objpfx)tst-audit2.out: $(objpfx)tst-auditmod1.so
+# Prevent GCC-5 from translating a malloc/memset pair into calloc
+CFLAGS-tst-audit2.c += -fno-builtin
tst-audit2-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
$(objpfx)tst-audit9: $(libdl)
--
2.2.2
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."