From 6db57c69360087b3b7b8fc2b7764d2911ec24d43 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Wed, 7 Apr 2010 00:50:10 +0200 Subject: toolchain: fix using external toolchains built with buildroot The toolchains built with buildroot use specially crafted paths for their sysroot and prefix. Fix that by asking gcc where it finds a file we know by relative path to the sysroot. This has the side effect of greatly simplifying the sysroot detection in every cases tested so far (BR toolchains, CT-NG toolchains, and CodeSourcery toolchains). Fixes bug #851. Thanks Thomas Petazzoni for the hint and some testings. Thanks Grant Edwards for the report and the comments. Signed-off-by: Yann E. MORIN Acked-by: Thomas Petazzoni Signed-off-by: Peter Korsgaard --- toolchain/external-toolchain/ext-tool.mk | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'toolchain/external-toolchain') diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk index 80bdae63b..449328131 100644 --- a/toolchain/external-toolchain/ext-tool.mk +++ b/toolchain/external-toolchain/ext-tool.mk @@ -205,14 +205,7 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y) EXTERNAL_LIBS+=libstdc++.so endif -# This dance is needed because the toolchain may have been relocated, so the -# configured paths may no longer match; fortunately, the sysroot moves along -# the toolchain, so is always at the same place relative to the toolchain's -# current location. -CFG_PREFIX_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--prefix=" | cut -f2 -d=) -CFG_SYSROOT_DIR=$(shell LANG=C $(TARGET_CC) -v 2>&1 | grep ^Configured | tr " " "\n" | grep -- "--with-sysroot=" | cut -f2 -d=) -REL_SYSROOT_DIR=$(shell echo "$(CFG_SYSROOT_DIR)" |sed -r -e 's:^$(CFG_PREFIX_DIR)::;') -SYSROOT_DIR=$(TOOLCHAIN_EXTERNAL_PATH)/$(REL_SYSROOT_DIR) +SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC) -print-file-name=libc.a |sed -r -e 's:usr/lib/libc\.a::;')) $(STAMP_DIR)/ext-toolchain-installed: @echo "Checking external toolchain settings" -- cgit v1.2.3