[PATCH] Interception macros for sanitizers on FreeBSD

Kostya Serebryany kcc at google.com
Thu Feb 20 10:42:06 PST 2014



================
Comment at: lib/interception/interception.h:145
@@ +144,3 @@
+    extern "C" ret_type func(__VA_ARGS__) \
+    __attribute__((alias("__interceptor_" #func), visibility("default")));
+# else
----------------
Viktor Kutuzov wrote:
> Kostya Serebryany wrote:
> > doesn't "weak" work on FeeBSD? (just curious)
> I just tried it and it does work (thanks for the catch). Since most of the changes were originally prepared by different people for a somewhat old revision, there may be issues like that. I will try my best to handle them on my side.
> 
> Now, given DECLARE_WRAPPER() and GetRealFunctionAddress() are common for Linux and FreeBSD, would it make sense if we not duplicate them in "interception_freebsd.h" and "interception_freebsd.cc"?
If we can have a single file for linux & freebsd interceptors w/o too much #ifdef clatter -- we should do that. 


http://llvm-reviews.chandlerc.com/D2828



More information about the llvm-commits mailing list