Commit fdf67770 authored by jochen's avatar jochen Committed by Commit bot

Remove the magic that sets CXX in the toplevel Makefile

The logic was supposed to trigger a rebuild if the CXX variable is
changed. However, it failed to track the other compiler related
variables, and, what is worse, conflicted with the clang=1 gyp setting
by forcing CXX to g++

The new logic just relies on tracking GYP defines, and checks whether
the CXX binary - if set - has a target different from the host
architecture.

BUG=none
R=jkummerow@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/807143003

Cr-Commit-Position: refs/heads/master@{#25973}
parent 71555240
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
# Variable default definitions. Override them by exporting them in your shell. # Variable default definitions. Override them by exporting them in your shell.
CXX ?= g++
LINK ?= g++
OUTDIR ?= out OUTDIR ?= out
TESTJOBS ?= TESTJOBS ?=
GYPFLAGS ?= GYPFLAGS ?=
...@@ -144,14 +142,9 @@ endif ...@@ -144,14 +142,9 @@ endif
ifeq ($(deprecationwarnings), on) ifeq ($(deprecationwarnings), on)
GYPFLAGS += -Dv8_deprecation_warnings=1 GYPFLAGS += -Dv8_deprecation_warnings=1
endif endif
# asan=/path/to/clang++ # asan=on
ifneq ($(strip $(asan)),) ifeq ($(asan), on)
GYPFLAGS += -Dasan=1 GYPFLAGS += -Dasan=1 -Dclang=1
export CC=$(dir $(asan))clang
export CXX=$(asan)
export CXX_host=$(asan)
export LINK=$(asan)
export ASAN_SYMBOLIZER_PATH=$(dir $(asan))llvm-symbolizer
TESTFLAGS += --asan TESTFLAGS += --asan
ifeq ($(lsan), on) ifeq ($(lsan), on)
GYPFLAGS += -Dlsan=1 GYPFLAGS += -Dlsan=1
...@@ -291,7 +284,6 @@ $(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES)) ...@@ -291,7 +284,6 @@ $(ARCHES): $(addprefix $$@.,$(DEFAULT_MODES))
# Defines how to build a particular target (e.g. ia32.release). # Defines how to build a particular target (e.g. ia32.release).
$(BUILDS): $(OUTDIR)/Makefile.$$@ $(BUILDS): $(OUTDIR)/Makefile.$$@
@$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \
CXX="$(CXX)" LINK="$(LINK)" \
BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \
python -c "print \ python -c "print \
raw_input().replace('opt', '').capitalize()") \ raw_input().replace('opt', '').capitalize()") \
...@@ -299,7 +291,7 @@ $(BUILDS): $(OUTDIR)/Makefile.$$@ ...@@ -299,7 +291,7 @@ $(BUILDS): $(OUTDIR)/Makefile.$$@
native: $(OUTDIR)/Makefile.native native: $(OUTDIR)/Makefile.native
@$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \
CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ BUILDTYPE=Release \
builddir="$(shell pwd)/$(OUTDIR)/$@" builddir="$(shell pwd)/$(OUTDIR)/$@"
$(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES))
...@@ -468,8 +460,10 @@ $(ENVFILE): $(ENVFILE).new ...@@ -468,8 +460,10 @@ $(ENVFILE): $(ENVFILE).new
# Stores current GYPFLAGS in a file. # Stores current GYPFLAGS in a file.
$(ENVFILE).new: $(ENVFILE).new:
@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ $(eval CXX_TARGET_ARCH:=$(shell $(CXX) -v 2>&1 | grep ^Target: | \
echo "CXX=$(CXX)" >> $(ENVFILE).new cut -f 2 -d " " | cut -f 1 -d "-" ))
$(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH)))
@mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS) -Dtarget_arch=$(CXX_TARGET_ARCH)" > $(ENVFILE).new;
# Heap constants for grokdump. # Heap constants for grokdump.
DUMP_FILE = tools/v8heapconst.py DUMP_FILE = tools/v8heapconst.py
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment