From: "mark at klomp dot org" <sourceware-bugzilla@sourceware.org>
To: elfutils-devel@sourceware.org
Subject: [Bug general/29141] _FORTIFY_SOURCE=3 fail for gcc 12/glibc 2.35
Date: Wed, 11 May 2022 11:10:03 +0000 [thread overview]
Message-ID: <bug-29141-10460-DCtcijgceL@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29141-10460@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=29141
Mark Wielaard <mark at klomp dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at klomp dot org,
| |siddhesh at sourceware dot org
--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
This is interesting. I recently fixed a similar warning in gdb (also for
-Werror=stringop-overflow, but not _FORTIFY_SOURCE related):
https://sourceware.org/pipermail/gdb-patches/2022-May/188694.html
I have added Siddhesh to the CC who might have seen this earlier.
Background is that in elfutils we are trying to use _FORTIFY_SOURCE=3 when it
is available using this configure snippet:
# See if we can add -D_FORTIFY_SOURCE=2 or =3. Don't do it if it is already
# (differently) defined or if it generates warnings/errors because we
# don't use the right optimisation level (string.h will warn about that).
AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 or =3 to CFLAGS])
case "$CFLAGS" in
*-D_FORTIFY_SOURCE=*)
AC_MSG_RESULT([no, already there])
;;
*)
save_CFLAGS="$CFLAGS"
# Try 3 first.
CFLAGS="-D_FORTIFY_SOURCE=3 $save_CFLAGS -Werror"
fortified_cflags=""
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
int main() { return 0; }
]])], [ AC_MSG_RESULT([yes -D_FORTIFY_SOURCE=3])
fortified_cflags="-D_FORTIFY_SOURCE=3" ], [])
# If that didn't work, try 2.
if test -z "$fortified_cflags"; then
CFLAGS="-D_FORTIFY_SOURCE=2 $save_CFLAGS -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
int main() { return 0; }
]])], [ AC_MSG_RESULT([yes -D_FORTIFY_SOURCE=2])
fortified_cflags="-D_FORTIFY_SOURCE=2" ],
[ AC_MSG_RESULT([no, cannot be used])])
fi
CFLAGS="$fortified_cflags $save_CFLAGS"
CXXFLAGS="$fortified_cflags $CXXFLAGS"
;;
esac
But it seems to produce gcc warnings like the above, so either our configure
foo is bad or we simply have to always use _FORTIFY_SOURCE=2.
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2022-05-11 11:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-11 8:12 [Bug general/29141] New: " ptr@void-ptr.info
2022-05-11 11:10 ` mark at klomp dot org [this message]
2022-05-11 16:04 ` [Bug general/29141] " siddhesh at sourceware dot org
2022-05-12 10:23 ` [Bug libc/29141] " siddhesh at sourceware dot org
2022-05-12 20:03 ` ptr@void-ptr.info
2022-05-13 3:44 ` ptr@void-ptr.info
2022-05-13 4:02 ` siddhesh at sourceware dot org
2022-05-16 14:41 ` cvs-commit at gcc dot gnu.org
2022-05-16 16:04 ` siddhesh at sourceware dot org
2022-05-16 16:24 ` cvs-commit at gcc dot gnu.org
2022-05-16 17:01 ` cvs-commit at gcc dot gnu.org
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=bug-29141-10460-DCtcijgceL@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=elfutils-devel@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: link
Be 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).