diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-10-23 13:33:47 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-10-23 13:34:04 -0300 |
commit | 83d13972f23546758b600ba940e0d53248dd0339 (patch) | |
tree | bc7815700464ce715da38d93a086b6c742237572 /malloc/tst-tcfree3.c | |
parent | 97290559c3b497fb9012c3f6248cb30afb26da7c (diff) | |
download | glibc-83d13972f23546758b600ba940e0d53248dd0339.tar.gz glibc-83d13972f23546758b600ba940e0d53248dd0339.tar.xz glibc-83d13972f23546758b600ba940e0d53248dd0339.zip |
malloc: Fix tst-tcfree3 build csky-linux-gnuabiv2 with fortify source
With gcc 13.1 with --enable-fortify-source=2, tst-tcfree3 fails to build on csky-linux-gnuabiv2 with: ../string/bits/string_fortified.h: In function ‘do_test’: ../string/bits/string_fortified.h:26:8: error: inlining failed in call to ‘always_inline’ ‘memcpy’: target specific option mismatch 26 | __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, | ^~~~~~ ../misc/sys/cdefs.h:81:62: note: in definition of macro ‘__NTH’ 81 | # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct | ^~~ tst-tcfree3.c:45:3: note: called from here 45 | memcpy (c, a, 32); | ^~~~~~~~~~~~~~~~~ Instead of relying on -O0 to avoid malloc/free to be optimized away, disable the builtin. Reviewed-by: DJ Delorie <dj@redhat.com>
Diffstat (limited to 'malloc/tst-tcfree3.c')
-rw-r--r-- | malloc/tst-tcfree3.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/malloc/tst-tcfree3.c b/malloc/tst-tcfree3.c index ce6d958f8a..30886b6f49 100644 --- a/malloc/tst-tcfree3.c +++ b/malloc/tst-tcfree3.c @@ -19,9 +19,6 @@ #include <malloc.h> #include <string.h> -/* Prevent GCC from optimizing away any malloc/free pairs. */ -#pragma GCC optimize ("O0") - static int do_test (void) { |