Skip to content

Commit c399a71

Browse files
authored
Merge pull request #113 from daverodgman/mbedtls-tfm-clang
mtest - fall back to clang if armclang unavailable for -S
2 parents 59adea0 + 295e29e commit c399a71

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tools/bin/mtest

+7-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ ASAN_CFLAGS = "-fsanitize=address -fno-common -fsanitize=undefined -fno-saniti
6161
ASAN_LDFLAGS = ASAN_CFLAGS
6262

6363
WARNING_FLAGS = {
64-
"clang": "-Werror -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral -Wshadow -Wasm-operand-widths",
64+
"clang": "-Werror -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral -Wshadow -Wasm-operand-widths -Wunreachable-code",
6565
"gcc" : "-Werror -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral -Wshadow -Wformat-signedness -Wformat-overflow=2 -Wformat-truncation -Wlogical-op"
6666
}
6767
WARNING_FLAGS["arm-none-eabi-gcc"] = WARNING_FLAGS["gcc"]
@@ -764,7 +764,12 @@ Build targets: build the library by default, or files (e.g. aes.o), programs (e.
764764
args.compilers = [ MEMSAN_CC ]
765765

766766
if args.size_tfm:
767-
if not args.compilers: args.compilers = [ SIZE_TFM_COMPILER ]
767+
if not args.compilers:
768+
if shutil.which(SIZE_TFM_COMPILER) is not None:
769+
args.compilers = [ SIZE_TFM_COMPILER ]
770+
else:
771+
print("warning: could not find armclang, falling back to clang")
772+
args.compilers = [ "clang" ]
768773
args.size = True
769774

770775
if not args.compilers:

0 commit comments

Comments
 (0)