From 04cf31597021af3cd045dd9c50d94a87d0394023 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 5 Aug 2014 14:44:41 -0700 Subject: [PATCH] Inhibit implicit -Bsymolic in -shared. Bug: 16853291 Change-Id: Id70488b077256a70137c4417f21be2c2d1d4341c (cherry picked from commit b6bb71b85d506dcc4763290d72c4168afd541f7d) --- core/binary.mk | 1 + core/combo/TARGET_linux-arm.mk | 2 +- core/combo/TARGET_linux-arm64.mk | 2 +- core/combo/TARGET_linux-mips.mk | 2 +- core/combo/TARGET_linux-mips64.mk | 2 +- core/combo/TARGET_linux-x86.mk | 2 +- core/combo/TARGET_linux-x86_64.mk | 2 +- core/definitions.mk | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index 6cfd0ace9..cee91e76f 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -322,6 +322,7 @@ ifneq ($(LOCAL_NO_SYNTAX_CHECK),true) endif endif $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CXX := $(my_cxx) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CLANG := $(my_clang) # TODO: support a mix of standard extensions so that this isn't necessary LOCAL_CPP_EXTENSION := $(strip $(LOCAL_CPP_EXTENSION)) diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index 88f11fdca..df81cd52a 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -196,7 +196,7 @@ define $(combo_2nd_arch_prefix)transform-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ -nostdlib -Wl,-soname,$(notdir $@) \ -Wl,--gc-sections \ - -shared \ + $(if $(filter true,$(PRIVATE_CLANG)),-shared,-Wl,-shared) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk index 520eb0941..07d398449 100644 --- a/core/combo/TARGET_linux-arm64.mk +++ b/core/combo/TARGET_linux-arm64.mk @@ -162,7 +162,7 @@ define transform-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ -nostdlib -Wl,-soname,$(notdir $@) \ -Wl,--gc-sections \ - -shared \ + $(if $(filter true,$(PRIVATE_CLANG)),-shared,-Wl,-shared) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk index ccd7c1a2d..995e63c23 100644 --- a/core/combo/TARGET_linux-mips.mk +++ b/core/combo/TARGET_linux-mips.mk @@ -168,7 +168,7 @@ define $(combo_2nd_arch_prefix)transform-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ -nostdlib -Wl,-soname,$(notdir $@) \ -Wl,--gc-sections \ - -shared \ + $(if $(filter true,$(PRIVATE_CLANG)),-shared,-Wl,-shared) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk index b66389bbe..938b11c8d 100644 --- a/core/combo/TARGET_linux-mips64.mk +++ b/core/combo/TARGET_linux-mips64.mk @@ -172,7 +172,7 @@ define transform-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ -nostdlib -Wl,-soname,$(notdir $@) \ -Wl,--gc-sections \ - -shared \ + $(if $(filter true,$(PRIVATE_CLANG)),-shared,-Wl,-shared) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index b534e3294..0bb218ff6 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -152,7 +152,7 @@ define $(combo_2nd_arch_prefix)transform-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ -nostdlib -Wl,-soname,$(notdir $@) \ - -shared \ + $(if $(filter true,$(PRIVATE_CLANG)),-shared,-Wl,-shared) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk index b1c6fbfe0..14fa5ed78 100644 --- a/core/combo/TARGET_linux-x86_64.mk +++ b/core/combo/TARGET_linux-x86_64.mk @@ -156,7 +156,7 @@ define transform-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ -nostdlib -Wl,-soname,$(notdir $@) \ - -shared \ + $(if $(filter true,$(PRIVATE_CLANG)),-shared,-Wl,-shared) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ diff --git a/core/definitions.mk b/core/definitions.mk index c798f022b..a6c473e1a 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1309,7 +1309,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ -Wl,-rpath-link=$(PRIVATE_TARGET_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../lib \ - -shared -Wl,-soname,$(notdir $@) \ + -Wl,-shared -Wl,-soname,$(notdir $@) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(PRIVATE_ALL_OBJECTS) \