summaryrefslogtreecommitdiff
path: root/package/Makefile.in
diff options
context:
space:
mode:
Diffstat (limited to 'package/Makefile.in')
-rw-r--r--package/Makefile.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/package/Makefile.in b/package/Makefile.in
index cd492f1fd..7ac429c81 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -77,6 +77,11 @@ ifeq ($(BR2_LARGEFILE),y)
TARGET_CFLAGS+=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
endif
+# Host packages are sometimes linked against host libraries installed
+# in $(HOST_DIR)/usr/lib. As we cannot add $(HOST_DIR)/usr/lib to
+# LD_LIBRARY_PATH when building target packages because it causes
+# libtool breakage, we force a rpath to be added to host binaries.
+HOST_CFLAGS+=-Wl,-rpath -Wl,$(HOST_DIR)/usr/lib
#########################################################################
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
@@ -93,6 +98,7 @@ else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TARGET_CFLAGS+=--sysroot $(STAGING_DIR)/
TARGET_CXXFLAGS=$(TARGET_CFLAGS)
TARGET_LDFLAGS=--sysroot $(STAGING_DIR)/
+TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
endif
#########################################################################