[PATCH] D28596: [compiler-rt] General definition for weak functions.

Dmitry Vyukov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 00:31:47 PDT 2019


dvyukov added a comment.

Turns out this broke an important part of our internal integration because __sanitizer::OnPrint become OnPrint, so existing hook stopped working. We are clearly missing some tests.
But exporting and calling a global extern "C" OnPrint does not look OK. All functions need to be either extern "C" and __sanitizer_ prefixed, or in __sanitizer:: namespace.

Now if you build:

#include <stdio.h>
void OnPrint() { printf("OnPrint\n"); }
int main() {}

It crashes with:

$ TSAN_OPTIONS=verbosity=1 ./a.out

103485==Installed the sigaction for signal 11
---------------------------------------------

ThreadSanitizer:DEADLYSIGNAL
ThreadSanitizer:DEADLYSIGNAL
ThreadSanitizer: nested bug in the same thread, aborting.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D28596/new/

https://reviews.llvm.org/D28596





More information about the llvm-commits mailing list