This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] tests: move -D_FORTIFY_SOURCE to CPPFLAGS
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 6 May 2012 19:53:53 -0400
- Subject: Re: [PATCH] tests: move -D_FORTIFY_SOURCE to CPPFLAGS
- References: <1336344661-26623-1-git-send-email-vapier@gentoo.org>
On Sun, May 6, 2012 at 6:51 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> The -D_FORTIFY_SOURCE flags are being added to the test-specific CFLAGS
> values when they should be the test-specific CPPFLAGS values. ?Otherwise
> the values don't override the user-specified CPPFLAGS and might end up
> breaking the tests.
Is this because the tests in question are being compiled with g++?
If that's the case then this patch looks good to me.
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2012-05-06 ?Mike Frysinger ?<vapier@gentoo.org>
>
> ? ? ? ?* debug/Makefile (CFLAGS-tst-longjmp_chk.c): Delete
> ? ? ? ?-D_FORTIFY_SOURCE=1.
> ? ? ? ?(CPPFLAGS-tst-longjmp_chk.c): Define.
> ? ? ? ?(CFLAGS-tst-longjmp_chk2.c): Delete -D_FORTIFY_SOURCE=1.
> ? ? ? ?(CPPFLAGS-tst-longjmp_chk2.c): Define.
> ? ? ? ?* wcsmbs/Makefile (CPPFLAGS-tst-wchar-h.c): Rename from
> ? ? ? ?CFLAGS-tst-wchar-h.c.
> ---
> ?debug/Makefile ?| ? ?8 ++++----
> ?wcsmbs/Makefile | ? ?2 +-
> ?2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/debug/Makefile b/debug/Makefile
> index fb8c285..aab4d9d 100644
> --- a/debug/Makefile
> +++ b/debug/Makefile
> @@ -79,10 +79,10 @@ CFLAGS-pread_chk.c = -fexceptions -fasynchronous-unwind-tables
> ?CFLAGS-pread64_chk.c = -fexceptions -fasynchronous-unwind-tables
> ?CFLAGS-recv_chk.c = -fexceptions -fasynchronous-unwind-tables
> ?CFLAGS-recvfrom_chk.c = -fexceptions -fasynchronous-unwind-tables
> -CFLAGS-tst-longjmp_chk.c = -fexceptions -fasynchronous-unwind-tables \
> - ? ? ? ? ? ? ? ? ? ? ? ? ?-D_FORTIFY_SOURCE=1
> -CFLAGS-tst-longjmp_chk2.c = -fexceptions -fasynchronous-unwind-tables \
> - ? ? ? ? ? ? ? ? ? ? ? ? ? -D_FORTIFY_SOURCE=1
> +CFLAGS-tst-longjmp_chk.c = -fexceptions -fasynchronous-unwind-tables
> +CPPFLAGS-tst-longjmp_chk.c = -D_FORTIFY_SOURCE=1
> +CFLAGS-tst-longjmp_chk2.c = -fexceptions -fasynchronous-unwind-tables
> +CPPFLAGS-tst-longjmp_chk2.c = -D_FORTIFY_SOURCE=1
>
> ?# We know these tests have problems with format strings, this is what
> ?# we are testing. ?Disable that warning.
> diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
> index c4d31d9..3455278 100644
> --- a/wcsmbs/Makefile
> +++ b/wcsmbs/Makefile
> @@ -67,7 +67,7 @@ CFLAGS-wcstoull_l.c = $(strtox-CFLAGS)
> ?CFLAGS-wcstod_l.c = $(strtox-CFLAGS)
> ?CFLAGS-wcstold_l.c = $(strtox-CFLAGS)
> ?CFLAGS-wcstof_l.c = $(strtox-CFLAGS)
> -CFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
> +CPPFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
>
> ?CFLAGS-isoc99_wscanf.c += $(exceptions)
> ?CFLAGS-isoc99_fwscanf.c += $(exceptions)
> --
> 1.7.9.7
>