summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/vars.mk3
-rw-r--r--toolchain/gcc/Makefile2
2 files changed, 4 insertions, 1 deletions
diff --git a/mk/vars.mk b/mk/vars.mk
index bb175928e..b376140ed 100644
--- a/mk/vars.mk
+++ b/mk/vars.mk
@@ -29,6 +29,9 @@ STAGING_HOST_DIR:= ${BASE_DIR}/host_${CPU_ARCH}_${ADK_TARGET_LIBC}
STAGING_HOST_DIR_PFX:= ${BASE_DIR}/host_*
STAGING_TARGET_DIR:= ${BASE_DIR}/target_${CPU_ARCH}_${ADK_TARGET_LIBC}
STAGING_TARGET_DIR_PFX:=${BASE_DIR}/target_*
+# relation from STAGING_HOST_DIR to STAGING_TARGET_DIR (for gcc to find
+# its sysroot while staying relocatable)
+STAGING_HOST2TARGET:= ../target_${CPU_ARCH}_${ADK_TARGET_LIBC}
TOOLCHAIN_BUILD_DIR= $(BASE_DIR)/toolchain_build_${CPU_ARCH}_${ADK_TARGET_LIBC}
TOOLCHAIN_BUILD_DIR_PFX=$(BASE_DIR)/toolchain_build_*
TOOLS_BUILD_DIR= $(BASE_DIR)/tools_build
diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile
index 3c160d4f4..b881473de 100644
--- a/toolchain/gcc/Makefile
+++ b/toolchain/gcc/Makefile
@@ -133,7 +133,7 @@ $(GCC_BUILD_DIR_FINAL)/.configured:
$(WRKBUILD)/configure \
${GCC_CONFOPTS} \
--enable-languages=$(LANGUAGES) \
- --with-sysroot=$(STAGING_TARGET_DIR) \
+ --with-sysroot='$${prefix}/${STAGING_HOST2TARGET}' \
--with-slibdir=$(STAGING_TARGET_DIR)/lib \
--enable-shared \
);