Fix failure of elf/tst-audit2 when compiled with GCC-5
Commit Message
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(+)
Comments
On 22 Jan 2015 18:10, Andreas Schwab wrote:
> 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.
lgtm
-mike
@@ -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)