From 30127bfdadee04d470e618ff55db89db281fb921 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Mon, 1 Jun 2015 10:43:29 -0700 Subject: [PATCH] Add $ORIGIN/lib[64] to host binary's rpath. Normally the binaries use the exsiting $ORIGIN/../lib[64] with binaries in the bin subdirectory; For historical reason the binaries in the SDK package don't have a bin subdirectory. This workaround enables them to work in the existing SDK directory structure. Bug: 21301578 Change-Id: Ibebfbfb8b30e81e7bbaf13a21bb205f3f0282d24 (cherry-pick from commit 4fe7bfd373d99dedfd2e63135da5189478bb0138) --- core/combo/HOST_darwin-x86.mk | 2 ++ core/definitions.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk index 8389bb83f8..e77fd218f7 100644 --- a/core/combo/HOST_darwin-x86.mk +++ b/core/combo/HOST_darwin-x86.mk @@ -78,12 +78,14 @@ $(hide) $(PRIVATE_CXX) \ -o $@ \ -install_name @rpath/$(notdir $@) \ -Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ + -Wl,-rpath,@loader_path/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ $(PRIVATE_LDFLAGS) endef define transform-host-o-to-executable-inner $(hide) $(PRIVATE_CXX) \ -Wl,-rpath,@loader_path/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ + -Wl,-rpath,@loader_path/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ -o $@ \ -Wl,-headerpad_max_install_names \ $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \ diff --git a/core/definitions.mk b/core/definitions.mk index 6bb3a99ed3..87c94c0c54 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1395,6 +1395,7 @@ define transform-host-o-to-shared-lib-inner $(hide) $(PRIVATE_CXX) \ -Wl,-rpath-link=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ + -Wl,-rpath,\$$ORIGIN/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ -shared -Wl,-soname,$(notdir $@) \ $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ @@ -1611,6 +1612,7 @@ $(hide) $(PRIVATE_CXX) \ $(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ -Wl,-rpath-link=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ + -Wl,-rpath,\$$ORIGIN/$(notdir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_OUT_SHARED_LIBRARIES)) \ $($(PRIVATE_2ND_ARCH_VAR_PREFIX)HOST_GLOBAL_LD_DIRS) \ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(PRIVATE_HOST_GLOBAL_LDFLAGS) \