[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <gitxlvuumx.fsf@karga.hank.lab>
Date: Wed, 22 May 2013 13:22:14 +0200
From: Dirk Gouders <dirk@...ders.net>
To: Borislav Petkov <bp@...e.de>
Cc: Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: tools/lib/lk: redefinition of _FORTIFY_SOURCE (gcc-4.7.2)
Dirk Gouders <dirk@...ders.net> writes:
> What probably might help in any case is undefining _FORTIFY_SOURCE before
> defining it, because as far as I know, there is no problem with
> undefining something that is not yet defined, but I could imagine,
> others might have more elegant suggestions:
>
> CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -U_FORTIFY_SOURCE
> -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
More elegant would probably be to look at tools/perf/Makefile and handle
the problem as is done there:
CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -fPIC
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
CFLAGS := $(CFLAGS) -D_FORTIFY_SOURCE=2
endif
I tested it here and it works well.
Dirk
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists