ASan: use dynamic lookup when building dynamic ASan runtime on Mac, because shadow...
authorAlexey Samsonov <samsonov@google.com>
Mon, 21 Jan 2013 09:07:01 +0000 (09:07 +0000)
committerAlexey Samsonov <samsonov@google.com>
Mon, 21 Jan 2013 09:07:01 +0000 (09:07 +0000)
llvm-svn: 173015

compiler-rt/lib/asan/CMakeLists.txt

index 020a527..30ad5b8 100644 (file)
@@ -99,7 +99,10 @@ if(APPLE)
             $<TARGET_OBJECTS:RTSanitizerCommon.osx>
     CFLAGS ${ASAN_CFLAGS}
     DEFS ${ASAN_DYLIB_DEFINITIONS}
-    LINKFLAGS "-framework Foundation")
+    # Dynamic lookup is needed because shadow scale and offset are
+    # provided by the instrumented modules.
+    LINKFLAGS "-framework Foundation"
+              "-undefined dynamic_lookup")
   list(APPEND ASAN_DYNAMIC_RUNTIME_LIBRARIES clang_rt.asan_osx_dynamic)
 endif()