* [Buildroot] [PATCH] toolchain-external: support toolchains with lib32 directories
@ 2013-07-19 12:25 Thomas De Schampheleire
2013-07-27 14:31 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Thomas De Schampheleire @ 2013-07-19 12:25 UTC (permalink / raw)
To: buildroot
Some toolchains, like the Cavium Networks' one, have lib32/ and lib64/
directories, while the standard lib/ is empty. To find libc.a, buildroot
currently only looks in lib/ and lib64/. This patch extends the search
to lib32/ as well.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
---
toolchain/toolchain-external/ext-tool.mk | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
Note: instead of using the construct 'lib(32|64)*', one could also use
'lib*'. The latter would also match libfoo, but that's probably ok. Let me
know if you prefer that style.
diff --git a/toolchain/toolchain-external/ext-tool.mk b/toolchain/toolchain-external/ext-tool.mk
--- a/toolchain/toolchain-external/ext-tool.mk
+++ b/toolchain/toolchain-external/ext-tool.mk
@@ -363,7 +363,7 @@ endif
@$(call MESSAGE,"Checking external toolchain settings")
$(Q)$(call check_cross_compiler_exists,$(TOOLCHAIN_EXTERNAL_CC))
$(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \
- SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
+ SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
if test -z "$${SYSROOT_DIR}" ; then \
@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
exit 1 ; \
@@ -397,7 +397,7 @@ endif
#
# SYSROOT_DIR: the main sysroot directory, deduced from
# LIBC_A_LOCATION by removing the
-# usr/lib[64]/libc.a part of the path.
+# usr/lib[32|64]/libc.a part of the path.
# Ex: /x-tools/mips-2011.03/mips-linux-gnu/libc/
#
# ARCH_LIBC_A_LOCATION: location of the libc.a file in the selected
@@ -408,11 +408,11 @@ endif
#
# ARCH_SYSROOT_DIR: the sysroot of the selected multilib variant,
# deduced from ARCH_LIBC_A_LOCATION by removing
-# usr/lib[64]/libc.a at the end of the path.
+# usr/lib[32|64]/libc.a at the end of the path.
# Ex: /x-tools/mips-2011.03/mips-linux-gnu/libc/mips16/soft-float/el/
#
-# ARCH_LIB_DIR: 'lib' or 'lib64' depending on where libraries are
-# stored. Deduced from ARCH_LIBC_A_LOCATION by
+# ARCH_LIB_DIR: 'lib', 'lib32' or 'lib64' depending on where libraries
+# are stored. Deduced from ARCH_LIBC_A_LOCATION by
# looking at usr/lib??/libc.a.
# Ex: lib
#
@@ -433,14 +433,14 @@ endif
$(STAMP_DIR)/ext-toolchain-installed: $(STAMP_DIR)/ext-toolchain-checked
$(Q)LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) -print-file-name=libc.a)` ; \
- SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
+ SYSROOT_DIR=`echo $${LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
if test -z "$${SYSROOT_DIR}" ; then \
@echo "External toolchain doesn't support --sysroot. Cannot use." ; \
exit 1 ; \
fi ; \
ARCH_LIBC_A_LOCATION=`readlink -f $$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
- ARCH_SYSROOT_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
- ARCH_LIB_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \
+ ARCH_SYSROOT_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
+ ARCH_LIB_DIR=`echo $${ARCH_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(32|64)?)/(.*/)?libc.a:\1:'` ; \
SUPPORT_LIB_DIR="" ; \
if test `find $${ARCH_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
LIBSTDCPP_A_LOCATION=$$(LANG=C $(TOOLCHAIN_EXTERNAL_CC) $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \
@@ -489,8 +489,8 @@ endif
$(Q)$(call MESSAGE,"Install external toolchain FDPIC libraries to target...") ; \
FDPIC_EXTERNAL_CC=$(dir $(TOOLCHAIN_EXTERNAL_CC))/../../bfin-linux-uclibc/bin/bfin-linux-uclibc-gcc ; \
FDPIC_LIBC_A_LOCATION=`readlink -f $$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libc.a)` ; \
- FDPIC_SYSROOT_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(64)?/(.*/)?libc\.a::'` ; \
- FDPIC_LIB_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(64)?)/(.*/)?libc.a:\1:'` ; \
+ FDPIC_SYSROOT_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:usr/lib(32|64)?/(.*/)?libc\.a::'` ; \
+ FDPIC_LIB_DIR=`echo $${FDPIC_LIBC_A_LOCATION} | sed -r -e 's:.*/usr/(lib(32|64)?)/(.*/)?libc.a:\1:'` ; \
FDPIC_SUPPORT_LIB_DIR="" ; \
if test `find $${FDPIC_SYSROOT_DIR} -name 'libstdc++.a' | wc -l` -eq 0 ; then \
FDPIC_LIBSTDCPP_A_LOCATION=$$(LANG=C $${FDPIC_EXTERNAL_CC} $(TOOLCHAIN_EXTERNAL_CFLAGS) -print-file-name=libstdc++.a) ; \
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] toolchain-external: support toolchains with lib32 directories
2013-07-19 12:25 [Buildroot] [PATCH] toolchain-external: support toolchains with lib32 directories Thomas De Schampheleire
@ 2013-07-27 14:31 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2013-07-27 14:31 UTC (permalink / raw)
To: buildroot
Dear Thomas De Schampheleire,
On Fri, 19 Jul 2013 14:25:18 +0200, Thomas De Schampheleire wrote:
> Some toolchains, like the Cavium Networks' one, have lib32/ and lib64/
> directories, while the standard lib/ is empty. To find libc.a, buildroot
> currently only looks in lib/ and lib64/. This patch extends the search
> to lib32/ as well.
>
> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Committed, thanks.
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-07-27 14:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-19 12:25 [Buildroot] [PATCH] toolchain-external: support toolchains with lib32 directories Thomas De Schampheleire
2013-07-27 14:31 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox