-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ubsan checks to WAMR #2147
Add ubsan checks to WAMR #2147
Conversation
LGTM |
endif() | ||
|
||
if (SANITIZER STREQUAL "ubsan") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=alignment" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also need to check for a compiler here, or are we ok with the compiler (sliently) failing if those flags are not supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that you won't set these flags for the wrong compiler on the CI side.
But if you think it's better to add here I'll add
cc39430
to
100d9ae
Compare
@@ -87,6 +87,15 @@ endif() | |||
set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) | |||
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake) | |||
|
|||
if (NOT DEFINED SANITIZER) | |||
set(SANITIZER "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that variable going to be used outside of this if..else block that we set it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks.
This PR adds ubsan checks with no alignment enabled to basic CI tests for samples/wasm-c-api. Co-authored-by: Maksim Litskevich <makslit@amazon.co.uk>
this PR adds ubsan checks with no aligment enabled to basic CI tests.