[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 10:39:21 PDT 2018


devnexen updated this revision to Diff 163861.

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,19 @@
 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
+// Note: Despite weak symbol attribute
+// regardless it is weak or weak_import
+// , despite passing those symbols from the
+// list, the linkage fails against a code user
+// so here a (temporary) hack to solve this
+// particular issue.
+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.163861.patch
Type: text/x-patch
Size: 941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/dd1b1227/attachment.bin>


More information about the llvm-commits mailing list