Lines Matching +full:lint +full:- +full:py +full:- +full:build
6 # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
18 # http://www.apache.org/licenses/LICENSE-2.0
43 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
54 # -------
59 # ---------------
61 # Warning: the test is destructive. It includes various build modes and
70 # * Basic Unix tools (Windows users note: a Unix-style find must be before
77 # * arm-gcc and mingw-gcc
78 # * ArmCC 5 and ArmCC 6, unless invoked with --no-armcc
89 # script -c tests/scripts/all.sh
94 # ---------------------
101 # * component_build_XXX: build things but don't run them.
102 # * component_test_XXX: build and test.
112 # cleaned-up state, and don't need to perform the cleanup themselves.
117 # `tests/Makefile` from git. This cleans up after an in-tree use of
121 # script keeps running in --keep-going mode despite `set -e`. In keep-going
144 set -eu
147 if [ -d library -a -d include -a -d tests ]; then :; else
162 # Seed value used with the --release-test option.
164 # See also RELEASE_SEED in basic-build-test.sh. Debugging is easier if
167 # basic-build-test.sh as well.
174 : ${GNUTLS_CLI:="gnutls-cli"}
175 : ${GNUTLS_SERV:="gnutls-serv"}
181 : ${ARM_NONE_EABI_GCC_PREFIX:=arm-none-eabi-}
183 # if MAKEFLAGS is not set add the -j option to speed up invocations of make
184 if [ -z "${MAKEFLAGS+set}" ]; then
185 export MAKEFLAGS="-j"
192 ASAN_CFLAGS='-Werror -Wall -Wextra -fsanitize=address,undefined -fno-sanitize-recover=all'
198 ALL_COMPONENTS=$(sed -n 's/^ *component_\([0-9A-Z_a-z]*\) *().*/\1/p' <"$0")
214 set -f
234 $0 --no-armcc --except test_memsan
238 -h|--help Print this help and exit.
239 --list-all-components List all available test components and exit.
240 --list-components List components supported on this platform and exit.
243 -q|--quiet Only output component names, and errors if any.
244 -f|--force Force the tests to overwrite any modified files.
245 -k|--keep-going Run all tests and report errors at the end.
246 -m|--memory Additional optional memory tests.
247 --arm-none-eabi-gcc-prefix=<string>
248 Prefix for a cross-compiler for arm-none-eabi
250 --armcc Run ARM Compiler builds (on by default).
251 --except Exclude the COMPONENTs listed on the command line,
253 --no-armcc Skip ARM Compiler builds.
254 --no-force Refuse to overwrite modified files (default).
255 --no-keep-going Stop at the first error (default).
256 --no-memory No additional memory tests (default).
257 --no-quiet Print full ouput from components.
258 --out-of-source-dir=<path> Directory used for CMake out-of-source build tests.
259 --random-seed Use a random seed value for randomized tests (default).
260 …-r|--release-test Run this script in release mode. This fixes the seed value to ${RELEASE_SEED…
261 -s|--seed Integer seed value to use for this test run.
264 --armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory.
265 --armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory.
266 --gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests.
267 --gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests.
268 --gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests.
269 --gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests.
270 --openssl=<OpenSSL_path> OpenSSL executable to use for most tests.
271 … --openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3.
272 … --openssl-next=<OpenSSL_path> OpenSSL executable to use for recent things like ARIA
279 if [ -n "${MBEDTLS_ROOT_DIR+set}" ]; then
286 find . -name .git -prune \
287 -iname CMakeFiles -exec rm -rf {} \+ -o \
288 \( -iname cmake_install.cmake -o \
289 -iname CTestTestfile.cmake -o \
290 -iname CMakeCache.txt \) -exec rm {} \+
291 # Recover files overwritten by in-tree CMake builds
292 rm -f include/Makefile include/mbedtls/Makefile programs/*/Makefile
293 git update-index --no-skip-worktree Makefile library/Makefile programs/Makefile tests/Makefile
294 git checkout -- Makefile library/Makefile programs/Makefile tests/Makefile
296 if [ -f "$CONFIG_BAK" ]; then
309 trap - $1
310 kill -$1 $$
319 if [ -n "${current_component:-}" ]; then
325 if [ $QUIET -eq 1 ]; then
340 msg "build: ARM Compiler 6 ($FLAGS)"
342 WARNING_CFLAGS='-xc -std=c99' make lib
345 "$ARMC6_FROMELF" -z library/*.o
367 <programs/test/cpp_dummy_build.cpp sed -n 's/"$//; s!^#include "mbedtls/!!p' |
369 diff headers.txt -
378 while [ $# -gt 0 ]; do
380 --arm-none-eabi-gcc-prefix) shift; ARM_NONE_EABI_GCC_PREFIX="$1";;
381 --armcc) no_armcc=;;
382 --armc5-bin-dir) shift; ARMC5_BIN_DIR="$1";;
383 --armc6-bin-dir) shift; ARMC6_BIN_DIR="$1";;
384 --except) all_except=1;;
385 --force|-f) FORCE=1;;
386 --gnutls-cli) shift; GNUTLS_CLI="$1";;
387 --gnutls-legacy-cli) shift; GNUTLS_LEGACY_CLI="$1";;
388 --gnutls-legacy-serv) shift; GNUTLS_LEGACY_SERV="$1";;
389 --gnutls-serv) shift; GNUTLS_SERV="$1";;
390 --help|-h) usage; exit;;
391 --keep-going|-k) KEEP_GOING=1;;
392 --list-all-components) printf '%s\n' $ALL_COMPONENTS; exit;;
393 --list-components) printf '%s\n' $SUPPORTED_COMPONENTS; exit;;
394 --memory|-m) MEMORY=1;;
395 --no-armcc) no_armcc=1;;
396 --no-force) FORCE=0;;
397 --no-keep-going) KEEP_GOING=0;;
398 --no-memory) MEMORY=0;;
399 --no-quiet) QUIET=0;;
400 --openssl) shift; OPENSSL="$1";;
401 --openssl-legacy) shift; OPENSSL_LEGACY="$1";;
402 --openssl-next) shift; OPENSSL_NEXT="$1";;
403 --out-of-source-dir) shift; OUT_OF_SOURCE_DIR="$1";;
404 --quiet|-q) QUIET=1;;
405 --random-seed) unset SEED;;
406 --release-test|-r) SEED=$RELEASE_SEED;;
407 --seed|-s) shift; SEED="$1";;
408 -*)
410 echo >&2 "Run $0 --help for usage."
419 if [ -z "$COMMAND_LINE_COMPONENTS" ]; then
423 # --no-armcc is a legacy option. The modern way is --except '*_armcc*'.
425 if [ -n "$no_armcc" ] && [ $all_except -eq 1 ]; then
429 # Build the list of components to run.
432 if is_component_included "$component"; [ $? -eq $all_except ]; then
442 if [ $FORCE -eq 1 ]; then
443 rm -rf "$OUT_OF_SOURCE_DIR"
444 git checkout-index -f -q $CONFIG_H
448 if [ -d "$OUT_OF_SOURCE_DIR" ]; then
449 echo "Warning - there is an existing directory at '$OUT_OF_SOURCE_DIR'" >&2
451 echo "the script as: $0 --force --out-of-source-dir $OUT_OF_SOURCE_DIR"
455 if ! git diff --quiet include/mbedtls/config.h; then
456 err_msg "Warning - the configuration file 'include/mbedtls/config.h' has been edited. "
458 echo "script as: $0 --force"
469 if [ -t 1 ]; then
470 case "${TERM:-}" in
482 text="$current_section: $* -> $last_status"
492 if [ $build_status -eq 0 ]; then
495 echo "(skipped because the build failed)"
505 if [ $failure_count -gt 0 ]; then
511 elif [ -z "${1-}" ]; then
514 if [ -n "${1-}" ]; then
521 if [ $build_status -eq 0 ]; then
533 if [ $QUIET -ne 1 ]; then
545 if [ $QUIET -eq 1 ]; then
552 echo "SEED: ${SEED-"UNSET"}"
566 # Build the list of variables to pass to output_env.sh.
575 # and ssl-opt.sh, we just export the variables they require.
579 # Avoid passing --seed flag in every call to ssl-opt.sh
580 if [ -n "${SEED-}" ]; then
602 *_mingw[_\ ]*) check_tools "i686-w64-mingw32-gcc";;
622 if [ $QUIET -eq 1 ]; then
647 # time, so start with a GCC build).
659 record_status tests/scripts/check-generated-files.sh
664 record_status tests/scripts/check-doxy-blocks.pl
669 record_status tests/scripts/check_files.py
674 rm -f ChangeLog.new
675 record_status scripts/assemble_changelog.py -o ChangeLog.new
676 if [ -e ChangeLog.new ]; then
678 # non-empty.
679 diff -u ChangeLog ChangeLog.new || true
685 msg "test/build: declared and exported names" # < 3s
686 record_status tests/scripts/check-names.sh -v
697 #### Build and test many configurations and targets
704 msg "build: cmake + MBEDTLS_MPI_MAX_SIZE=${SMALL_MPI_MAX_SIZE}, gcc, ASan" # ~ 1 min 50s
706 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
710 SIGNATURE_FILE="${INEVITABLY_PRESENT_FILE}.sig" # Warning, this is rm -f'ed below
712 …msg "test: pk_sign secp521r1_prv.der for MBEDTLS_MPI_MAX_SIZE=${SMALL_MPI_MAX_SIZE} (ASan build)" …
714 rm -f $SIGNATURE_FILE
718 msg "build: make, default config (out-of-box)" # ~1min
721 msg "test: main suites make, default config (out-of-box)" # ~10s
724 msg "selftest: make, default config (out-of-box)" # ~10s
729 msg "build: cmake, gcc, ASan" # ~ 1 min 50s
730 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
733 msg "test: main suites (inc. selftests) (ASan build)" # ~ 50s
736 msg "test: selftest (ASan build)" # ~ 10s
739 msg "test: ssl-opt.sh (ASan build)" # ~ 1 min
740 if_build_succeeded tests/ssl-opt.sh
742 msg "test: compat.sh (ASan build)" # ~ 6 min
747 msg "build: full config, cmake, gcc, ASan"
749 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
752 msg "test: main suites (inc. selftests) (full config, ASan build)"
755 msg "test: selftest (ASan build)" # ~ 10s
758 msg "test: ssl-opt.sh (full config, ASan build)"
759 if_build_succeeded tests/ssl-opt.sh
761 msg "test: compat.sh (full config, ASan build)"
766 msg "build: zlib enabled, make"
768 make ZLIB=1 CFLAGS='-Werror -O1'
773 msg "test: ssl-opt.sh (zlib, make)"
774 if_build_succeeded tests/ssl-opt.sh
782 gcc -o ${base}.exe ${base}.c -lz 2>/dev/null
784 rm -f ${base}.*
789 msg "build: zlib enabled, cmake"
791 cmake -D ENABLE_ZLIB_SUPPORT=On -D CMAKE_BUILD_TYPE:String=Check .
797 msg "test: ssl-opt.sh (zlib, cmake)"
798 if_build_succeeded tests/ssl-opt.sh
805 msg "test/build: ref-configs (ASan build)" # ~ 6 min 20s
806 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
807 record_status tests/scripts/test-ref-configs.pl
811 msg "build: Default + SSLv3 (ASan build)" # ~ 6 min
813 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
816 msg "test: SSLv3 - main suites (inc. selftests) (ASan build)" # ~ 50s
819 msg "build: SSLv3 - compat.sh (ASan build)" # ~ 6 min
820 if_build_succeeded tests/compat.sh -m 'tls1 tls1_1 tls1_2 dtls1 dtls1_2'
821 if_build_succeeded env OPENSSL_CMD="$OPENSSL_LEGACY" tests/compat.sh -m 'ssl3'
823 msg "build: SSLv3 - ssl-opt.sh (ASan build)" # ~ 6 min
824 if_build_succeeded tests/ssl-opt.sh
828 msg "build: Default + !MBEDTLS_SSL_RENEGOTIATION (ASan build)" # ~ 6 min
830 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
833 msg "test: !MBEDTLS_SSL_RENEGOTIATION - main suites (inc. selftests) (ASan build)" # ~ 50s
836 msg "test: !MBEDTLS_SSL_RENEGOTIATION - ssl-opt.sh (ASan build)" # ~ 6 min
837 if_build_succeeded tests/ssl-opt.sh
841 msg "build: Default + !MBEDTLS_PEM_PARSE_C + !MBEDTLS_FS_IO (ASan build)"
844 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
847 …msg "test: !MBEDTLS_PEM_PARSE_C !MBEDTLS_FS_IO - main suites (inc. selftests) (ASan build)" # ~ 50s
850 msg "test: !MBEDTLS_PEM_PARSE_C !MBEDTLS_FS_IO - ssl-opt.sh (ASan build)" # ~ 6 min
851 if_build_succeeded tests/ssl-opt.sh
855 msg "build: Default + RSA_NO_CRT (ASan build)" # ~ 6 min
857 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
860 msg "test: RSA_NO_CRT - main suites (inc. selftests) (ASan build)" # ~ 50s
863 msg "test: RSA_NO_CRT - RSA-related part of ssl-opt.sh (ASan build)" # ~ 5s
864 if_build_succeeded tests/ssl-opt.sh -f RSA
866 msg "test: RSA_NO_CRT - RSA-related part of compat.sh (ASan build)" # ~ 3 min
867 if_build_succeeded tests/compat.sh -t RSA
871 msg "build: Full minus CTR_DRBG"
875 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
881 # no ssl-opt.sh/compat.sh as they all depend on CTR_DRBG so far
885 msg "build: Full minus HMAC_DRBG"
890 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
893 msg "test: Full minus HMAC_DRBG - main suites"
899 # Test SSL with non-deterministic ECDSA. Only test features that
901 msg "test: Full minus HMAC_DRBG - ssl-opt.sh (subset)"
902 if_build_succeeded tests/ssl-opt.sh -f 'Default\|SSL async private: sign'
906 msg "test: Full minus HMAC_DRBG - compat.sh (ECDSA)"
907 if_build_succeeded tests/compat.sh -m tls1_2 -t 'ECDSA'
911 # this tests the internal ECP DRBG using a KDF based on SHA-512
912 msg "build: Default minus DRBGs"
919 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
929 # this tests the internal ECP DRBG using a KDF based on SHA-256
930 msg "build: Default minus DRBGs minus SHA-512"
938 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
941 msg "test: Default minus DRBGs minus SHA-512"
948 msg "build: Default plus ECP_NO_INTERNAL_RNG minus DRBG modules"
956 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
966 msg "build: Default plus ECP_RESTARTABLE and ECP_NO_INTERNAL_RNG, no DRBG"
975 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
985 msg "build: small SSL_OUT_CONTENT_LEN (ASan build)"
988 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
991 msg "test: small SSL_OUT_CONTENT_LEN - ssl-opt.sh MFL and large packet tests"
992 if_build_succeeded tests/ssl-opt.sh -f "Max fragment\|Large packet"
996 msg "build: small SSL_IN_CONTENT_LEN (ASan build)"
999 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1002 msg "test: small SSL_IN_CONTENT_LEN - ssl-opt.sh MFL tests"
1003 if_build_succeeded tests/ssl-opt.sh -f "Max fragment"
1007 msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0"
1009 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1012 msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #0 - ssl-opt.sh specific reordering test"
1013 …if_build_succeeded tests/ssl-opt.sh -f "DTLS reordering: Buffer out-of-order hs msg before reassem…
1017 msg "build: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1"
1019 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1022 msg "test: small MBEDTLS_SSL_DTLS_MAX_BUFFERING #1 - ssl-opt.sh specific reordering test"
1023 …if_build_succeeded tests/ssl-opt.sh -f "DTLS reordering: Buffer encrypted Finished message, drop f…
1027 msg "build: cmake, full config, clang" # ~ 50s
1029 CC=clang cmake -D CMAKE_BUILD_TYPE:String=Check -D ENABLE_TESTING=On .
1035 msg "test: ssl-opt.sh default, ECJPAKE, SSL async (full config)" # ~ 1s
1036 if_build_succeeded tests/ssl-opt.sh -f 'Default\|ECJPAKE\|SSL async private'
1039 …="$GNUTLS_LEGACY_CLI" GNUTLS_SERV="$GNUTLS_LEGACY_SERV" tests/compat.sh -e '^$' -f 'NULL\|DES\|RC4…
1042 if_build_succeeded env OPENSSL_CMD="$OPENSSL_NEXT" tests/compat.sh -e '^$' -f 'ARIA\|CHACHA'
1048 # - unset MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN - does the failure persist?
1049 # - or alternatively, change the build type to MemSanDbg, which enables
1052 msg "build: cmake MSan (clang), full config with constant flow testing"
1056 CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
1065 # (heap buffer overflows, use of uninitialized memory, use-after-free,
1069 # - unset MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND - does the failure persist?
1070 # - or alternatively, build with debug info and manually run the offending
1071 # test suite with valgrind --track-origins=yes, then check if the origin
1073 msg "build: cmake release GCC, full config with constant flow testing"
1076 cmake -D CMAKE_BUILD_TYPE:String=Release .
1088 msg "build: make, default + MBEDTLS_DEPRECATED_REMOVED" # ~ 30s
1090 make CC=gcc CFLAGS='-O -Werror -Wall -Wextra'
1100 msg "build: make, full + MBEDTLS_DEPRECATED_WARNING" # ~ 30s
1106 make CC=gcc CFLAGS='-O -Werror -Wall -Wextra'
1113 msg "test/build: curves.pl (gcc)" # ~ 4 min
1118 msg "test/build: depends-hashes.pl (gcc)" # ~ 2 min
1119 record_status tests/scripts/depends-hashes.pl
1123 msg "test/build: depends-pkalgs.pl (gcc)" # ~ 2 min
1124 record_status tests/scripts/depends-pkalgs.pl
1128 msg "test/build: key-exchanges (gcc)" # ~ 1 min
1129 record_status tests/scripts/key-exchanges.pl
1133 msg "build: Unix make, -Os (gcc)" # ~ 30s
1134 make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os'
1139 msg "build: Unix make, incremental g++"
1144 msg "build+test: MBEDTLS_CHECK_PARAMS functionality"
1148 # Only build and run tests. Do not build sample programs, because
1150 make CC=gcc CFLAGS='-Werror -O1' lib test
1154 msg "build+test: MBEDTLS_CHECK_PARAMS without MBEDTLS_PLATFORM_C"
1166 make CC=gcc CFLAGS='-Werror -O1' all test
1170 msg "build+test: MBEDTLS_CHECK_PARAMS with alternative MBEDTLS_PARAM_FAILED()"
1173 sed -i 's/.*\(#define MBEDTLS_PARAM_FAILED( cond )\).*/\1/' "$CONFIG_H"
1174 make CC=gcc CFLAGS='-Werror -O1' all test
1178 # Full configuration build, without platform support, file IO and net sockets.
1181 msg "build: full config except platform/fsio/net, make, gcc, C99" # ~ 30s
1195 # to re-enable platform integration features otherwise disabled in C99 builds
1196 make CC=gcc CFLAGS='-Werror -Wall -Wextra -std=c99 -pedantic -Os -D_DEFAULT_SOURCE' lib programs
1197 make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os' test
1202 msg "build: full config with NO_STD_FUNCTION, make, gcc" # ~ 30s
1207 make CC=gcc CFLAGS='-Werror -Wall -Wextra -Os'
1211 msg "build: full config except ssl_srv.c, make, gcc" # ~ 30s
1214 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1'
1218 msg "build: full config except ssl_cli.c, make, gcc" # ~ 30s
1221 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1'
1227 msg "build: full config except net_sockets.c, make, gcc -std=c99 -pedantic" # ~ 30s
1231 make CC=gcc CFLAGS='-Werror -Wall -Wextra -O1 -std=c99 -pedantic' lib
1235 msg "build: default config with memory buffer allocator and backtrace enabled"
1248 msg "build: default config with memory buffer allocator"
1257 msg "test: ssl-opt.sh, MBEDTLS_MEMORY_BUFFER_ALLOC_C"
1259 if_build_succeeded tests/ssl-opt.sh -e '^DTLS proxy'
1264 msg "build: default config except MFL extension (ASan build)" # ~ 30s
1266 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1269 msg "test: ssl-opt.sh, MFL-related tests"
1270 if_build_succeeded tests/ssl-opt.sh -f "Max fragment length"
1274 msg "build: no MFL extension, small SSL_OUT_CONTENT_LEN (ASan build)"
1278 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1282 if_build_succeeded tests/ssl-opt.sh -f "Max fragment length\|Large buffer"
1286 msg "build: default config with MBEDTLS_TEST_NULL_ENTROPY (ASan build)"
1294 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan -D UNSAFE_BUILD=ON .
1297 msg "test: MBEDTLS_TEST_NULL_ENTROPY - main suites (inc. selftests) (ASan build)"
1302 msg "build: default config without MBEDTLS_HAVE_TIME_DATE"
1307 msg "test: !MBEDTLS_HAVE_TIME_DATE - main suites"
1312 msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
1316 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1319 msg "test: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
1324 msg "build: malloc(0) returns NULL (ASan+UBSan build)"
1327 …make CC=gcc CFLAGS="'-DMBEDTLS_CONFIG_FILE=\"$PWD/tests/configs/config-wrapper-malloc-0-null.h\"' …
1329 msg "test: malloc(0) returns NULL (ASan+UBSan build)"
1332 msg "selftest: malloc(0) returns NULL (ASan+UBSan build)"
1339 msg "build: default config with AES_FEWER_TABLES enabled"
1341 make CC=gcc CFLAGS='-Werror -Wall -Wextra'
1348 msg "build: default config with AES_ROM_TABLES enabled"
1350 make CC=gcc CFLAGS='-Werror -Wall -Wextra'
1357 msg "build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled"
1360 make CC=gcc CFLAGS='-Werror -Wall -Wextra'
1367 msg "build/test: make shared" # ~ 40s
1373 msg "build/test: cmake shared" # ~ 2min
1374 cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On .
1383 msg "build/test: $cc $opt, $info" # ~ 30s
1384 make CC="$cc" CFLAGS="$opt -std=c99 -pedantic -Wall -Wextra -Werror"
1387 # optimizations use inline assembly whereas runs with -O0
1396 test_build_opt 'full config' clang -O0 -Os -O2
1401 test_build_opt 'full config' gcc -O0 -Os -O2
1405 msg "build: make with MBEDTLS_CONFIG_FILE" # ~40s
1411 make CFLAGS="-I '$PWD' -DMBEDTLS_CONFIG_FILE='\"full_config.h\"'"
1412 rm -f full_config.h
1416 # Build once with -O0, to compile out the i386 specific inline assembly
1417 msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s
1419 make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O0" LDFLAGS="-m32 $ASAN_CFLAGS"
1421 msg "test: i386, make, gcc -O0 (ASan build)"
1425 case $(uname -m) in
1432 # Build again with -O1, to compile in the i386 specific inline assembly
1433 msg "build: i386, make, gcc -O1 (ASan build)" # ~ 30s
1435 make CC=gcc CFLAGS="$ASAN_CFLAGS -m32 -O1" LDFLAGS="-m32 $ASAN_CFLAGS"
1437 msg "test: i386, make, gcc -O1 (ASan build)"
1440 msg "test ssl-opt.sh, i386, make, gcc-O1"
1441 if_build_succeeded tests/ssl-opt.sh
1448 msg "build: 64-bit ILP32, make, gcc" # ~ 30s
1450 make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' LDFLAGS='-mx32'
1452 msg "test: 64-bit ILP32, make, gcc"
1456 case $(uname -m) in
1463 msg "build: Default + MBEDTLS_MPI_WINDOW_SIZE=1 (ASan build)" # ~ 10s
1465 CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
1468 msg "test: MBEDTLS_MPI_WINDOW_SIZE=1 - main suites (inc. selftests) (ASan build)" # ~ 10s
1473 msg "build: gcc, force 32-bit bignum limbs"
1477 make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT32'
1479 msg "test: gcc, force 32-bit bignum limbs"
1484 msg "build: gcc, force 64-bit bignum limbs"
1488 make CC=gcc CFLAGS='-Werror -Wall -Wextra -DMBEDTLS_HAVE_INT64'
1490 msg "test: gcc, force 64-bit bignum limbs"
1495 msg "build: MBEDTLS_NO_UDBL_DIVISION native" # ~ 10s
1498 make CFLAGS='-Werror -O1'
1505 msg "build: MBEDTLS_NO_64BIT_MULTIPLICATION native" # ~ 10s
1508 make CFLAGS='-Werror -O1'
1515 msg "build: no strings" # ~10s
1522 make CFLAGS='-Werror -Os'
1529 msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -O1" # ~ 10s
1531 …_NONE_EABI_GCC_PREFIX}ar" LD="${ARM_NONE_EABI_GCC_PREFIX}ld" CFLAGS='-Werror -Wall -Wextra -O1' lib
1533 msg "size: ${ARM_NONE_EABI_GCC_PREFIX}gcc -O1"
1538 msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -march=arm5vte" # ~ 10s
1540 # Build for a target platform that's close to what Debian uses
1543 # It would be better to build with arm-linux-gnueabi-gcc but
1545 …ARM_NONE_EABI_GCC_PREFIX}ar" CFLAGS='-Werror -Wall -Wextra -march=armv5te -O1' LDFLAGS='-march=arm…
1547 msg "size: ${ARM_NONE_EABI_GCC_PREFIX}gcc -march=armv5te -O1"
1552 msg "build: ${ARM_NONE_EABI_GCC_PREFIX}gcc -mthumb -mcpu=cortex-m0plus" # ~ 10s
1554 …FIX}ar" LD="${ARM_NONE_EABI_GCC_PREFIX}ld" CFLAGS='-Werror -Wall -Wextra -mthumb -mcpu=cortex-m0pl…
1556 msg "size: ${ARM_NONE_EABI_GCC_PREFIX}gcc -mthumb -mcpu=cortex-m0plus -Os"
1561 msg "build: ${ARM_NONE_EABI_GCC_PREFIX} -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
1564 …{ARM_NONE_EABI_GCC_PREFIX}ar" LD="${ARM_NONE_EABI_GCC_PREFIX}ld" CFLAGS='-Werror -Wall -Wextra' lib
1565 echo "Checking that software 64-bit division is not required"
1570 msg "build: ${ARM_NONE_EABI_GCC_PREFIX} MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
1573 …ABI_GCC_PREFIX}ar" LD="${ARM_NONE_EABI_GCC_PREFIX}ld" CFLAGS='-Werror -O1 -march=armv6-m -mthumb' …
1574 echo "Checking that software 64-bit multiplication is not required"
1579 msg "build: ARM Compiler 5"
1581 make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
1584 "$ARMC5_FROMELF" -z library/*.o
1588 # ARM Compiler 6 - Target ARMv7-A
1589 armc6_build_test "--target=arm-arm-none-eabi -march=armv7-a"
1591 # ARM Compiler 6 - Target ARMv7-M
1592 armc6_build_test "--target=arm-arm-none-eabi -march=armv7-m"
1594 # ARM Compiler 6 - Target ARMv8-A - AArch32
1595 armc6_build_test "--target=arm-arm-none-eabi -march=armv8.2-a"
1597 # ARM Compiler 6 - Target ARMv8-M
1598 armc6_build_test "--target=arm-arm-none-eabi -march=armv8-m.main"
1600 # ARM Compiler 6 - Target ARMv8-A - AArch64
1601 armc6_build_test "--target=aarch64-arm-none-eabi -march=armv8.2-a"
1605 msg "build: default config with MBEDTLS_SSL_HW_RECORD_ACCEL enabled"
1607 make CFLAGS='-Werror -O1'
1611 msg "build: allow SHA1 in certificates by default"
1613 make CFLAGS='-Werror -Wall -Wextra'
1616 if_build_succeeded tests/ssl-opt.sh -f SHA-1
1620 msg "build: Windows cross build - mingw64, make (Link Library)" # ~ 30s
1621 …make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall …
1624 …make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror' WINDO…
1627 msg "build: Windows cross build - mingw64, make (DLL)" # ~ 30s
1628 …make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall …
1629 …make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar LD=i686-w64-minggw32-ld CFLAGS='-Werror -Wall …
1634 msg "build: MSan (clang)" # ~ 1 min 20s
1636 CC=clang cmake -D CMAKE_BUILD_TYPE:String=MemSan .
1642 msg "test: ssl-opt.sh (MSan)" # ~ 1 min
1643 if_build_succeeded tests/ssl-opt.sh
1647 if [ "$MEMORY" -gt 0 ]; then
1654 msg "build: Release (clang)"
1655 CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release .
1663 if [ "$MEMORY" -gt 0 ]; then
1664 msg "test: ssl-opt.sh --memcheck (Release)"
1665 if_build_succeeded tests/ssl-opt.sh --memcheck
1668 if [ "$MEMORY" -gt 1 ]; then
1669 msg "test: compat.sh --memcheck (Release)"
1670 if_build_succeeded tests/compat.sh --memcheck
1675 msg "build: cmake 'out-of-source' build"
1682 msg "test: cmake 'out-of-source' build"
1687 # file is missing (ssl-opt.sh tolerates the absence of some files so
1689 if_build_succeeded ./tests/ssl-opt.sh -f 'Fallback SCSV: beginning of list' 2>ssl-opt.err
1690 if [ -s ssl-opt.err ]; then
1691 cat ssl-opt.err >&2
1692 record_status [ ! -s ssl-opt.err ]
1693 rm ssl-opt.err
1696 rm -rf "$OUT_OF_SOURCE_DIR"
1711 if [ -z "$(gdb -batch -nw -ex 'set disable-randomization off' 2>&1)" ]; then
1712 gdb_disable_aslr='set disable-randomization off'
1715 for optimization_flag in -O2 -O3 -Ofast -Os; do
1719 …if_build_succeeded gdb -ex "$gdb_disable_aslr" -x tests/scripts/test_zeroize.gdb -nw -batch -nx 2>…
1721 if_build_succeeded not grep -i "error" test_zeroize.log
1722 rm -f test_zeroize.log
1731 msg "Lint: Python scripts"
1732 record_status tests/scripts/check-python-files.sh
1736 msg "uint test: generate_test_code.py"
1739 # harmless info on stdout so it can be suppress with --quiet.
1740 record_status ./tests/scripts/test_generate_test_code.py 2>&1
1764 cp -p "$CONFIG_H" "$CONFIG_BAK"
1768 if [ $QUIET -eq 1 ]; then
1774 # Restore the build tree to a clean state.
1786 if [ $KEEP_GOING -eq 1 ]; then