[Buildroot] [PATCH] toolchain-external: improve sysroot lookup with multilib
Mike Frysinger
vapier at gentoo.org
Sun Dec 12 16:25:25 UTC 2010
If the external toolchain we're using starts in a path other than /usr/lib,
the sysroot detection fails as it has /usr/lib hardcoded. Improve the code
to strip out any lib suffixes to handle the most common behavior.
Signed-off-by: Mike Frysinger <vapier at gentoo.org>
---
toolchain/toolchain-external/ext-tool.mk | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
index a913162..646b8ea 100644
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -65,7 +65,7 @@ endif # ! no threads
TARGET_CC_NO_SYSROOT=$(filter-out --sysroot=%,$(TARGET_CC_NOCCACHE))
SYSROOT_DIR=$(shell $(TARGET_CC_NO_SYSROOT) -print-sysroot 2>/dev/null)
ifeq ($(SYSROOT_DIR),)
-SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib/libc\.a::;')
+SYSROOT_DIR=$(shell readlink -f $$(LANG=C $(TARGET_CC_NO_SYSROOT) -print-file-name=libc.a) |sed -r -e 's:usr/lib[^/]*/libc\.a::;')
endif
# Now, find if the toolchain specifies a sub-directory for the
--
1.7.3.3
More information about the buildroot
mailing list