[MacPorts] #57152: clang: asan does not work
MacPorts
noreply at macports.org
Sat Oct 6 19:07:53 UTC 2018
#57152: clang: asan does not work
----------------------------------------------+----------------------
Reporter: akimd | Owner: jeremyhu
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.5.3
Resolution: | Keywords:
Port: clang-devel clang-6.0 clang-7.0 |
----------------------------------------------+----------------------
Comment (by kencu):
We have adjusted the rpaths for an issue like this before. Clearly still
needs some tweaking. Thanks.
It's looking here:
{{{
/opt/local/libexec/llvm-7.0/lib/libclang_rt.asan_osx_dynamic.dylib
}}}
But the library is really here:
{{{
/opt/local/libexec/llvm-7.0/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
}}}
Here's full output from the build/link line:
{{{
$ clang++ -v -Wl,"-v" -fsanitize=address foo.cc
clang version 7.0.0 (tags/RELEASE_700/final)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-7.0/bin
"/opt/local/libexec/llvm-7.0/bin/clang" -cc1 -triple x86_64-apple-
macosx10.14.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-
usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-
value-names -main-file-name foo.cc -mrelocation-model pic -pic-level 2
-mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables
-target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-
linker-version 409.12 -v -resource-dir
/opt/local/libexec/llvm-7.0/lib/clang/7.0.0 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-I/usr/local/include -stdlib=libc++ -fdeprecated-macro -fdebug-
compilation-dir /Users/cunningh -ferror-limit 19 -fmessage-length 185
-fsanitize=address -fsanitize-
blacklist=/opt/local/libexec/llvm-7.0/lib/clang/7.0.0/share/asan_blacklist.txt
-fsanitize-address-use-after-scope -fsanitize-address-globals-dead-
stripping -fno-assume-sane-operator-new -stack-protector 1 -fblocks
-fencode-extended-block-signature -fregister-global-dtors-with-atexit
-fobjc-runtime=macosx-10.14.0 -fcxx-exceptions -fexceptions -fmax-type-
align=16 -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/hp/684rvltd0c127nmt0bh3bpzm0000gn/T/foo-409159.o -x c++
foo.cc
clang -cc1 version 7.0.0 based upon LLVM 7.0.0 default target x86_64
-apple-darwin18.0.0
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/v1"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/local/include"
ignoring nonexistent directory
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/opt/local/libexec/llvm-7.0/include/c++/v1
/opt/local/libexec/llvm-7.0/lib/clang/7.0.0/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks
(framework directory)
End of search list.
"/opt/local/libexec/llvm-7.0/bin/ld" -demangle -lto_library
/opt/local/libexec/llvm-7.0/lib/libLTO.dylib -no_deduplicate -dynamic
-arch x86_64 -macosx_version_min 10.14.0 -syslibroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-o a.out -v /var/folders/hp/684rvltd0c127nmt0bh3bpzm0000gn/T/foo-409159.o
-L/usr/local/lib -lc++
/opt/local/libexec/llvm-7.0/lib/clang/7.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib
-rpath @executable_path -rpath
/opt/local/libexec/llvm-7.0/lib/clang/7.0.0/lib/darwin -lSystem
/opt/local/libexec/llvm-7.0/lib/clang/7.0.0/lib/darwin/libclang_rt.osx.a
@(#)PROGRAM:ld PROJECT:ld64-409.12
BUILD 02:04:28 Aug 14 2018
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h
armv6m armv7k armv7m armv7em arm64e arm64_32
Library search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/lib
Framework search paths:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/
$ ./a.out
dyld: Library not loaded:
/opt/local/libexec/llvm-7.0/lib/libclang_rt.asan_osx_dynamic.dylib
Referenced from: /Users/cunningh/./a.out
Reason: image not found
Abort trap: 6
}}}
--
Ticket URL: <https://trac.macports.org/ticket/57152#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list