[PATCH] [UBSan] Use shared library for UBSan on OS X (compiler-rt part).

Kuba Brecka kuba.brecka at gmail.com
Sun Mar 22 11:18:47 PDT 2015


Hm, reviews.llvm.org <http://reviews.llvm.org/> doesn’t let me update someone else’s patch…  Here’s the link flags change I was thinking about (it however links libc++abi into ASan as well, not sure if that can be a problem or not):

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 232919)
+++ CMakeLists.txt	(working copy)
@@ -304,7 +304,7 @@
   set(DARWIN_iossim_CFLAGS
     -mios-simulator-version-min=7.0 -isysroot ${IOSSIM_SDK_DIR})
   set(DARWIN_osx_LINKFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}
-     -stdlib=libc++)
+     -stdlib=libc++ -lc++abi)
   set(DARWIN_iossim_LINKFLAGS
     -Wl,-ios_simulator_version_min,7.0.0
     -mios-simulator-version-min=7.0

You can then also remove the “XFAIL: darwin” from test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp, because it no longer fails:

Index: test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp
===================================================================
--- test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp	(revision 232919)
+++ test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp	(working copy)
@@ -1,9 +1,6 @@
 // RUN: %clangxx -frtti -fsanitize=vptr -fno-sanitize-recover=vptr -g %s -O3 -o %t
 // RUN: not %run %t 2>&1 | FileCheck %s
 
-// FIXME: This test produces linker errors on Darwin.
-// XFAIL: darwin
-
 struct S { virtual int f() { return 0; } };
 struct T : virtual S {};

After that, build and “make check-ubsan” passes.

Kuba

> On Mar 22, 2015, at 7:04 PM, Alexey Samsonov <vonosmas at gmail.com> wrote:
> Hm, could I ask you to update the patch? :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150322/37709a6e/attachment.html>


More information about the llvm-commits mailing list