From f7b2e5a2794c4aea5b8df4144953dd12ab61d04a Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Mon, 23 Mar 2026 19:09:42 +0100 Subject: [PATCH] Fix stdlib in clang, limit test to a few targets --- .github/workflows/test-build.yml | 24 ++++++++++++++++++++++-- arch.mk | 1 - test-app/Makefile | 5 ++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index bc3b4615..f7e97443 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -31,7 +31,17 @@ jobs: run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: Install Clang - if: inputs.arch == 'arm' || inputs.arch == 'ARM' + if: | + inputs.config-file == './config/examples/stm32c0.config' || + inputs.config-file == './config/examples/stm32c0-rsa2048.config' || + inputs.config-file == './config/examples/stm32h5.config' || + inputs.config-file == './config/examples/stm32h5-dualbank.config' || + inputs.config-file == './config/examples/stm32h7.config' || + inputs.config-file == './config/examples/stm32h7-octospi.config' || + inputs.config-file == './config/examples/stm32u5.config' || + inputs.config-file == './config/examples/stm32u5-wolfcrypt-tz.config' || + inputs.config-file == './config/examples/stm32u5-nonsecure-dualbank.config' || + inputs.config-file == 'config/examples/stm32n567.config' run: | sudo apt-get install -y clang @@ -52,7 +62,17 @@ jobs: make ${{inputs.make-args}} - name: Rebuild wolfboot with Clang - if: inputs.arch == 'arm' || inputs.arch == 'ARM' + if: | + inputs.config-file == './config/examples/stm32c0.config' || + inputs.config-file == './config/examples/stm32c0-rsa2048.config' || + inputs.config-file == './config/examples/stm32h5.config' || + inputs.config-file == './config/examples/stm32h5-dualbank.config' || + inputs.config-file == './config/examples/stm32h7.config' || + inputs.config-file == './config/examples/stm32h7-octospi.config' || + inputs.config-file == './config/examples/stm32u5.config' || + inputs.config-file == './config/examples/stm32u5-wolfcrypt-tz.config' || + inputs.config-file == './config/examples/stm32u5-nonsecure-dualbank.config' || + inputs.config-file == 'config/examples/stm32n567.config' run: | make distclean cp ${{inputs.config-file}} .config diff --git a/arch.mk b/arch.mk index e90c06f9..75603949 100644 --- a/arch.mk +++ b/arch.mk @@ -1300,7 +1300,6 @@ ifeq ($(USE_CLANG),1) CFLAGS+=-DWOLFSSL_NO_ATOMIC -DWOLFSSL_NO_ATOMICS CFLAGS+=-Wno-unknown-attributes -Wno-error=unknown-attributes CFLAGS+=-fno-unwind-tables -fno-asynchronous-unwind-tables - LDFLAGS+=-nostdlib LSCRIPT_FLAGS+=-T hal/clang-discard.ld endif diff --git a/test-app/Makefile b/test-app/Makefile index 11a8900d..bbefb6ce 100644 --- a/test-app/Makefile +++ b/test-app/Makefile @@ -305,7 +305,10 @@ ifeq ($(TZEN),1) WOLFCRYPT_APP_OBJS+=$(WOLFBOOT_LIB_WOLFSSL)/wolfcrypt/src/random.o endif endif - CFLAGS+=-DWOLFBOOT_SECURE_CALLS -Wstack-usage=19184 + CFLAGS+=-DWOLFBOOT_SECURE_CALLS + ifneq ($(USE_CLANG),1) + CFLAGS+=-Wstack-usage=19184 + endif LDFLAGS+=--specs=nosys.specs -u _printf_float endif ifeq ($(WOLFCRYPT_TZ_PSA),1)