Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755217AbbDTMnF (ORCPT ); Mon, 20 Apr 2015 08:43:05 -0400 Received: from services.gouders.net ([141.101.32.176]:34415 "EHLO services.gouders.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754789AbbDTMnD (ORCPT ); Mon, 20 Apr 2015 08:43:03 -0400 X-Greylist: delayed 466 seconds by postgrey-1.27 at vger.kernel.org; Mon, 20 Apr 2015 08:43:03 EDT From: Dirk Gouders To: Arnaldo Carvalho de Melo Cc: Peter Zijlstra , Paul Mackerras , Ingo Molnar , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] tools/lib/api/Makefile: Add feature check for _FORTIFY_SOURCE Date: Mon, 20 Apr 2015 14:01:19 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1205 Lines: 38 For example on Gentoo systems where _FORTIFY_SOURCE is set by default, `make -C tools/perf' fails, because of the macro being redefined. Fix that by a feature-check analogous to tools/perf/config/Makefile. Signed-off-by: Dirk Gouders --- tools/lib/api/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile index d8fe29f..acf9097 100644 --- a/tools/lib/api/Makefile +++ b/tools/lib/api/Makefile @@ -16,7 +16,14 @@ MAKEFLAGS += --no-print-directory LIBFILE = $(OUTPUT)libapi.a CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS) -CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -D_FORTIFY_SOURCE=2 -fPIC +CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fPIC + +ifeq ($(DEBUG),0) + ifeq ($(feature-fortify-source), 1) + CFLAGS += -D_FORTIFY_SOURCE=2 + endif +endif + CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 RM = rm -f -- 2.3.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/