summaryrefslogtreecommitdiffstats
path: root/toolchain/helpers.mk
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-01-28 17:12:02 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-03-01 20:26:38 +0100
commite6e60becb008dd389c51d2d75cbfd63551300dae (patch)
tree0170dbb5a50d6f7ef88f407ed1d495205de3d474 /toolchain/helpers.mk
parent2ec3e6db46e35ee90bc8eef0d5aedb2891764e8a (diff)
downloadbuildroot-novena-e6e60becb008dd389c51d2d75cbfd63551300dae.tar.gz
buildroot-novena-e6e60becb008dd389c51d2d75cbfd63551300dae.zip
external-toolchain: add support for Linaro 2012.01
Linaro has just released a new pre-built toolchain, available as a tarball, which is a pure toolchain (only the C library is included). This makes this new Linaro 2012.01 toolchain usable in Buildroot, so let's integrate the support for it. In addition to simply adding the new external toolchain at the usual locations, this patch allows need to adapt a few things to support Linaro toolchains. Most toolchains store their libraries in the "lib/" or "usr/lib" directories relative to the toolchain. Buildroot toolchains on the other hand, store the libraries in the "usr/<target-name>/lib" directory. And the Linaro toolchain has choosen to use the "lib/<target-name>" directory. Therefore, this patch adjust: * The logic to search a particular library when that library needs to be copied to the target directory * The logic to deduce the sysroot directory from the libc.a file location in the toolchain: removing "(usr/?)lib(64?)" is no longer sufficient, we need to take into account the "lib/<target-name>/" case. Since the Linaro toolchain generates code for Cortex-A processors only, the selection of this toolchain is limited to Cortex-A8 and Cortex-A9. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'toolchain/helpers.mk')
-rw-r--r--toolchain/helpers.mk31
1 files changed, 25 insertions, 6 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 6e7f1f4c9..bb1ea9040 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -7,11 +7,30 @@
# directory to the target directory. Also optionaly strips the
# library.
#
-# Most toolchains have their libraries either in /lib or /usr/lib
-# relative to their ARCH_SYSROOT_DIR. Buildroot toolchains, however,
-# have basic libraries in /lib, and libstdc++/libgcc_s in
-# /usr/<target-name>/lib(64). Thanks to ARCH_LIB_DIR we also take into
-# account toolchains that have the libraries in lib64 and usr/lib64.
+# Most toolchains (CodeSourcery ones) have their libraries either in
+# /lib or /usr/lib relative to their ARCH_SYSROOT_DIR, so we search
+# libraries in:
+#
+# $${ARCH_LIB_DIR}
+# usr/$${ARCH_LIB_DIR}
+#
+# Buildroot toolchains, however, have basic libraries in /lib, and
+# libstdc++/libgcc_s in /usr/<target-name>/lib(64), so we also need to
+# search libraries in:
+#
+# usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR}
+#
+# Finally, Linaro toolchains have the libraries in lib/<target-name>/,
+# so we need to search libraries in:
+#
+# $${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX)
+#
+# Thanks to ARCH_LIB_DIR we also take into account toolchains that
+# have the libraries in lib64 and usr/lib64.
+#
+# Please be very careful to check the major toolchain sources:
+# Buildroot, Crosstool-NG, CodeSourcery and Linaro before doing any
+# modification on the below logic.
#
# $1: arch specific sysroot directory
# $2: library directory ('lib' or 'lib64') from which libraries must be copied
@@ -25,7 +44,7 @@ copy_toolchain_lib_root = \
DESTDIR="$(strip $4)" ; \
\
LIBS=`(cd $${ARCH_SYSROOT_DIR}; \
- find -L $${ARCH_LIB_DIR} usr/$${ARCH_LIB_DIR} usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} \
+ find -L $${ARCH_LIB_DIR} usr/$${ARCH_LIB_DIR} usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} $${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX) \
-maxdepth 1 -name "$${LIB}.*" 2>/dev/null \
)` ; \
for FILE in $${LIBS} ; do \