Bug 2156923

Summary: llvm-libunwind-devel should provide libunwind.a.
Product: [Fedora] Fedora Reporter: Byoungchan Lee <byoungchan.lee>
Component: llvm-libunwindAssignee: Nikita Popov <npopov>
Status: CLOSED ERRATA QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: kkleine, npopov, sergesanspaille, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: llvm-libunwind-15.0.7-1.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-19 06:11:04 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 Byoungchan Lee 2022-12-29 15:47:11 UTC
Description of problem:
llvm-libunwind-devel should provide libunwind.a.


Version-Release number of selected component (if applicable):
36, 37, rawhide


How reproducible:
Always


Steps to Reproduce:
1. install clang, lld, libcxx-devel, libcxx-static, and llvm-libunwind-devel
2. $ cat <<EOF > /tmp/main.cpp
#include <iostream>
int main() {
  std::cout << "Hello, World!" << std::endl;
  return 0;
}
EOF
3. $ clang++ -std=c++11 -stdlib=libc++ -v -c /tmp/main.cpp -o /tmp/main.o
4. $ clang++ -v -stdlib=libc++ -fuse-ld=lld -unwindlib=libunwind \
    -static-libstdc++ -static-libgcc -rtlib=compiler-rt -L/usr/lib64/llvm-unwind -Wl,--rpath=/usr/lib64/llvm-unwind -o /tmp/main /tmp/main.o

Actual results:
Got the following error.
```
ld.lld: error: unable to find library -l:libunwind.a
ld.lld: error: unable to find library -l:libunwind.a
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
```

Expected results:
Linking success


Additional info:
The dockerfile below is the ubuntu equivalent of the above steps. (This uses LLVM from apt.llvm.org). This works fine.

```
FROM ubuntu:22.04

RUN apt-get update && \
    apt-get install -y curl ca-certificates lsb-release wget software-properties-common gnupg

RUN curl -L https://apt.llvm.org/llvm.sh -o /tmp/llvm.sh && \
    chmod +x /tmp/llvm.sh && \
    /tmp/llvm.sh 15 all

RUN set -x \
&& { \
  echo '#include <iostream>'; \
  echo 'int main() { std::cout << "Hello, World!" << std::endl; return 0; }'; \
} > /tmp/main.cpp

RUN clang++-15 -std=c++11 -stdlib=libc++ -c /tmp/main.cpp -o /tmp/main.o

RUN clang++-15 -v -stdlib=libc++ -fuse-ld=lld -unwindlib=libunwind \
    -static-libstdc++ -static-libgcc -rtlib=compiler-rt -o /tmp/main /tmp/main.o

RUN ldd /tmp/main && /tmp/main
```

Comment 1 Nikita Popov 2023-01-02 12:17:35 UTC
Providing a static lib for a runtime library sounds reasonable to me.

https://src.fedoraproject.org/rpms/llvm-libunwind/pull-request/5

Comment 2 Fedora Update System 2023-01-11 12:01:53 UTC
FEDORA-2023-2abf1eaa22 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2abf1eaa22

Comment 3 Fedora Update System 2023-01-12 03:05:42 UTC
FEDORA-2023-2abf1eaa22 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-2abf1eaa22`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-2abf1eaa22

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-01-18 02:36:49 UTC
FEDORA-2023-6e28212539 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-6e28212539`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-6e28212539

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2023-01-19 06:11:04 UTC
FEDORA-2023-6e28212539 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.