From 5ee2e6348f0b0cb9b57d449410e7e75d47bc81b1 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 6 Apr 2022 12:24:16 +0900 Subject: [PATCH] Use -fno-builtin for SYMTABOBJ The code generated by tools/mksymtab.sh uses ``` extern void *var; ``` for ~everything. After the recent removal of -fno-builtin, [1] it ends up with warnings: * -Wbuiltin-requires-header for clang * -Wbuiltin-declaration-mismatch for gcc It also generates errors like the following for clang: ``` symtab_apps.c:125:14: error: redefinition of 'strdup' as different kind of symbol extern void *strdup; ``` I couldn't find a way to disable it. (it's err_redefinition_different_kind in clang source) This commit works it around by restoring -fno-builtin when building SYMTABOBJ. [1] https://github.com/apache/incubator-nuttx/pull/5476 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f33a9cffc..e6ddb1633 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ $(SYMTABSRC): $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all) $(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@) $(SYMTABOBJ): %$(OBJEXT): %.c - $(call COMPILE, -fno-lto $<, $@) + $(call COMPILE, -fno-lto -fno-builtin $<, $@) $(BIN): $(SYMTABOBJ) $(call ARCHIVE_ADD, $(call CONVERT_PATH,$(BIN)), $^)