summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--make/uclibc_toolchain.mk12
-rw-r--r--make/uclibc_toolchain_2_95.mk12
2 files changed, 20 insertions, 4 deletions
diff --git a/make/uclibc_toolchain.mk b/make/uclibc_toolchain.mk
index 663c21eb7..bd60dfd1d 100644
--- a/make/uclibc_toolchain.mk
+++ b/make/uclibc_toolchain.mk
@@ -129,7 +129,14 @@ $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
#
(cd $(BINUTILS_DIR); perl -i -p -e "s,#.*define.*ELF_DYNAMIC_INTERPRETER.*\".*\"\
,#define ELF_DYNAMIC_INTERPRETER \"/lib/ld-uClibc.so.0\",;" \
- `grep -lr "#.*define.*ELF_DYNAMIC_INTERPRETER.*\".*\"" $(BINUTILS_DIR)`);
+ `grep -lr "ELF_DYNAMIC_INTERPRETER" $(BINUTILS_DIR)`);
+ #
+ # Hack binutils to prevent it from searching the host system
+ # for libraries. We only want libraries for the target system.
+ #
+ (cd $(BINUTILS_DIR); perl -i -p -e "s,^NATIVE_LIB_DIRS.*,\
+ NATIVE_LIB_DIRS='$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib',;" \
+ $(BINUTILS_DIR)/ld/configure.host);
touch $(BINUTILS_DIR)/.patched
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
@@ -239,7 +246,7 @@ $(GCC_DIR)/.gcc_build_hacks: $(GCC_DIR)/.patched
# when it calls locatelib() and rummages about the system looking
# for libraries with the correct name...
#
- perl -i -p -e "s,\"/lib/,\"$(STAGING_DIR)/lib,g;" $(GCC_DIR)/gcc/collect2.c
+ perl -i -p -e "s,\"/lib,\"$(STAGING_DIR)/lib,g;" $(GCC_DIR)/gcc/collect2.c
perl -i -p -e "s,\"/usr/,\"$(STAGING_DIR)/usr/,g;" $(GCC_DIR)/gcc/collect2.c
#
# Prevent gcc from using the unwind-dw2-fde-glibc code
@@ -458,6 +465,7 @@ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++: $(GCC_BUILD_DIR2)/.compiled
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-g++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++filt $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++filt
rm -f $(STAGING_DIR)/bin/cpp $(STAGING_DIR)/bin/gcov $(STAGING_DIR)/bin/*gccbug
+ rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$(ARCH)-uclibc-*
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
# Strip the host binaries
diff --git a/make/uclibc_toolchain_2_95.mk b/make/uclibc_toolchain_2_95.mk
index 488efbf7e..d36116b1d 100644
--- a/make/uclibc_toolchain_2_95.mk
+++ b/make/uclibc_toolchain_2_95.mk
@@ -137,7 +137,14 @@ $(BINUTILS_DIR)/.patched: $(BINUTILS_DIR)/.unpacked
#
(cd $(BINUTILS_DIR); perl -i -p -e "s,#.*define.*ELF_DYNAMIC_INTERPRETER.*\".*\"\
,#define ELF_DYNAMIC_INTERPRETER \"/lib/ld-uClibc.so.0\",;" \
- `grep -lr "#.*define.*ELF_DYNAMIC_INTERPRETER.*\".*\"" $(BINUTILS_DIR)`);
+ `grep -lr "ELF_DYNAMIC_INTERPRETER" $(BINUTILS_DIR)`);
+ #
+ # Hack binutils to prevent it from searching the host system
+ # for libraries. We only want libraries for the target system.
+ #
+ (cd $(BINUTILS_DIR); perl -i -p -e "s,^NATIVE_LIB_DIRS.*,\
+ NATIVE_LIB_DIRS='$(STAGING_DIR)/usr/lib $(STAGING_DIR)/lib',;" \
+ $(BINUTILS_DIR)/ld/configure.host);
touch $(BINUTILS_DIR)/.patched
$(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched
@@ -247,7 +254,7 @@ $(GCC_DIR)/.gcc_build_hacks: $(GCC_DIR)/.patched
# when it calls locatelib() and rummages about the system looking
# for libraries with the correct name...
#
- perl -i -p -e "s,\"/lib/,\"$(STAGING_DIR)/lib,g;" $(GCC_DIR)/gcc/collect2.c
+ perl -i -p -e "s,\"/lib,\"$(STAGING_DIR)/lib,g;" $(GCC_DIR)/gcc/collect2.c
perl -i -p -e "s,\"/usr/,\"$(STAGING_DIR)/usr/,g;" $(GCC_DIR)/gcc/collect2.c
#
# Prevent gcc from using the unwind-dw2-fde-glibc code
@@ -513,6 +520,7 @@ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++: $(GCC_BUILD_DIR2)/.compiled
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-g++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
-mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++filt $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++filt
rm -f $(STAGING_DIR)/bin/cpp $(STAGING_DIR)/bin/gcov $(STAGING_DIR)/bin/*gccbug
+ rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$(ARCH)-uclibc-*
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
# Strip the host binaries