diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-09-29 23:11:12 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2017-10-12 11:00:39 +0000 |
commit | 9e5bde8abc04786c1673316be4740622248f1af9 (patch) | |
tree | 453fb0e3eb6c6a2de40bd4dc1e61c1b45a02ff9a | |
parent | c937c2193b4c9524804d789f3b469448cac08f03 (diff) |
tcwg-benchmark.sh: Add support to benchmark LLVM toolchains
The toolchain type is auto-detected from presence of *gcc or *clang
binaries in the compiler tree.
Change-Id: I7acf64a6f01993cec1b7ff21ed688752063bc95c
-rwxr-xr-x | tcwg-benchmark.sh | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tcwg-benchmark.sh b/tcwg-benchmark.sh index 2a1e8a3e..72a7b4c4 100755 --- a/tcwg-benchmark.sh +++ b/tcwg-benchmark.sh @@ -8,6 +8,7 @@ set -ex # for empty arguments. build_container_tag="${build_container_tag:-xenial}" toolchain_url="$toolchain_url" +toolchain_type="${toolchain_type:-auto}" bench_list="$bench_list" cflags="$cflags" extension="$extension" @@ -83,12 +84,34 @@ esac case "$toolchain_url" in "http://"*|"https://"*|"rsync://"*) - ccpath=$(find "$toolchaindir" -name "*-gcc") + case "$toolchain_type" in + "gnu"|"llvm") ;; + "auto") + if [ x"$(find "$toolchaindir" -path "*bin/*gcc" | wc -l)" != x"0" ]; then + toolchain_type="gnu" + elif [ x"$(find "$toolchaindir" -path "*bin/*clang" | wc -l)" != x"0" ]; then + toolchain_type="llvm" + else + echo "ERROR: Cannot autodetect toolchain type" + exit 1 + fi + ;; + *) + echo "ERROR: wrong toolchain_type: $toolchain_type" + exit 1 + ;; + esac + + case "$toolchain_type" in + "gnu") ccname="gcc" ;; + "llvm") ccname="clang" ;; + esac + ccpath=$(find "$toolchaindir" -path "*bin/*$ccname") if [ $(echo "$ccpath" | wc -w) -ne 1 ]; then echo "ERROR: found more than one compiler: $ccpath" exit 1 fi - ccprefix=$(echo "$ccpath" | sed -e 's/-gcc$/-/') + ccprefix=$(echo "$ccpath" | sed -e "s/$ccname\$//") # Copy toolchain to the build container. rsync -a --delete -e "ssh -p$build_container_port" "$toolchaindir/" "$build_container_host:$toolchaindir/" ccprefix="$build_container_host:$build_container_port:$ccprefix" @@ -138,7 +161,7 @@ build_container_exec ssh -t "$boardname" bmk-scripts/run.sh \ --iterations "$iterations" \ --run_profile "$run_profile" \ "${sysroot:+--sysroot "$sysroot"}" \ - --toolchain gnu \ + --toolchain "$toolchain_type" \ --resultsdest "dev-01.tcwglab:/home/tcwg-benchmark/results-${results_id}/${NODE_NAME}" \ --nodename "${NODE_NAME}" \ --forceinstall "${forceinstall}" \ |