summaryrefslogtreecommitdiffstats
path: root/scripts/install_copy_toolchain.sh
diff options
context:
space:
mode:
authorRemy Bohmer <linux@bohmer.net>2012-03-13 22:32:15 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-03-14 12:01:56 +0100
commit6ab2da4165bb0051602a5b40beebfab13d4ba68a (patch)
tree1b5d0b684fb89c2ffac0df30283131bc918cc394 /scripts/install_copy_toolchain.sh
parent4a10ae9cd70c3f4e72482e924b35bc3de9569b12 (diff)
downloadptxdist-6ab2da4165bb0051602a5b40beebfab13d4ba68a.tar.gz
ptxdist-6ab2da4165bb0051602a5b40beebfab13d4ba68a.tar.xz
Add some support for multilib detection in the toolchain
For Sourcery Codebench toolchains the 'gcc -print-file-name' only returns the proper sysroot directory when the proper architecture flags are provided via '-m64 -march=' flags. These flags are provided via the ptxdist platformconfig PTXCONF_TARGET_EXTRA_CFLAGS setting. These flags therefore also need to be passed to GCC here. Signed-off-by: Remy Bohmer <linux@bohmer.net> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/install_copy_toolchain.sh')
-rwxr-xr-xscripts/install_copy_toolchain.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/install_copy_toolchain.sh b/scripts/install_copy_toolchain.sh
index 8a6769833..726cc6171 100755
--- a/scripts/install_copy_toolchain.sh
+++ b/scripts/install_copy_toolchain.sh
@@ -50,12 +50,14 @@ ptxd_abs2rel() {
# out: $lib_path
#
ptxd_get_lib_path() {
- local lib lib_dir lib_path
+ local lib lib_dir lib_path extra_cflags
lib="${1}"
+ extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
+ extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
# ask the compiler for the lib
- lib_path="$(${CC} -print-file-name=${lib})"
+ lib_path="$(${CC} ${extra_cppflags} ${extra_cflags} -print-file-name=${lib})"
if test "${lib_path}" = "${lib}"; then
echo "install_copy_toolchain_lib: ${lib} not found" >&2
return 1
@@ -77,9 +79,11 @@ ptxd_get_lib_path() {
#
ptxd_get_dl() {
local dl
+ extra_cppflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CPPFLAGS)"
+ extra_cflags="$(ptxd_get_ptxconf PTXCONF_TARGET_EXTRA_CFLAGS)"
dl="$(echo 'int main(void){return 0;}' | \
- ${CC} -x c -o /dev/null -v - 2>&1 | \
+ ${CC} ${extra_cppflags} ${extra_cflags} -x c -o /dev/null -v - 2>&1 | \
sed -n -e 's/.* -dynamic-linker \([^ ]*\).*/\1/p')"
echo "${dl##*/}"