From db7dcc210a9425b6d96fce33adf468ebf329259c Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Wed, 12 Feb 2014 14:24:41 +0000 Subject: [PATCH] Allow LOCAL_LDFLAGS to override HOST_GLOBAL_LDFLAGS. For host executables and shared libraries, the global LDFLAGS were being inserted into the linker command line after the module-specific ones, making it impossible to override the default settings. Change the order to match target linker invocations. Change-Id: Icd5f6f83df9f27a5be97ddb197ee245c1ab8c2be --- core/definitions.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 6c65bc5542..d2dc3a6167 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1240,11 +1240,11 @@ $(hide) $(PRIVATE_CXX) \ -Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../lib \ -shared -Wl,-soname,$(notdir $@) \ - $(PRIVATE_LDFLAGS) \ $(HOST_GLOBAL_LD_DIRS) \ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \ ) \ + $(PRIVATE_LDFLAGS) \ $(PRIVATE_ALL_OBJECTS) \ -Wl,--whole-archive \ $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ @@ -1395,11 +1395,11 @@ $(hide) $(PRIVATE_CXX) \ -Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../lib \ $(HOST_GLOBAL_LD_DIRS) \ - $(PRIVATE_LDFLAGS) \ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \ -fPIE -pie \ ) \ + $(PRIVATE_LDFLAGS) \ -o $@ \ $(PRIVATE_LDLIBS) endef