[PATCH] D40766: Handle NetBSD symbol renaming in msan_interceptors.cc

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 2 05:33:15 PST 2017


krytarowski created this revision.
krytarowski added a project: Sanitizers.

NetBSD renames symbols for historical and compat reasons.

Add required symbol renames in sanitizer_common_interceptors.inc:

- gettimeofday -> __gettimeofday50
- getrusage -> __getrusage50
- shmctl -> __shmctl50

Additionally handle sigaction symbol mangling.
Rename the function symbol in the file to sigaction_symname and define
it as __sigaction14 for NetBSD and sigaction for !NetBSD. We cannot use
simple renaming with the proprocessor, as there are valid fields named
sigaction and they must be left intact.

Sponsored by <The NetBSD Foundation>


Repository:
  rL LLVM

https://reviews.llvm.org/D40766

Files:
  lib/msan/msan_interceptors.cc


Index: lib/msan/msan_interceptors.cc
===================================================================
--- lib/msan/msan_interceptors.cc
+++ lib/msan/msan_interceptors.cc
@@ -37,6 +37,18 @@
 // ACHTUNG! No other system header includes in this file.
 // Ideally, we should get rid of stdarg.h as well.
 
+#if SANITIZER_NETBSD
+#define gettimeofday __gettimeofday50
+#define getrusage __getrusage50
+#define shmctl __shmctl50
+#endif
+
+#if SANITIZER_NETBSD
+#define sigaction_symname __sigaction14
+#else
+#define sigaction_symname sigaction
+#endif
+
 using namespace __msan;
 
 using __sanitizer::memory_order;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40766.125262.patch
Type: text/x-patch
Size: 614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171202/eb9a5762/attachment.bin>


More information about the llvm-commits mailing list