LibTest: Prevent -dead_strip from removing assertion handler
The ak_assertion_handler symbol is referenced only through a weak symbol in AK/Assertions.cpp. With -dead_strip on macOS, the linker strips the strong definition, breaking EXPECT_DEATH tests which rely on the handler to longjmp back instead of crashing. Add retain and used attributes to prevent the linker from removing it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
972bcdeebe
commit
29355a0e33
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ static void assertion_handler_impl(char const*)
|
|||
#if defined(AK_OS_WINDOWS)
|
||||
# define EXPORT __declspec(dllexport)
|
||||
#else
|
||||
# define EXPORT __attribute__((visibility("default")))
|
||||
# define EXPORT __attribute__((visibility("default"), retain, used))
|
||||
#endif
|
||||
|
||||
extern "C" EXPORT void ak_assertion_handler(char const* message);
|
||||
|
|
|
|||
Loading…
Reference in a new issue