public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] malloc: Fix tst-tcfree3 build csky-linux-gnuabiv2 with fortify source Date: Mon, 23 Oct 2023 16:44:38 +0000 (GMT) [thread overview] Message-ID: <20231023164438.DE345385802F@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=83d13972f23546758b600ba940e0d53248dd0339 commit 83d13972f23546758b600ba940e0d53248dd0339 Author: Adhemerval Zanella <adhemerval.zanella@linaro.org> Date: Mon Oct 23 13:33:47 2023 -0300 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> Diff: --- malloc/Makefile | 2 ++ malloc/tst-tcfree3.c | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/malloc/Makefile b/malloc/Makefile index c1db3347d8..f6cdf7bf0b 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -298,6 +298,8 @@ CPPFLAGS-malloc.c += -DUSE_TCACHE=1 # Uncomment this for test releases. For public releases it is too expensive. #CPPFLAGS-malloc.o += -DMALLOC_DEBUG=1 +CFLAGS-tst-tcfree3.c += -fno-builtin-malloc -fno-builtin-free + sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,') $(objpfx)mtrace: mtrace.pl 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) {
reply other threads:[~2023-10-23 16:44 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20231023164438.DE345385802F@sourceware.org \ --to=azanella@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).