[llvm-dev] Linking error with Dataflow sanitizer

Mitch Phillips via llvm-dev llvm-dev at lists.llvm.org
Tue May 18 08:49:40 PDT 2021


Unfortunately without more info (like the compile/link commands) I'd be
unable to help - but it seems like you're either linking the wrong libc++
implicitly, or your link line order doesn't resolve the dependencies in the
right way (example
<https://www.linuxtopia.org/online_books/an_introduction_to_gcc/gccintro_18.html>).
You can eliminate the latter problem by linking with lld (-fuse-ld=lld), as
IIRC it doesn't have problems resolving out-of-order libraries. You might
also find clang's verbose mode (-v) useful to find the linker invocation,
and can use the linker's verbose option (-Wl,-v if invoked through the
clang driver) to determine which libc++ you ended up trying to link with.

On Tue, May 18, 2021 at 3:43 AM floris westermann <wfloris at student.ethz.ch>
wrote:

> Hi Mitch,
>
> I checked the lib and the symbols seem to be present:
>
> $ nm /usr/local/lib/libc++.so.1.0 | grep exception | grep what
> 0000000000236554 T dfs$_ZNKSt13bad_exception4whatEv
> 0000000000236538 T dfs$_ZNKSt9exception4whatEv
>
> What should be the link order?
>
> On Mon, 17 May 2021 at 19:34, Mitch Phillips <mitchp at google.com> wrote:
>
>> Removing the dfs$ prefix from the mangled name, the symbol that's missing
>> is std::exception::what(), which normally comes from libc++abi. Are you
>> sure that libc++abi.so contains the dfsan-prefixed symbol and your link
>> line order is correct?
>>
>> On my machine:
>>
>> $ ninja cxx cxxabi && nm lib/libc++abi.so.1.0 | grep exception | grep what
>> 000000000011cd60 T dfs$_ZNKSt13bad_exception4whatEv
>> 000000000011cc90 T dfs$_ZNKSt9exception4whatEv
>>
>> On Mon, May 17, 2021 at 9:02 AM floris westermann via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> Hi everyone,
>>>
>>> I am currently trying to compile a project with the Dataflow sanitizer.
>>> I have recompiled the libcxx and other dependencies using the sanitizer
>>> and the libc++abi.
>>>
>>> The libraries are linked dynamically but when I try to execute the
>>> binary I get the following error:
>>> ```symbol lookup error: ./Variane_testharness: undefined symbol:
>>> dfs$_ZNKSt9exception4whatEv```
>>>
>>> The project is a verilog project that is translated to CPP with
>>> verilator.
>>>
>>> Does anyone know how I can resolve this?
>>>
>>> Cheers,
>>> Floris
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210518/62e0a706/attachment.html>


More information about the llvm-dev mailing list