diff options
author | David Carrillo-Cisneros <davidcc@google.com> | 2017-04-12 02:49:14 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-04-13 10:48:48 -0400 |
commit | 9961aa665b70e47d6c80141c4a2482266010f246 (patch) | |
tree | 3f787299f1078718185d0a973dda731f3c490555 | |
parent | e5e992a7c184c2121adf37bdf292a516af81dbbb (diff) |
tools build: Fix feature detection redefinion of build flags
This change is a follow up of https://lkml.org/lkml/2017/2/2/16
The patch above avoided redefining CC, CXX and PKG_CONFIG in feature
detection. The patch was not merged due to a unsolved concern with the
-MD flag.
Later, commit c8c188679ccf ("tools build: Use the same CC for feature
detection and actual build") did the change for CC and CXX but not
PKG_CONFIG.
This patch makes PKG_CONFIG consistent with CC and CXX and moves the -MD
to CFLAGS, as suggested by Jiri in the thread above.
Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Simon Que <sque@chromium.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20170412064919.92449-3-davidcc@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/build/feature/Makefile | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 523e587fe05f..e35e4e5ad192 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile | |||
@@ -53,17 +53,17 @@ FILES= \ | |||
53 | 53 | ||
54 | FILES := $(addprefix $(OUTPUT),$(FILES)) | 54 | FILES := $(addprefix $(OUTPUT),$(FILES)) |
55 | 55 | ||
56 | CC ?= $(CROSS_COMPILE)gcc -MD | 56 | CC ?= $(CROSS_COMPILE)gcc |
57 | CXX ?= $(CROSS_COMPILE)g++ -MD | 57 | CXX ?= $(CROSS_COMPILE)g++ |
58 | PKG_CONFIG := $(CROSS_COMPILE)pkg-config | 58 | PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config |
59 | LLVM_CONFIG ?= llvm-config | 59 | LLVM_CONFIG ?= llvm-config |
60 | 60 | ||
61 | all: $(FILES) | 61 | all: $(FILES) |
62 | 62 | ||
63 | __BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS) | 63 | __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS) |
64 | BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1 | 64 | BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1 |
65 | 65 | ||
66 | __BUILDXX = $(CXX) $(CXXFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS) | 66 | __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS) |
67 | BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1 | 67 | BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1 |
68 | 68 | ||
69 | ############################### | 69 | ############################### |