Skip to content
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

cmake: fix searching Clang RT #9

Merged
merged 9 commits into from
Jul 10, 2024
Merged

cmake: fix searching Clang RT #9

merged 9 commits into from
Jul 10, 2024

Conversation

ligurio
Copy link
Owner

@ligurio ligurio commented Aug 18, 2023

No description provided.

@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 8 times, most recently from ac6a16c to 84eecd9 Compare August 20, 2023 16:33
@ligurio ligurio changed the title Fix searching clang_rt cmake: fix searching Clang RT Aug 20, 2023
@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 5 times, most recently from ad3dd70 to fdb538f Compare August 20, 2023 19:41
@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 2 times, most recently from e788079 to ec04ad7 Compare December 29, 2023 14:48
@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 3 times, most recently from 77cd96f to e33bc5f Compare February 9, 2024 11:26
@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 2 times, most recently from 34efe29 to 62d8fab Compare July 9, 2024 16:05
luzer module requires linking with a library
`clang_rt.fuzzer_no_main-x86_64` that is a part of a Clang runtime.
Without linking with it Lua runtime will report an error right on
loading `luzer.so`:

lua5.1: error loading module 'luzer' from file './luzer.so':
        ./luzer.so: undefined symbol: __sanitizer_cov_8bit_counters_init

The patch adds a module that composes a path to Clang runtime libraries
and adds this path to a library search paths. I suppose in some cases
introduced CMake function may fail. One can pass a path to a directory
with Clang RT manually using environment variable CLANG_RT_LIB_DIR.

In a usual case symbol __sanitizer_cov_8bit_counters_init is added by
compiler on instrumentation when compiler option
-fsanitize-coverage=inline-8bit-counters is specified [1].

1. https://clang.llvm.org/docs/SanitizerCoverage.html
Lua 5.1 has no support of `luaL_traceback` function. Previously,
it was implemented using Lua function `debug.traceback` and this
leads to recursive calls and finished with stack overflow.
The patch backports implementation of `luaL_traceback` from a late
Lua versions.
We cannot use `luaL_error` if Lua state is not initialized.
Enable Lua debug hook right before calling
`TestOneInput` function and disable it right after returning from
`TestOneInput`.
@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 2 times, most recently from 5b7db14 to af0152a Compare July 10, 2024 14:01
@ligurio ligurio force-pushed the ligurio/fix-clang_rt branch 2 times, most recently from 03612dd to 1346334 Compare July 10, 2024 15:06
@ligurio ligurio merged commit fc85bea into master Jul 10, 2024
7 checks passed
@ligurio ligurio deleted the ligurio/fix-clang_rt branch July 10, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant