[PATCH] D144830: [asan darwin] Allow clients to implement `__sanitizer_report_error_summary`

Roy Sundahl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 16:54:07 PST 2023


rsundahl added inline comments.


================
Comment at: compiler-rt/test/asan/TestCases/report_error_summary.cpp:4
+#include <stdio.h>
+
+extern "C" void __sanitizer_report_error_summary(const char *summary) {
----------------
vitalybuka wrote:
> rsundahl wrote:
> > rsundahl wrote:
> > > ```
> > > // Required for dyld macOS 12.0+
> > > #if (__APPLE__)
> > > __attribute__((weak))
> > > #endif
> > > ```
> > > You'll need to add this if you want dyld64 to see this override of __sanitizer_report_error_summary(). dyld64 will not consider and open a dylib during weak def coalescing unless there is at least one weak symbol in it. It doesn't have to be the intended "stronger" symbol, it could be any symbol like "foo", the module just has to have at least one.
> > dyld64 -> ld64
> Something like D145810?
> I don't have MacOS dev setup to test
Yes, that would work but we've landed more on the pattern int https://reviews.llvm.org/D130917 which doesn't add any symbols (we chose not to add any symbols so that if this "trick" was needed by two dylibs, there wouldn't be a name clash but you won't need to worry about that in a test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144830



More information about the llvm-commits mailing list