[libcxx-dev] libcxxbi, itanium symbols for Mac OS 10.13
Louis Dionne via libcxx-dev
libcxx-dev at lists.llvm.org
Mon Jun 1 12:53:55 PDT 2020
Hi,
I just updated http://llvm.org/PR43749 <http://llvm.org/PR43749>, which I wasn't aware of. As I explain in the bug report:
The issue is that the compiler emits type information for fundamental types in libc++abi, and your compiler doesn't know about char8_t yet, so it doesn't emit the type information for those. libc++abi tries to export these symbols and it fails to do so, because they haven't been generated in the dylib by the compiler.
Getting a linker error is quite nice, because otherwise you'd be producing a libc++abi.dylib that doesn't work properly at runtime (say if you try to use typeid(char8_t) in your program).
I hope that answers your question. The problem should go away if you use a recent Clang. If it doesn't please ping me again.
Thanks,
Louis
> On Jun 1, 2020, at 15:39, llvm at dyatkovskiy.com wrote:
>
> Hi Louis!
>
> I found your commit in llvm-project, libcxxabi, namely this one:
>
> commit 223df5b54021cfa4c67d4e09e1dc1b3b9e6a9de7 (refs/bisect/bad)
> Author: Louis Dionne <ldionne at apple.com>
> Date: Thu Jun 27 20:17:22 2019 +0000
>
> In this commit you added exported symbols for different platforms for libcxxabi, for apple:
>
> I'm currently trying to build it for Mac OS 10.13.6, x86_64, and bumped into unresolved symbols errors:
>
> Undefined symbols for architecture x86_64:
> "__ZTIDu", referenced from:
> -exported_symbol[s_list] command line option
> "__ZTIPDu", referenced from:
> -exported_symbol[s_list] command line option
>
> I noticed that you added itanium-base.exp for APPLE platforms by default (no other conditions):
>
> > if (APPLE)
> > target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/itanium-base.exp")
>
> I'm not expert of x86_64 arch, especially for darwin. Are we using Itanium ABI by default on Mac OS 10.13 for x86_64 arch?
> If so, what did I miss, for there are symbols which must be exported, but absent in my compilation. I compile libcxxabi with following commands:
>
> cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$BUILD_DIR/install -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" $SRC_DIR
> ninja -j8
>
> There is also bug, which seems to be related to this commit:
> https://bugs.llvm.org/show_bug.cgi?id=43749
>
> Thanks!
> Stepan Dyatkovskiy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20200601/16af0118/attachment.html>
More information about the libcxx-dev
mailing list