mm/kasan: Fix compile options applied to wrong target in SPLIT build#19043
Merged
Conversation
Contributor
|
Can you please explain more about how you tested this change? It seems fine but I'm not understanding what was broken before? |
Contributor
Author
|
I have updated the testing detail and another 2 necessary commits in this pr. |
In SPLIT build mode, nuttx_add_kernel_library(mm SPLIT) creates two targets: mm (system library) and kmm (kernel library). The compile options were being applied to the mm target via target_compile_options(mm ...), but the kasan instrumentation is compiled as part of the kmm target. Change target_compile_options(mm ...) to target_compile_options(kmm ...) so that FLAGS (including -fno-builtin and NO_LTO) are correctly applied to the kernel target where kasan code is compiled. Signed-off-by: leisiji <2265215145@qq.com>
nuttx_apps_mksymtab is nonexistent in nuttx, which produce error when build with CONFIG_MODULES Signed-off-by: leisiji <2265215145@qq.com>
__start is the kernel boot entry for each chip, while _start (defined in crt0.c) is the correct C runtime entry point for ELF executables. Signed-off-by: leisiji <2265215145@qq.com>
1 task
1 task
anjiahao1
approved these changes
Jun 8, 2026
jerpelea
approved these changes
Jun 8, 2026
xiaoxiang781216
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Impact
Testing
Testing logs before change:
CMake Error at mm/kasan/CMakeLists.txt:37 (target_compile_options):
Cannot specify compile options for target "kmm" which is not built by this project.
Testing logs after change:
Build succeeds for sim and qemu-armv7a configurations.
Testing Details:
build config:
build and run:
If built with cmake and kasan hook itself, it cannot launch into nsh