-
Notifications
You must be signed in to change notification settings - Fork 35
link with Clang static fuzzer lib if UMF_BUILD_FUZZTESTS is set #1284
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
base: main
Are you sure you want to change the base?
Conversation
b5152e7
to
d31509a
Compare
661b67d
to
9a038b3
Compare
0d8eccc
to
97d5697
Compare
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * *' | ||
push: |
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.
pls revert
FUZZER_NO_MAIN_LIB | ||
NAMES libclang_rt.fuzzer_no_main-x86_64.a | ||
PATHS | ||
"/usr/lib/llvm-${CMAKE_C_COMPILER_MAJOR_VERSION}/lib/clang/${CMAKE_C_COMPILER_MAJOR_VERSION}/lib/linux/" |
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.
could we use CMAKE_PREFIX_PATH or some custom var to include here - then in case of error we could print a msg like - "use <var> to set up the path for the clang libs..."
I can imagine that this hardcoded "/usr/lib/llvm-${CMAKE_C_COMPILER_MAJOR_VERSION}/lib..." path will not work on some distros...
# Fuzzer instrumentation for the whole library | ||
if(UMF_BUILD_FUZZTESTS | ||
AND CMAKE_CXX_COMPILER_ID MATCHES "Clang" | ||
AND LINUX) | ||
add_compile_options("-fsanitize=fuzzer-no-link") | ||
add_link_options("-fsanitize=fuzzer-no-link") | ||
|
||
# We need to find the fuzzer lib in the LLVM installation dir and link it | ||
# statically |
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.
and why...?
Link with the Clang static fuzzer library, libclang_rt.fuzzer_no_main-x86_64, if UMF_BUILD_FUZZTESTS is set.
Additionally, run extra tests in the nightly workflow that would fail without this change.
Successful run: https://github.com/oneapi-src/unified-memory-framework/actions/runs/14616987712/job/41010729530?pr=1284
Fixes: #590