diff --git a/Makefile b/Makefile index ac349a79e8..7453bfd193 100644 --- a/Makefile +++ b/Makefile @@ -552,16 +552,15 @@ prepare: $(BUILD_DIR)/buildroot-config/auto.conf .PHONY: world world: target-post-image -# When creating HOST_DIR, also symlink usr/lib -> ../lib +# When creating HOST_DIR, also symlink usr -> . $(HOST_DIR): - @mkdir -p $@/usr $@/lib - @ln -snf ../lib $@/usr/lib + @mkdir -p $@ + @ln -snf . $@/usr # Populating the staging with the base directories is handled by the skeleton package $(STAGING_DIR): | $(HOST_DIR) @mkdir -p $(STAGING_DIR) @ln -snf $(STAGING_DIR) $(BASE_DIR)/staging - @ln -snf ../$(GNU_TARGET_NAME) $(HOST_DIR)/usr/$(GNU_TARGET_NAME) RSYNC_VCS_EXCLUSIONS = \ --exclude .svn --exclude .git --exclude .hg --exclude .bzr \ diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index 8460e37d09..adbd3fe67e 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -250,18 +250,18 @@ define TOOLCHAIN_EXTERNAL_INSTALL_WRAPPER base=$${i##*/}; \ case "$$base" in \ *-ar|*-ranlib|*-nm) \ - ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \ ;; \ *cc|*cc-*|*++|*++-*|*cpp|*-gfortran) \ ln -sf toolchain-wrapper $$base; \ ;; \ *gdb|*gdbtui) \ if test "$(BR2_PACKAGE_HOST_GDB)" != "y"; then \ - ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \ fi \ ;; \ *) \ - ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%../..%') .; \ + ln -sf $$(echo $$i | sed 's%^$(HOST_DIR)%..%') .; \ ;; \ esac; \ done diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c index 100aa181c6..3a4455ff82 100644 --- a/toolchain/toolchain-wrapper.c +++ b/toolchain/toolchain-wrapper.c @@ -178,7 +178,7 @@ int main(int argc, char **argv) perror(__FILE__ ": malloc"); return 2; } - sprintf(relbasedir, "%s/../..", argv[0]); + sprintf(relbasedir, "%s/..", argv[0]); absbasedir = realpath(relbasedir, NULL); } else { basename = progpath;