[PATCH] D51571: [Xray] Darwin providing defined value for weak symbols to fix linkage issue

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 11:01:15 PDT 2018


devnexen updated this revision to Diff 163869.

https://reviews.llvm.org/D51571

Files:
  lib/xray/xray_init.cc


Index: lib/xray/xray_init.cc
===================================================================
--- lib/xray/xray_init.cc
+++ lib/xray/xray_init.cc
@@ -27,6 +27,15 @@
 extern const XRaySledEntry __stop_xray_instr_map[] __attribute__((weak));
 extern const XRayFunctionSledIndex __start_xray_fn_idx[] __attribute__((weak));
 extern const XRayFunctionSledIndex __stop_xray_fn_idx[] __attribute__((weak));
+
+#if SANITIZER_MAC
+// HACK: This is a temporary workaround to make XRay build on 
+// Darwin, but it will probably not work at runtime.
+const XRaySledEntry __start_xray_instr_map[] = {};
+extern const XRaySledEntry __stop_xray_instr_map[] = {};
+extern const XRayFunctionSledIndex __start_xray_fn_idx[] = {};
+extern const XRayFunctionSledIndex __stop_xray_fn_idx[] = {};
+#endif
 }
 
 using namespace __xray;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51571.163869.patch
Type: text/x-patch
Size: 818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/b4777928/attachment.bin>


More information about the llvm-commits mailing list