[PATCH] tests: move -D_FORTIFY_SOURCE to CPPFLAGS
Carlos O'Donell
carlos@systemhalted.org
Mon May 7 14:00:00 GMT 2012
On Mon, May 7, 2012 at 12:55 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Sunday 06 May 2012 19:53:53 Carlos O'Donell wrote:
>> On Sun, May 6, 2012 at 6:51 PM, Mike Frysinger 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++?
>
> no. the current compile order is:
> $(CC) $(CFLAGS) $(CPPFLAGS) ...
>
> and CFLAGS expands into:
> $(CFLAGS-config) ... $($(subdir)-CFLAGS) ... $(CFLAGS-$(<F)) ...
>
> and CPPFLAGS expands into:
> $(CPPFLAGS-config) ... $($(subdir)-CPPFLAGS) ... $(CPPFLAGS-$(<F)) ...
>
> so the user's settings are in CPPFLAGS-config, but the test-specific overrides
> are in CFLAGS-xxx, so the -D flags we want to use don't override the user's
> settings.
Shucks, that sucks. The intent is clear though the users flags should
be overridden by the test flags.
I'm OK with this patch provided you include a comment in
debug/Makefile stating why you can't just use CFLAGS.
Doesn't this effect *every* test that adds their own test-specific flags?
It seems like the compile order should expand into:
$(CC) $(CFLAGS) $(CPPFLAGS) $(TESTFLAGS)
I'd like to see incremental progress, but fixing the testsuite first
is the right way forward.
Please check this in on Wednesday if nobody else objects.
Cheers,
Carlos.
More information about the Libc-alpha
mailing list