次のコンパイル コマンドは、clang6.0 で実行されます。
LDFLAGS="-L/usr/local/opt/myllvm6.0rc1/lib -fuse-ld=lld"
CPPFLAGS="-I/usr/local/opt/myllvm6.0rc1/include -I/usr/local/opt/myllvm6.0rc1/include/c++/v1/";
clang++ -fsanitize=address $LDFLAGS $CPPFLAGS -g -v main.cpp
与えます:
"/usr/local/opt/myllvm6.0rc1/bin/ld64.lld" -demangle -lto_library /usr/local/opt/myllvm6.0rc1/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o a.out -L/usr/local/opt/myllvm6.0rc1/lib /var/folders/14/rc46ppds1ms2kj_mvdcxlc040000gn/T/main-113675.o -lc++ /usr/local/opt/myllvm6.0rc1/lib/clang/6.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib -rpath @executable_path -rpath /usr/local/opt/myllvm6.0rc1/lib/clang/6.0.0/lib/darwin -lSystem /usr/local/opt/myllvm6.0rc1/lib/clang/6.0.0/lib/darwin/libclang_rt.osx.a
warning: ignoring unknown argument: -no_deduplicate
warning: -sdk_version is required when emitting min version load command. Setting sdk version to match provided min version
Unable to find library for -lto_library
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
ロードできない理由がわかり/usr/local/opt/myllvm6.0rc1/lib/libLTO.dylib
ません(この場所に存在します!)何か考えはありますか?