[PATCH] D117609: [llvm-jitlink] Prevent dead-stripping of test callback
Ben Langmuir via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 18 14:29:30 PST 2022
benlangmuir created this revision.
benlangmuir added a reviewer: lhames.
benlangmuir requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
`llvm_jitlink_setTestResultOverride` is used via runtime lookup by tests, so make sure it is not dead-stripped from llvm-jitlink in release builds.
Fixes https://github.com/llvm/llvm-project/issues/5320
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D117609
Files:
llvm/tools/llvm-jitlink/llvm-jitlink.cpp
Index: llvm/tools/llvm-jitlink/llvm-jitlink.cpp
===================================================================
--- llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -231,7 +231,8 @@
static bool UseTestResultOverride = false;
static int64_t TestResultOverride = 0;
-extern "C" void llvm_jitlink_setTestResultOverride(int64_t Value) {
+extern "C" LLVM_ATTRIBUTE_USED void
+llvm_jitlink_setTestResultOverride(int64_t Value) {
TestResultOverride = Value;
UseTestResultOverride = true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117609.400989.patch
Type: text/x-patch
Size: 538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220118/d9adc551/attachment.bin>
More information about the llvm-commits
mailing list