Skip to content

Conversation

kylo5aby
Copy link
Contributor

Support combining compatible sanitizers,
Usage examples:
cmake -DWAMR_BUILD_SANITIZER=ubsan,posan ../
cmake -DWAMR_BUILD_SANITIZER=ubsan ../

@lum1n0us lum1n0us added the enhancement Check if this issue/PR enhances a feature; scripts will use this info. label Jul 14, 2025
@lum1n0us
Copy link
Collaborator

A list in cmake is a ; separated group of strings.

I'm not entirely sure if we're following the same approach with command line options, but it seems that ";" is more commonly used than "," in the CMake world for representing a list. I mean -DWAMR_BUILD_SANITIZER=ubsan;posan is more natural and preferable than -DWAMR_BUILD_SANITIZER=ubsan,posan.

https://cmake.org/cmake/help/v3.14/command/list.html#introduction

@kylo5aby
Copy link
Contributor Author

A list in cmake is a ; separated group of strings.

I'm not entirely sure if we're following the same approach with command line options, but it seems that ";" is more commonly used than "," in the CMake world for representing a list. I mean -DWAMR_BUILD_SANITIZER=ubsan;posan is more natural and preferable than -DWAMR_BUILD_SANITIZER=ubsan,posan.

https://cmake.org/cmake/help/v3.14/command/list.html#introduction

I think while ";" is cmake's internal list separator, "," provides better user experience as it doesn't require shell escaping or quotes. moreover, comma-delimited parameters align with industry conventions used by compilers like gcc/clang: gcc -fsanitize=address,undefined

@kylo5aby kylo5aby force-pushed the cmake-prefix branch 2 times, most recently from d526d65 to 60a3c1f Compare July 17, 2025 07:12
@kylo5aby kylo5aby force-pushed the cmake-prefix branch 2 times, most recently from 16eb5e1 to be123f2 Compare July 28, 2025 08:41
@TianlongLiang TianlongLiang merged commit e1ba1dd into bytecodealliance:main Aug 4, 2025
453 checks passed
@lum1n0us
Copy link
Collaborator

It appears that it is causing failures in the nightly-run CI. https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/16867922946/job/47777465384

gcc-4.8: error: unrecognized command line option '-fno-sanitize-recover=all'

Perhaps, if (NOT WAMR_BUILD_SANITIZER STREQUAL "") will be TRUE when (NOT DEFINED WAMR_BUILD_SANITIZER)

@kylo5aby
Copy link
Contributor Author

It appears that it is causing failures in the nightly-run CI. https://github.com/bytecodealliance/wasm-micro-runtime/actions/runs/16867922946/job/47777465384

gcc-4.8: error: unrecognized command line option '-fno-sanitize-recover=all'

Perhaps, if (NOT WAMR_BUILD_SANITIZER STREQUAL "") will be TRUE when (NOT DEFINED WAMR_BUILD_SANITIZER)

resolved. thanks. #4553

@kylo5aby kylo5aby deleted the cmake-prefix branch August 12, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Check if this issue/PR enhances a feature; scripts will use this info.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants