aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2014-08-01 11:44:04 +0100
committerRenato Golin <renato.golin@linaro.org>2014-08-01 12:34:35 +0100
commit354abbb54d0c4f42fa05afb85424955ffd3f4214 (patch)
treedefdc79065e693ad5ea5029a2ed8a89bc048cbc0
parenta757be3a37b706498da107398eb532b1890c8e21 (diff)
LLVM changes
Allows creation of clang/clang++ configs, so they can be used anywhere. Adding -mfpu specific style for clang variant Calls clang/gcc for version (as base_cc_name)
-rwxr-xr-xspec2xxx-prepare24
1 files changed, 18 insertions, 6 deletions
diff --git a/spec2xxx-prepare b/spec2xxx-prepare
index 58a86aa..b7cbd36 100755
--- a/spec2xxx-prepare
+++ b/spec2xxx-prepare
@@ -23,7 +23,13 @@ spec=$(cd $spec; pwd)
$local || sshfs $target:$spec $spec
-for cc in gcc g++ gfortran; do
+for cc in gcc g++ gfortran clang clang++; do
+ base_cc_name=gcc
+ base_cxx_name=g++
+ if [ "`echo $cc | grep clang`" != "" ]; then
+ base_cc_name=clang
+ base_cxx_name=clang++
+ fi
cat > $spec/bin/ssh-$config-$cc <<EOF
#!/bin/sh
@@ -44,8 +50,8 @@ hw_fpu="$(cat $cpuinfo | grep Features | head -n 1 | sed -e 's/.*: //')"
sw_os="$(ssh $target uname -r | head -n 1)"
-sw_compiler="$(${cc_prefix}gcc -v 2>&1 | tail -n 1)"
-sw_compiler="$sw_compiler $(${cc_prefix}gcc -v 2>&1 | grep 'Configured with' | head -n 1)"
+sw_compiler="$(${cc_prefix}$base_cc_name -v 2>&1 | tail -n 1)"
+sw_compiler="$sw_compiler $(${cc_prefix}$base_cc_name -v 2>&1 | grep 'Configured with' | head -n 1)"
case "$hw_cpu" in
*"v7l"*) mcpu="-mcpu=cortex-a15" ;;
@@ -54,7 +60,13 @@ case "$hw_cpu" in
esac
case "$hw_fpu" in
- *"neon"*"vfpv4"*) mfpu="-mfpu=neon-vfpv4" ;;
+ *"neon"*"vfpv4"*)
+ if [ "`echo $cc | sed 's/+//g'`" = "clang" ]; then
+ mfpu="-mfpu=neon"
+ else
+ mfpu="-mfpu=neon-vfpv4"
+ fi
+ ;;
*) mfpu="" ;;
esac
@@ -99,8 +111,8 @@ cat $cfg_tmpl | sed \
-e "s#@ITERATIONS@#5#g" \
-e "s#@ITERATIONS_2@#7#g" \
-e "s#@ITERATIONS_4@#9#g" \
- -e "s#@CC@#ssh-$config-gcc#g" \
- -e "s#@CXX@#ssh-$config-g++#g" \
+ -e "s#@CC@#ssh-$config-$base_cc_name#g" \
+ -e "s#@CXX@#ssh-$config-$base_cxx_name#g" \
-e "s#@FORTRAN@#ssh-$config-gfortran#g" \
-e "s#@OPTIMIZE@#$optimize#g" \
-e "s#@MCPU@#$mcpu#g" \