summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc <sbc@chromium.org>2015-06-02 12:52:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-02 19:54:24 +0000
commit1460c4b34f2dbfc37f5934380f362e2193f64360 (patch)
treef3f60c92480cd33b50a29d72971fb019dfac9320 /native_client_sdk
parent7840286891fbebe83603cc1c73e210c886ea1a76 (diff)
downloadchromium_src-1460c4b34f2dbfc37f5934380f362e2193f64360.zip
chromium_src-1460c4b34f2dbfc37f5934380f362e2193f64360.tar.gz
chromium_src-1460c4b34f2dbfc37f5934380f362e2193f64360.tar.bz2
[NaCl SDK] Use seperate build dir for msan/tsan builds
This ensures that everything gets rebuilt with correct cflags/ldflags. Add Release as well as msan_Release to the link line since not all libraries get rebuild in this mode (some core libraries such as libppapi still only exist in the Release director). Review URL: https://codereview.chromium.org/1163843006 Cr-Commit-Position: refs/heads/master@{#332453}
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-xnative_client_sdk/src/build_tools/test_sdk.py6
-rw-r--r--native_client_sdk/src/tools/common.mk13
-rw-r--r--native_client_sdk/src/tools/host_gcc.mk10
-rw-r--r--native_client_sdk/src/tools/nacl_gcc.mk48
4 files changed, 39 insertions, 38 deletions
diff --git a/native_client_sdk/src/build_tools/test_sdk.py b/native_client_sdk/src/build_tools/test_sdk.py
index 2fa9fd6..b442b3c 100755
--- a/native_client_sdk/src/build_tools/test_sdk.py
+++ b/native_client_sdk/src/build_tools/test_sdk.py
@@ -87,12 +87,6 @@ def StepRunSelLdrTests(pepperdir, sanitizer):
args += ['ASAN=1']
elif sanitizer == 'thread':
args += ['TSAN=1']
- build_projects.BuildProjectsBranch(pepperdir, 'src', clean=False,
- deps=deps, config=config,
- args=args + ['clean'])
- build_projects.BuildProjectsBranch(pepperdir, 'tests', clean=False,
- deps=deps, config=config,
- args=args + ['clean'])
build_projects.BuildProjectsBranch(pepperdir, test, clean=False,
deps=deps, config=config,
diff --git a/native_client_sdk/src/tools/common.mk b/native_client_sdk/src/tools/common.mk
index 114a492..d23dc8f 100644
--- a/native_client_sdk/src/tools/common.mk
+++ b/native_client_sdk/src/tools/common.mk
@@ -243,11 +243,18 @@ STANDALONE = 1
endif
OUTBASE ?= .
+CONFIG_DIR := $(CONFIG)
ifdef STANDALONE
-OUTDIR := $(OUTBASE)/$(TOOLCHAIN)/standalone_$(CONFIG)
-else
-OUTDIR := $(OUTBASE)/$(TOOLCHAIN)/$(CONFIG)
+CONFIG_DIR := standalone_$(CONFIG_DIR)
+endif
+ifdef MSAN
+CONFIG_DIR := msan_$(CONFIG_DIR)
endif
+ifdef TSAN
+CONFIG_DIR := tsan_$(CONFIG_DIR)
+endif
+
+OUTDIR := $(OUTBASE)/$(TOOLCHAIN)/$(CONFIG_DIR)
STAMPDIR ?= $(OUTDIR)
LIBDIR ?= $(NACL_SDK_ROOT)/lib
diff --git a/native_client_sdk/src/tools/host_gcc.mk b/native_client_sdk/src/tools/host_gcc.mk
index 49fb6d3..c9ab5e5 100644
--- a/native_client_sdk/src/tools/host_gcc.mk
+++ b/native_client_sdk/src/tools/host_gcc.mk
@@ -123,11 +123,11 @@ endef
# $2 = List of source files
#
define LIB_RULE
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).a
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(OSNAME)_host/$(CONFIG_DIR)/lib$(1).a
@echo "TOUCHED $$@" > $(STAMPDIR)/$(1).stamp
-all: $(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).a
-$(LIBDIR)/$(OSNAME)_host/$(CONFIG)/lib$(1).a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src)))
+all: $(LIBDIR)/$(OSNAME)_host/$(CONFIG_DIR)/lib$(1).a
+$(LIBDIR)/$(OSNAME)_host/$(CONFIG_DIR)/lib$(1).a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src)))
$(MKDIR) -p $$(dir $$@)
$(RM) -f $$@
$(call LOG,LIB,$$@,$(AR) $(ARFLAGS) $$@ $$^)
@@ -148,13 +148,13 @@ ifdef STANDALONE
define LINKER_RULE
all: $(1)
$(1): $(2) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
- $(call LOG,LINK,$$@,$(LINK) -o $(1) $(2) $(HOST_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(OSNAME)_host)/$(CONFIG) $(foreach lib,$(3),-l$(lib)) $(6))
+ $(call LOG,LINK,$$@,$(LINK) -o $(1) $(2) $(HOST_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(OSNAME)_host/$(CONFIG_DIR) -L$(path)/$(OSNAME)_host/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(6))
endef
else
define LINKER_RULE
all: $(1)
$(1): $(2) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
- $(call LOG,LINK,$$@,$(LINK) -shared -o $(1) $(2) $(HOST_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(OSNAME)_host)/$(CONFIG) $(foreach lib,$(3),-l$(lib)) $(6))
+ $(call LOG,LINK,$$@,$(LINK) -shared -o $(1) $(2) $(HOST_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(OSNAME)_host/$(CONFIG_DIR) -L$(path)/$(OSNAME)_host/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(6))
endef
endif
diff --git a/native_client_sdk/src/tools/nacl_gcc.mk b/native_client_sdk/src/tools/nacl_gcc.mk
index 89ecc56..7cd3d0e 100644
--- a/native_client_sdk/src/tools/nacl_gcc.mk
+++ b/native_client_sdk/src/tools/nacl_gcc.mk
@@ -218,12 +218,12 @@ ifneq (,$(findstring x86_32,$(ARCHES)))
all: $(X86_32_OUTDIR)/lib$(1)_x86_32.so
$(X86_32_OUTDIR)/lib$(1)_x86_32.so: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32_pic)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(MKDIR) -p $$(dir $$@)
- $(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -m32 $(NACL_LDFLAGS) $(X86_32_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_x86_32/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
+ $(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -m32 $(NACL_LDFLAGS) $(X86_32_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR) -L$(path)/$(TOOLCHAIN)_x86_32/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
$(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).so
-install: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).so
-$(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).so: $(X86_32_OUTDIR)/lib$(1)_x86_32.so
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR)/lib$(1).so
+install: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR)/lib$(1).so
+$(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR)/lib$(1).so: $(X86_32_OUTDIR)/lib$(1)_x86_32.so
$(MKDIR) -p $$(dir $$@)
$(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
ifneq ($(6),1)
@@ -236,12 +236,12 @@ ifneq (,$(findstring x86_64,$(ARCHES)))
all: $(X86_64_OUTDIR)/lib$(1)_x86_64.so
$(X86_64_OUTDIR)/lib$(1)_x86_64.so: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64_pic)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(MKDIR) -p $$(dir $$@)
- $(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -m64 $(NACL_LDFLAGS) $(X86_64_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_x86_64/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
+ $(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -m64 $(NACL_LDFLAGS) $(X86_64_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR) -L$(path)/$(TOOLCHAIN)_x86_64/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
$(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).so
-install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).so
-$(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).so: $(X86_64_OUTDIR)/lib$(1)_x86_64.so
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).so
+install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).so
+$(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).so: $(X86_64_OUTDIR)/lib$(1)_x86_64.so
$(MKDIR) -p $$(dir $$@)
$(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
ifneq ($(6),1)
@@ -254,12 +254,12 @@ ifneq (,$(findstring arm,$(ARCHES)))
all: $(ARM_OUTDIR)/lib$(1)_arm.so
$(ARM_OUTDIR)/lib$(1)_arm.so: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm_pic)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(MKDIR) -p $$(dir $$@)
- $(call LOG,LINK,$$@,$(ARM_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -marm $(NACL_LDFLAGS) $(ARM_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_arm/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
+ $(call LOG,LINK,$$@,$(ARM_LINK) -o $$@ $$(filter %.o,$$^) $(LDFLAGS_SHARED) -marm $(NACL_LDFLAGS) $(ARM_LDFLAGS) $(LDFLAGS) $(foreach path,$(5),-L$(path)/$(TOOLCHAIN)_arm/$(CONFIG_DIR) -L$(path)/$(TOOLCHAIN)_arm/$(CONFIG)) $(foreach lib,$(3),-l$(lib)))
$(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).so
-install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).so
-$(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).so: $(ARM_OUTDIR)/lib$(1)_arm.so
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).so
+install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).so
+$(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).so: $(ARM_OUTDIR)/lib$(1)_arm.so
$(MKDIR) -p $$(dir $$@)
$(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
ifneq ($(6),1)
@@ -300,9 +300,9 @@ $(X86_32_OUTDIR)/lib$(1)_x86_32.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_
$(RM) -f $$@
$(call LOG,LIB ,$$@,$(X86_32_LIB) -cr $$@ $$^)
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).a
-install: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).a
-$(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG)/lib$(1).a: $(X86_32_OUTDIR)/lib$(1)_x86_32.a
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR)/lib$(1).a
+install: $(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR)/lib$(1).a
+$(LIBDIR)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR)/lib$(1).a: $(X86_32_OUTDIR)/lib$(1)_x86_32.a
$(MKDIR) -p $$(dir $$@)
$(RM) -f $$@
$(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
@@ -315,9 +315,9 @@ $(X86_64_OUTDIR)/lib$(1)_x86_64.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_
$(RM) -f $$@
$(call LOG,LIB ,$$@,$(X86_64_LIB) -cr $$@ $$^)
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).a
-install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).a
-$(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG)/lib$(1).a: $(X86_64_OUTDIR)/lib$(1)_x86_64.a
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a
+install: $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a
+$(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a: $(X86_64_OUTDIR)/lib$(1)_x86_64.a
$(MKDIR) -p $$(dir $$@)
$(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
endif
@@ -330,9 +330,9 @@ $(ARM_OUTDIR)/lib$(1)_arm.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm))
$(RM) -f $$@
$(call LOG,LIB ,$$@,$(ARM_LIB) -cr $$@ $$^)
-$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).a
-install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).a
-$(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG)/lib$(1).a: $(ARM_OUTDIR)/lib$(1)_arm.a
+$(STAMPDIR)/$(1).stamp: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a
+install: $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a
+$(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a: $(ARM_OUTDIR)/lib$(1)_arm.a
$(MKDIR) -p $$(dir $$@)
$(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@)
endif
@@ -355,7 +355,7 @@ ifneq (,$(findstring x86_32,$(ARCHES)))
all: $(X86_32_OUTDIR)/$(1)_x86_32.nexe
$(X86_32_OUTDIR)/$(1)_x86_32.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_32)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(MKDIR) -p $$(dir $$@)
- $(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(X86_32_LDFLAGS) $(LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_x86_32/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
+ $(call LOG,LINK,$$@,$(X86_32_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(X86_32_LDFLAGS) $(LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_x86_32/$(CONFIG_DIR) -L$(path)/$(TOOLCHAIN)_x86_32/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
$(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
endif
@@ -363,7 +363,7 @@ ifneq (,$(findstring x86_64,$(ARCHES)))
all: $(X86_64_OUTDIR)/$(1)_x86_64.nexe
$(X86_64_OUTDIR)/$(1)_x86_64.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_x86_64)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(MKDIR) -p $$(dir $$@)
- $(call LOG,LINK,$$@,$(X86_64_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(X86_64_LDFLAGS) $(LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_x86_64/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
+ $(call LOG,LINK,$$@,$(X86_64_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(X86_64_LDFLAGS) $(LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR) -L$(path)/$(TOOLCHAIN)_x86_64/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
$(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
endif
@@ -371,7 +371,7 @@ ifneq (,$(findstring arm,$(ARCHES)))
all: $(ARM_OUTDIR)/$(1)_arm.nexe
$(ARM_OUTDIR)/$(1)_arm.nexe: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm)) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
$(MKDIR) -p $$(dir $$@)
- $(call LOG,LINK,$$@,$(ARM_LINK) $(BIONIC_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(ARM_LDFLAGS) $(LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_arm/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
+ $(call LOG,LINK,$$@,$(ARM_LINK) $(BIONIC_LINK) -o $$@ $$(filter %.o,$$^) $(NACL_LDFLAGS) $(ARM_LDFLAGS) $(LDFLAGS) $(foreach path,$(6),-L$(path)/$(TOOLCHAIN)_arm/$(CONFIG_DIR) -L$(path)/$(TOOLCHAIN)_arm/$(CONFIG)) $(foreach lib,$(3),-l$(lib)) $(5))
$(call LOG,VALIDATE,$$@,$(NCVAL) $$@)
endif
endef