casaroli commented on code in PR #21359:
URL: https://github.com/apache/nuttx/pull/21359#discussion_r4448852787
##########
arch/arm/src/Makefile:
##########
@@ -221,11 +221,11 @@ endif
define LINK_ALLSYMS_KASAN
$(if $(CONFIG_ALLSYMS),
$(Q) $(TOPDIR)/tools/mkallsyms.py $(NUTTX) allsyms.tmp --orderbyname
$(CONFIG_SYMTAB_ORDEREDBYNAME)
- $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c)
+ $(Q) $(call COMPILE, allsyms.tmp, allsyms$(OBJEXT), -x c
-fno-sanitize=kernel-address)
Review Comment:
arch/xtensa/src/Makefile:171 and arch/tricore/src/Makefile:154 also compile
allsyms.tmp, and both arches support KASAN.
Fix: add `-fno-sanitize=kernel-address` there too.
##########
cmake/nuttx_multiple_link.cmake:
##########
@@ -35,6 +35,8 @@ if(CONFIG_ALLSYMS)
set(ALLSYMS_INCDIR ${NUTTX_DIR}/include ${NUTTX_BINARY_DIR}/include)
set_source_files_properties(${ALLSYMS_SOURCE} PROPERTIES INCLUDE_DIRECTORIES
"${ALLSYMS_INCDIR}")
+ set_source_files_properties(
+ ${ALLSYMS_SOURCE} PROPERTIES COMPILE_OPTIONS -fno-sanitize=kernel-address)
Review Comment:
`ALLSYMS_SOURCE` and `KASAN_GLOBAL_SOURCE` are the empty first-pass files.
The final image links allsyms_${linktimes}.c and kasan_global_${linktimes}.c,
which still get `-fsanitize=kernel-address`.
Fix: set the same COMPILE_OPTIONS on `${LINK_ALLSYMS_SOURCE}` and
`${LINK_KASAN_GLOBAL_SOURCE}` in `define_multiple_link_target()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]