Skip to content

Commit 6f1977b

Browse files
committed
Use variables for selecting compilers
The latest and earliest clang/GCC compilers are now used through variables instead of symlinks and also the all.sh script is updated to support options for overriding the default values. Signed-off-by: Gowtham Suresh Kumar <[email protected]>
1 parent 1e829a4 commit 6f1977b

File tree

2 files changed

+40
-13
lines changed

2 files changed

+40
-13
lines changed

scripts/output_env.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,35 @@ echo
105105
print_version "gcc" "--version" "" "head -n 1"
106106
echo
107107

108-
print_version "gcc-earliest" "--version" "" "head -n 1"
108+
if [ -n "${GCC_EARLIEST+set}" ]; then
109+
print_version "${GCC_EARLIEST}" "--version" "" "head -n 1"
110+
else
111+
echo " GCC_EARLIEST : Not configured."
112+
fi
109113
echo
110114

111-
print_version "gcc-latest" "--version" "" "head -n 1"
115+
if [ -n "${GCC_LATEST+set}" ]; then
116+
print_version "${GCC_LATEST}" "--version" "" "head -n 1"
117+
else
118+
echo " GCC_LATEST : Not configured."
119+
fi
112120
echo
113121

114122
print_version "clang" "--version" "" "head -n 2"
115123
echo
116124

117-
print_version "clang-earliest" "--version" "" "head -n 2"
125+
if [ -n "${CLANG_EARLIEST+set}" ]; then
126+
print_version "${CLANG_EARLIEST}" "--version" "" "head -n 2"
127+
else
128+
echo " CLANG_EARLIEST : Not configured."
129+
fi
118130
echo
119131

120-
print_version "clang-latest" "--version" "" "head -n 2"
132+
if [ -n "${CLANG_LATEST+set}" ]; then
133+
print_version "${CLANG_LATEST}" "--version" "" "head -n 2"
134+
else
135+
echo " CLANG_LATEST : Not configured."
136+
fi
121137
echo
122138

123139
print_version "ldd" "--version" "" "head -n 1"

tests/scripts/all.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ pre_initialize_variables () {
176176
: ${ARMC6_BIN_DIR:=/usr/bin}
177177
: ${ARM_NONE_EABI_GCC_PREFIX:=arm-none-eabi-}
178178
: ${ARM_LINUX_GNUEABI_GCC_PREFIX:=arm-linux-gnueabi-}
179-
179+
: ${CLANG_LATEST:="clang-16"}
180+
: ${CLANG_EARLIEST:="clang-3.5"}
181+
: ${GCC_LATEST:="gcc-12"}
182+
: ${GCC_EARLIEST:="gcc-4.7"}
180183
# if MAKEFLAGS is not set add the -j option to speed up invocations of make
181184
if [ -z "${MAKEFLAGS+set}" ]; then
182185
export MAKEFLAGS="-j$(all_sh_nproc)"
@@ -273,6 +276,10 @@ General options:
273276
Tool path options:
274277
--armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory.
275278
--armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory.
279+
--clang-earliest=<Clang_earliest_path> Earliest version of clang available
280+
--clang-latest=<Clang_latest_path> Latest version of clang available
281+
--gcc-earliest=<GCC_earliest_path> Earliest version of GCC available
282+
--gcc-latest=<GCC_latest_path> Latest version of GCC available
276283
--gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests.
277284
--gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests.
278285
--gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests.
@@ -439,9 +446,13 @@ pre_parse_command_line () {
439446
--armcc) no_armcc=;;
440447
--armc5-bin-dir) shift; ;; # assignment to ARMC5_BIN_DIR done in pre_parse_command_line_for_dirs
441448
--armc6-bin-dir) shift; ;; # assignment to ARMC6_BIN_DIR done in pre_parse_command_line_for_dirs
449+
--clang-earliest) shift; CLANG_EARLIEST="$1";;
450+
--clang-latest) shift; CLANG_LATEST="$1";;
442451
--error-test) error_test=$((error_test + 1));;
443452
--except) all_except=1;;
444453
--force|-f) FORCE=1;;
454+
--gcc-earliest) shift; GCC_EARLIEST="$1";;
455+
--gcc-latest) shift; GCC_LATEST="$1";;
445456
--gnutls-cli) shift; GNUTLS_CLI="$1";;
446457
--gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";;
447458
--gnutls-legacy-serv) shift; GNUTLS_LEGACY_SERV="$1";;
@@ -4015,34 +4026,34 @@ fi
40154026
40164027
component_test_clang_latest_opt () {
40174028
scripts/config.py full
4018-
test_build_opt 'full config' clang-latest -O0 -Os -O2
4029+
test_build_opt 'full config' "$CLANG_LATEST" -O0 -Os -O2
40194030
}
40204031
support_test_clang_latest_opt () {
4021-
type clang-latest >/dev/null 2>/dev/null
4032+
type "$CLANG_LATEST" >/dev/null 2>/dev/null
40224033
}
40234034
40244035
component_test_clang_earliest_opt () {
40254036
scripts/config.py full
4026-
test_build_opt 'full config' clang-earliest -O0
4037+
test_build_opt 'full config' "$CLANG_EARLIEST" -O0
40274038
}
40284039
support_test_clang_earliest_opt () {
4029-
type clang-earliest >/dev/null 2>/dev/null
4040+
type "$CLANG_EARLIEST" >/dev/null 2>/dev/null
40304041
}
40314042
40324043
component_test_gcc_latest_opt () {
40334044
scripts/config.py full
4034-
test_build_opt 'full config' gcc-latest -O0 -Os -O2
4045+
test_build_opt 'full config' "$GCC_LATEST" -O0 -Os -O2
40354046
}
40364047
support_test_gcc_latest_opt () {
4037-
type gcc-latest >/dev/null 2>/dev/null
4048+
type "$GCC_LATEST" >/dev/null 2>/dev/null
40384049
}
40394050
40404051
component_test_gcc_earliest_opt () {
40414052
scripts/config.py full
4042-
test_build_opt 'full config' gcc-earliest -O0
4053+
test_build_opt 'full config' "$GCC_EARLIEST" -O0
40434054
}
40444055
support_test_gcc_earliest_opt () {
4045-
type gcc-earliest >/dev/null 2>/dev/null
4056+
type "$GCC_EARLIEST" >/dev/null 2>/dev/null
40464057
}
40474058
40484059
component_build_mbedtls_config_file () {

0 commit comments

Comments
 (0)