Skip to content

Commit

Permalink
tests: move -D_FORTIFY_SOURCE to CPPFLAGS
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Mike Frysinger <[email protected]>
  • Loading branch information
vapier committed May 31, 2012
1 parent 3091725 commit fed806c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2012-05-31 Mike Frysinger <[email protected]>

* 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.

2012-05-31 Marek Polacek <[email protected]>

[BZ #14132]
Expand Down
12 changes: 8 additions & 4 deletions debug/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ 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

# Need to make sure the settings here override what configure might have
# set up for us, so keep the CFLAGS/CPPFLAGS split logical as the order is:
# <user CFLAGS> <test CFLAGS> <user CPPFLAGS> <test CPPFLAGS>
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.
Expand Down
2 changes: 1 addition & 1 deletion wcsmbs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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)
Expand Down

0 comments on commit fed806c

Please sign in to comment.