Apply LOCAL_LDLIBS to target build rules too.
Use LOCAL_LDLIBS to link against prebuilt libraries (such as NDK
libraries).
Previously LOCAL_LDLIBS only applies to host modules and the behaviour
confuses users.
Change-Id: I515546d7b59ef54e8ef09050eb58ec63534c9291
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index f698ef5..81d0813 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -239,7 +239,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \
+ $(PRIVATE_LDLIBS)
endef
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
@@ -264,7 +265,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef
define $(combo_2nd_arch_prefix)transform-o-to-static-executable-inner
diff --git a/core/combo/TARGET_linux-arm64.mk b/core/combo/TARGET_linux-arm64.mk
index 6bb3754..5e50f9f 100644
--- a/core/combo/TARGET_linux-arm64.mk
+++ b/core/combo/TARGET_linux-arm64.mk
@@ -180,7 +180,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-executable-inner
@@ -204,7 +205,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-static-executable-inner
diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk
index ba03b5d..1250767 100644
--- a/core/combo/TARGET_linux-mips.mk
+++ b/core/combo/TARGET_linux-mips.mk
@@ -230,7 +230,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \
+ $(PRIVATE_LDLIBS)
endef
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
@@ -255,7 +256,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef
define $(combo_2nd_arch_prefix)transform-o-to-static-executable-inner
diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk
index 969ba10..2130d03 100644
--- a/core/combo/TARGET_linux-mips64.mk
+++ b/core/combo/TARGET_linux-mips64.mk
@@ -239,7 +239,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-executable-inner
@@ -264,7 +265,8 @@
$(PRIVATE_TARGET_GLOBAL_LDFLAGS) \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-static-executable-inner
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 01f8242..4f66765 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -194,7 +194,8 @@
-o $@ \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) \
+ $(PRIVATE_LDLIBS)
endef
define $(combo_2nd_arch_prefix)transform-o-to-executable-inner
@@ -219,7 +220,8 @@
-o $@ \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef
define $(combo_2nd_arch_prefix)transform-o-to-static-executable-inner
diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk
index a5a745b..42953ae 100644
--- a/core/combo/TARGET_linux-x86_64.mk
+++ b/core/combo/TARGET_linux-x86_64.mk
@@ -224,7 +224,8 @@
-o $@ \
$(PRIVATE_LDFLAGS) \
$(PRIVATE_TARGET_LIBGCC) \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef
define transform-o-to-static-executable-inner
@@ -244,5 +245,6 @@
$(PRIVATE_TARGET_FDO_LIB) \
$(PRIVATE_TARGET_LIBGCC) \
-Wl,--end-group \
- $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O))
+ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) \
+ $(PRIVATE_LDLIBS)
endef