diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2020-05-27 15:24:21 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2020-05-28 10:53:53 +0000 |
commit | 11f3556d9ce3425fe004db4f4d4084a0b37d4c30 (patch) | |
tree | 0b107630c7609cb87f8b074b3744e158ef5d8488 | |
parent | cb9e011ff0b1d4412102a9e3a2a940a6605b2ade (diff) |
tcwg_bmk-build.sh: Rework details of arm/thumb mode selection
... while keeping general logic the same. This approach sanity
checks that 2 configurations of cflags in *-vs-* configurations
are using the same mode.
To use different arm/thumb modes in *-vs-* configurations we would
need to build GCC and Glibc 2 times, which we could do, if required.
Change-Id: I3d9e6152b8b01f561e7e60557ccc680e99728103
-rwxr-xr-x | tcwg_bmk-build.sh | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/tcwg_bmk-build.sh b/tcwg_bmk-build.sh index 7129c529..0ff919d5 100755 --- a/tcwg_bmk-build.sh +++ b/tcwg_bmk-build.sh @@ -58,28 +58,35 @@ if ! test_array cflags; then done fi -gcc_override_configure=() -# Set default ARM/Thumb mode for AArch32 compiler. This ensures that libraries -# (Glibc, libgcc, libstdc++, libgfortran, etc.) are built in the "interesting" -# ISA. +gcc_mode="" for i in $(seq 0 $(("${#cflags[@]}" - 1))); do + cflags_mode="" case "${rr[target]}:${cflags[$i]}" in - "arm:"*"mthumb"*) - gcc_override_configure+=("--set" "gcc_override_configure=--with-mode=thumb") - ;; - "arm:"*"marm"*) - gcc_override_configure+=("--set" "gcc_override_configure=--with-mode=arm") - ;; + "arm:"*"mthumb"*) cflags_mode=thumb ;; + "arm:"*"marm"*) cflags_mode=arm ;; "arm:-Os"*|"arm:-Oz"*) - gcc_override_configure+=("--set" "gcc_override_configure=--with-mode=thumb") + cflags_mode=thumb cflags[$i]="${cflags[$i]}_mthumb" ;; "arm:"*) - gcc_override_configure+=("--set" "gcc_override_configure=--with-mode=arm") + cflags_mode=arm cflags[$i]="${cflags[$i]}_marm" ;; esac + if [ x"$gcc_mode" = x"" ]; then + gcc_mode="$cflags_mode" + elif [ x"$gcc_mode" != x"$cflags_mode" ]; then + assert_with_msg "Unsupported arm/thumb configuration ${cflags[$(($i - 1))]} and ${cflags[$i]}" false + fi done + +gcc_override_configure=() +# Set default ARM/Thumb mode for AArch32 compiler. This ensures that libraries +# (Glibc, libgcc, libstdc++, libgfortran, etc.) are built in the "interesting" +# ISA. +case "$gcc_mode" in + arm|thumb) gcc_override_configure+=("--set" "gcc_override_configure=--with-mode=$gcc_mode") ;; +esac # Disable libsanitizer because it didn't build in April-June 2018. # We need to test revisions during that time period for performance regressions. gcc_override_configure+=("--set" "gcc_override_configure=--disable-libsanitizer") |