[PATCH v3 18/30] tools: nolibc: Append extra cflags

Leo Yan posted 30 patches 1 month ago
There is a newer version of this series
[PATCH v3 18/30] tools: nolibc: Append extra cflags
Posted by Leo Yan 1 month ago
Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
the compiler.

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
 tools/include/nolibc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
index 1958dda988954d8a604b28f5feb75ebb67ee2e14..b7f0385ccba14fdaa08aab6192acf0296b47cdbc 100644
--- a/tools/include/nolibc/Makefile
+++ b/tools/include/nolibc/Makefile
@@ -105,7 +105,7 @@ headers_standalone: headers
 	$(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)sysroot
 
 CFLAGS_s390 := -m64
-CFLAGS := $(CFLAGS_$(ARCH))
+CFLAGS := $(CFLAGS_$(ARCH)) $(EXTRA_CFLAGS)
 
 headers_check: headers_standalone
 	$(Q)for header in $(filter-out crt.h std.h,$(all_files)); do \

-- 
2.34.1
Re: [PATCH v3 18/30] tools: nolibc: Append extra cflags
Posted by Thomas Weißschuh 1 month ago
Hi Leo,

On 2026-03-08 16:46:23+0000, Leo Yan wrote:
> Append EXTRA_CFLAGS to CFLAGS so that additional flags can be applied to
> the compiler.
> 
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
>  tools/include/nolibc/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/include/nolibc/Makefile b/tools/include/nolibc/Makefile
> index 1958dda988954d8a604b28f5feb75ebb67ee2e14..b7f0385ccba14fdaa08aab6192acf0296b47cdbc 100644
> --- a/tools/include/nolibc/Makefile
> +++ b/tools/include/nolibc/Makefile
> @@ -105,7 +105,7 @@ headers_standalone: headers
>  	$(Q)$(MAKE) -C $(srctree) headers_install INSTALL_HDR_PATH=$(OUTPUT)sysroot
>  
>  CFLAGS_s390 := -m64
> -CFLAGS := $(CFLAGS_$(ARCH))
> +CFLAGS := $(CFLAGS_$(ARCH)) $(EXTRA_CFLAGS)

I don't think we need additional cflags in tools/include/nolibc.
The only thing this Makefile does is to test-compile some headers.

>  headers_check: headers_standalone
>  	$(Q)for header in $(filter-out crt.h std.h,$(all_files)); do \


Thomas