Add support for custom Linux host toolchains when building the SDK.
This is needed in order to build Linux SDK binaries that can run
properly on Ubuntu 8.04 (Hardy). By default, the host toolchain
on 10.04 (Lucid) generates machine code that won't run on Hardy
due to GLibc ABI mistmatches.
Note that nothing happens if the new toolchain is not in the
prebuilt tree.
Change-Id: I914f5a303f16b6871759ce5a7178585ed3060870
diff --git a/core/definitions.mk b/core/definitions.mk
index c762711..ca8bc67 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -1001,7 +1001,7 @@
# it to be overriden en-masse see combo/linux-arm.make for an example.
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-shared-lib-inner
-$(HOST_CXX) \
+$(PRIVATE_CXX) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \
-shared -Wl,-soname,$(notdir $@) \
@@ -1051,7 +1051,7 @@
# it to be overriden en-masse see combo/linux-arm.make for an example.
ifneq ($(TARGET_CUSTOM_LD_COMMAND),true)
define transform-o-to-shared-lib-inner
-$(TARGET_CXX) \
+$(PRIVATE_CXX) \
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \
@@ -1110,7 +1110,7 @@
ifneq ($(TARGET_CUSTOM_LD_COMMAND),true)
define transform-o-to-executable-inner
-$(TARGET_CXX) \
+$(PRIVATE_CXX) \
$(TARGET_GLOBAL_LDFLAGS) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
$(TARGET_GLOBAL_LD_DIRS) \
@@ -1161,7 +1161,7 @@
ifneq ($(HOST_CUSTOM_LD_COMMAND),true)
define transform-host-o-to-executable-inner
-$(HOST_CXX) \
+$(PRIVATE_CXX) \
-Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \
-Wl,-rpath,\$$ORIGIN/../lib \
$(HOST_GLOBAL_LD_DIRS) \