[libcxx-commits] [PATCH] D112112: [libunwind] Link with -unwindlib=none
Harald van Dijk via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 20 13:08:55 PDT 2021
hvdijk added a comment.
In D112112#3076215 <https://reviews.llvm.org/D112112#3076215>, @mstorsjo wrote:
> Ah, I see. Can you try by adding `-DCMAKE_C_COMPILER_WORKS=TRUE -DCMAKE_CXX_COMPILER_WORKS=TRUE`? That waives this particular failure.
I tried that at first (for both compiler-rt and libunwind -- I don't think we should be using different workarounds for the two), that breaks in a different way:
CMake Error at cmake/config-ix.cmake:197 (message):
Please use architecture with 4 or 8 byte pointers.
Call Stack (most recent call first):
CMakeLists.txt:251 (include)
This happens because simply telling CMake that linking works will make CMake assume that linking works. It then uses linking in all of its detection steps, so all of its detection steps fail.
> `-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY` is too blunt an instrument for this, for my configurations (targeting mingw). If I build libunwind with that set, linking the shared libunwind fails with these errors:
>
> lld: error: unable to find library -lc
> lld: error: unable to find library -ldl
> lld: error: unable to find library -ldl
>
> Because libunwind does have checks for whether e.g. `-lc` and `-ldl` work, and these give false positives with that setting.
Thanks for the explanation, will have a think about how we can have things work for both of us.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112112/new/
https://reviews.llvm.org/D112112
More information about the libcxx-commits
mailing list