Bug 2186531
| Summary: | Can not link a shared library with libc++ | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Oleg Samarin <osamarin68> |
| Component: | clang15 | Assignee: | Tulio Magno Quites Machado Filho <tuliom> |
| Status: | CLOSED ERRATA | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 37 | CC: | jchecahi, tuliom |
| Target Milestone: | --- | Keywords: | Reopened |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-07-20 05:18:11 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Oleg Samarin
2023-04-13 16:08:14 UTC
@osamarin68 , I tried to reproduce this issue without success. I took a look at the build logs and I confirmed that -fPIC is being used. Could you provide a reproducer for this issue, please? Running this script
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
cat >TestShared.cpp <<EOF
#include <exception>
extern void test_shared() {
std::get_terminate();
}
EOF
clang++ -fPIC -o TestShared.cpp.o -c TestShared.cpp
clang++ -fuse-ld=lld -nostdlib++ -Wl,-Bstatic -lc++ -lc++abi -Wl,-Bdynamic -stdlib=libc++ -shared -o libtest-shared.so TestShared.cpp.o
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
raises lots of linking errors.
After installing libcxxabi-static and libcxx-static built with -DCMAKE_POSITION_INDEPENDENT_CODE=ON, the shared library libtest-shared.so can be linked without errors. Thank you, Oleg! I was able to reproduce the issue now. libcxx rebuilds some files provided by libcxxabi. Part of these files are specifically built under cxxabi_static_objects.dir. This group of files is not being built with -fPIC. FEDORA-2023-67a2776b08 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-67a2776b08 FEDORA-2023-67a2776b08 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2023-fac2a3fb5f has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-fac2a3fb5f FEDORA-2023-fac2a3fb5f has been pushed to the Fedora 38 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-fac2a3fb5f` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-fac2a3fb5f See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-fac2a3fb5f has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2023-8640c2d9be has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-8640c2d9be FEDORA-2023-8640c2d9be has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-8640c2d9be` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-8640c2d9be See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-8640c2d9be has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report. @tuliom I found out that the issue is still present and reproducible. This makes the libc++_shared_static.cpp test from the integration testsuite to fail. It can be reproduced by following the instuctions in comment 2. Could you please take a look into this? Thanks! Confirmed. This is only affecting Fedora 37. Both Fedora 38 and Rawhide are working well. libc++ will require a rebuild. I'm working on it. FEDORA-2023-e4957281af has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e4957281af FEDORA-2023-e4957281af has been pushed to the Fedora 37 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-e4957281af` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-e4957281af See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2023-e4957281af has been pushed to the Fedora 37 stable repository. If problem still persists, please make note of it in this bug report. |