[PATCH] D27654: Stop intercepting mallinfo and mallopt on FreeBSD

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 8 09:53:41 PST 2017


dim added inline comments.


================
Comment at: test/asan/TestCases/mallinfo-mallopt.cpp:4
+// RUN: %clang_asan %s -o %t
+// XFAIL: freebsd
+
----------------
joerg wrote:
> dim wrote:
> > kcc wrote:
> > > hm. is freebsd the only platform where this will fail? 
> > > What about other non-linux OSes? 
> > Indeed, probably better to make this test succeed on Linux only.  Is there any way to express `XFAIL: !linux` ?
> My suggestion would be to do conditionalize the main function, i.e.
> 
> ```
> #if __glibc__
>   mallinfo();
>   mallopt();
> #else
>   void non_existant_function(void);
>   non_existant_function();
> #endif
> ```
> 
> and just check for linking error on all platforms.
Actually, the error we're checking for is that mallinfo() and mallopt() are *not* incorrectly intercepted.  So we have to specifically attempt to link these functions in, and see if those don't cause any error, and if they don't, there is a regression.


================
Comment at: test/asan/TestCases/mallinfo-mallopt.cpp:7
+int mallinfo();
+int mallopt();
+
----------------
joerg wrote:
> Can you make those proper protypes?
This is not what autoconf is doing, which was the original inspiration for this change.  Autoconf always uses function declarations without any parameters, and I was mimicking what they are doing.


https://reviews.llvm.org/D27654





More information about the llvm-commits mailing list