* [Buildroot] [PATCH] Fix external toolchain sysroot detection
@ 2010-04-06 22:47 Yann E. MORIN
2010-04-06 22:47 ` [Buildroot] [PATCH] toolchain: fix using external toolchains built with buildroot Yann E. MORIN
0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2010-04-06 22:47 UTC (permalink / raw)
To: buildroot
This patch should fix the case when the external toolchain was built
by buildroot. It also has the nice side-effect of being much more simpler.
---
Yann E. MORIN (1):
toolchain: fix using external toolchains built with buildroot
toolchain/external-toolchain/ext-tool.mk | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
--
Signature
^ permalink raw reply [flat|nested] 2+ messages in thread* [Buildroot] [PATCH] toolchain: fix using external toolchains built with buildroot
2010-04-06 22:47 [Buildroot] [PATCH] Fix external toolchain sysroot detection Yann E. MORIN
@ 2010-04-06 22:47 ` Yann E. MORIN
0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2010-04-06 22:47 UTC (permalink / raw)
To: buildroot
From: Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
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.
---
toolchain/external-toolchain/ext-tool.mk | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/toolchain/external-toolchain/ext-tool.mk b/toolchain/external-toolchain/ext-tool.mk
index 80bdae6..b379095 100644
--- a/toolchain/external-toolchain/ext-tool.mk
+++ b/toolchain/external-toolchain/ext-tool.mk
@@ -205,14 +205,8 @@ 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::;'))
+$(info SYSROOT_DIR="$(SYROOT_DIR)")
$(STAMP_DIR)/ext-toolchain-installed:
@echo "Checking external toolchain settings"
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-06 22:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-06 22:47 [Buildroot] [PATCH] Fix external toolchain sysroot detection Yann E. MORIN
2010-04-06 22:47 ` [Buildroot] [PATCH] toolchain: fix using external toolchains built with buildroot Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox