package/Makefile.in: rpath setup for toolchains.
authorDaniel Laird <danieljlaird@hotmail.com>
Thu, 6 Nov 2008 12:54:29 +0000 (12:54 -0000)
committerDaniel Laird <danieljlaird@hotmail.com>
Thu, 6 Nov 2008 12:54:29 +0000 (12:54 -0000)
Apply the patch I posted some time ago that fixes
rpath issues with external toolchains.
Has been tested by users of buildroot and feedback looks good.

Signed-off-by: Thomas Petazzoni
Signed-off-by: Daniel Laird <daniel.j.laird@nxp.com>
package/Makefile.in

index 431ca8e785155cd1b8bacb9dcc17a579daaf9ca0..9de8bf44c8ae2b404e9a319c64ba609b394acf71 100644 (file)
@@ -39,7 +39,7 @@ endif
 ifeq ($(BR2_TOOLCHAIN_SOURCE),y)
 TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) \
        -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
-TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
+TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -Wl,--rpath-link -Wl,$(STAGING_DIR)/lib -Wl,--rpath-link -Wl,$(STAGING_DIR)/usr/lib
 ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
 TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT)
 TARGET_LDFLAGS+= $(BR2_SYSROOT)
@@ -91,7 +91,7 @@ TARGET_CXXFLAGS=$(TARGET_CFLAGS)
 else
 TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_EXTERNAL_PATH)/$(TOOLCHAIN_EXTERNAL_PREFIX)/include
 TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-TARGET_LDFLAGS=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
+TARGET_LDFLAGS+=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib -Wl,--rpath-link -Wl,$(STAGING_DIR)/lib -Wl,--rpath-link -Wl,$(STAGING_DIR)/usr/lib
 endif
 #########################################################################
 #ifeq ($(BR2_ROOTFS_SUFFIX),)
@@ -196,7 +196,8 @@ GNU_HOST_NAME:=$(HOST_ARCH)-$(subst ",,$(BR2_GNU_BUILD_SUFFIX))
 TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
                AR="$(TARGET_AR)" \
                AS="$(TARGET_AS)" \
-               LD="$(TARGET_LD) $(TARGET_LDFLAGS)" \
+               LD="$(TARGET_LD)" \
+               LDFLAGS="$(TARGET_LDFLAGS)" \
                NM="$(TARGET_NM)" \
                CC="$(TARGET_CC) $(TARGET_CFLAGS)" \
                GCC="$(TARGET_CC) $(TARGET_CFLAGS)" \