aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2018-10-25 11:28:32 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2018-10-29 11:16:10 +0000
commit582cd050de07ddea502ea3591be233aa7411111b (patch)
treeca42ea5a013c192c33c86dc20c376019a36a9f9b
parent8b67a3d66d29ea888453ff300d30dfd67c05b95d (diff)
Use -funconstrained-commons if supported.
This option is needed since gcc-6, so add it when supported. Change-Id: Ieb38e57704367a97857fd63409f4ba4b6f6b9888
-rw-r--r--cpu2006.cfg2
-rwxr-xr-xspec2xxx-config10
2 files changed, 11 insertions, 1 deletions
diff --git a/cpu2006.cfg b/cpu2006.cfg
index 0d6a318..65d0002 100644
--- a/cpu2006.cfg
+++ b/cpu2006.cfg
@@ -55,7 +55,7 @@ CPORTABILITY = -fsigned-char
CXXPORTABILITY = -DSPEC_CPU_LINUX
416.gamess=default=default=default:
-FPORTABILITY = -funconstrained-commons -std=legacy
+FPORTABILITY = @FUNCONSTRAINED_COMMONS@ -std=legacy
481.wrf=default=default=default:
CPORTABILITY = -DSPEC_CPU_CASE_FLAG -DSPEC_CPU_LINUX
diff --git a/spec2xxx-config b/spec2xxx-config
index ffe5505..751c38b 100755
--- a/spec2xxx-config
+++ b/spec2xxx-config
@@ -194,6 +194,15 @@ sw_os="$(uname -r | head -n 1)"
sw_compiler="$(${tools[cc]} -v 2>&1 | tail -n 1)"
#sw_compiler="$sw_compiler $(${tools[cc]} -v 2>&1 | grep 'Configured with' | head -n 1)"
+# -funconstrained-commons is needed since gcc-6, use it if supported
+funconstrained_commons=
+cat > main.f90 <<EOF
+program main
+end program main
+EOF
+$(${tools[fortran]} main.f90 -funconstrained-commons) && funconstrained_commons=-funconstrained-commons
+rm -f main.f90 a.out
+
case "$mcpu:$hw_cpu" in
"autodetect:"*"v7l"*) mcpu="-mcpu=cortex-a15" ;;
"autodetect:"*"aarch64"*) mcpu="-mcpu=cortex-a57" ;;
@@ -388,6 +397,7 @@ cat $cfg_tmpl | sed \
-e "s#@DSPEC_CPU_LP64@#$spec_cpu_lp64#g" \
-e "s#@RATE_COPIES@#$rate_copies#g" \
-e "s#@MAX_MCF_RATE_COPIES@#$max_mcf_rate_copies#g" \
+ -e "s#@FUNCONSTRAINED_COMMONS@#$funconstrained_commons#g" \
-e "s#@PERF_CALLGRAPH@#$perf_callgraph#g" \
-e "s#@PERF_CPU@#$perf_cpu#g" \
-e "s#@BIND@#$bind_cpu#g" \