[llvm-dev] ubsan no longer compiles when libc++ is the default

İsmail Dönmez via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 2 01:47:50 PDT 2017


Hi,

I see the following variables in the CMakeCache.txt:

SANITIZER_CXX_ABI:STRING=default
//STRINGS property for variable: SANITIZER_CXX_ABI
SANITIZER_CXX_ABI-STRINGS:INTERNAL=none;default;libcxxabi;libstdc++

Regards,
ismail


On Tue, Aug 1, 2017 at 7:32 PM, Vedant Kumar <vsk at apple.com> wrote:
>
>> On Aug 1, 2017, at 7:07 AM, İsmail Dönmez via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>>
>> Hi,
>>
>> Trying to compile llvm with the following configuration on Linux x86-64:
>>
>> cmake -G Ninja -DBUILD_SHARED_LIBS=ON \
>>                          -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=gold"
>> \
>> -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=gold"\
>>                          -DCMAKE_BUILD_TYPE=RelWithDebInfo ' \
>>                          -DCMAKE_C_FLAGS="-O2 -g"  \
>>                          -DCMAKE_CXX_FLAGS="-O2 -g" \
>>                          -DENABLE_LINKER_BUILD_ID=ON \
>>                          -DLLVM_ENABLE_ASSERTIONS=ON \
>>                          -DLLVM_ENABLE_PIC=ON \
>>                          -DLLVM_BINUTILS_INCDIR=/usr/include \
>>                          -DLLVM_TARGETS_TO_BUILD=host \
>>                          -DLLVM_TARGET_ARCH=host \
>>                          -DLLVM_LIBDIR_SUFFIX=64 \
>>                          -DCLANG_DEFAULT_CXX_STDLIB=libc++ \
>>                          -DLLVM_ENABLE_LIBCXX=ON ..
>>
>> results in the following build error:
>>
>> ../projects/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc:233:
>> error: undefined reference to 'typeinfo for std::type_info'
>> ../projects/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc:233:
>> error: undefined reference to 'typeinfo for
>> __cxxabiv1::__class_type_info'
>> ../projects/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc:233:
>> error: undefined reference to '__dynamic_cast'
>> [...]
>>
>> Looks like ubsan no longer links to libc++abi ? (I see -lgcc_s -lc
>> -ldl -lrt -lpthread on the linker line.)
>>
>> This configuration has worked with r308719 so I am guessing this is a
>> regression.
>
> This might have done it:
> r309362 Support libc++abi in addition to libstdc++
>
> Can you spot SANITIZER_CXX_ABI_LIBRARY, SANITIZER_CXX_ABI_LIBNAME, SANITIZER_CXX_ABI_INTREE, and SANITIZER_CXX_ABI_SYSTEM in your CMakeCache.txt? If so do they have the right values?
>
> vedant
>
>>
>> Regards,
>> ismail
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


More information about the llvm-dev mailing list