Bug 1415512
Summary: | Using clang with libc++ does not work | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | imbacen |
Component: | libcxx | Assignee: | Tom "spot" Callaway <tcallawa> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 25 | CC: | fweimer, nieric, tcallawa |
Target Milestone: | --- | ||
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: | 2017-03-01 21:05:18 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
imbacen
2017-01-22 23:16:59 UTC
Upstream separates them. I am waiting on a review for 1332306 in order to get libcxxabi in to Fedora. I did not think it would take this long for that to happen. There is now a libcxxabi package (https://admin.fedoraproject.org/pkgdb/package/rpms/libcxxabi/), but still the code in comment #1 can't compile maybe because issues raised by GCC developers here: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/UHWAP45O7DOWQ6QA5KL36T5D5YHTLE5K/ (In reply to E.N. from comment #2) > the code in comment #1 comment #0, I meant. It seems to work if you append -lc++abi. $ cat hello-world.cpp #include <iostream> #include <string> int main() { std::string a = "abc"; std::cout << a << std::endl; } $ clang++ -stdlib=libc++ -lc++abi -o bar hello-world.cpp hello-world.cpp:3:10: fatal error: 'iostream' file not found #include <iostream> ^ 1 error generated. $ cat /etc/os-release NAME=Fedora VERSION="26 (Rawhide)" … $ rpm --query llvm llvm-devel clang clang-devel libcxx libcxxabi llvm-3.9.0-7.fc26.x86_64 llvm-devel-3.9.0-7.fc26.x86_64 clang-3.9.0-4.fc26.x86_64 clang-devel-3.9.0-4.fc26.x86_64 libcxx-3.9.0-2.fc26.x86_64 libcxxabi-3.9.0-1.fc26.x86_64 Am I missing something? Is it related to versions' mismatches? Try it with libcxx-3.9.0-3, which is built against libcxxabi. https://koji.fedoraproject.org/koji/buildinfo?buildID=863381 [spot@localhost ~]$ cat hello-world.cpp #include <iostream> #include <string> int main() { std::string a = "abc"; std::cout << a << std::endl; } [spot@localhost ~]$ clang++ -stdlib=libc++ -lc++abi -o bar hello-world.cpp [spot@localhost ~]$ cat /etc/os-release NAME=Fedora VERSION="26 (Workstation Edition)" … [spot@localhost ~]$ rpm --query llvm llvm-devel clang clang-devel libcxx libcxxabi llvm-3.9.0-7.fc26.x86_64 llvm-devel-3.9.0-7.fc26.x86_64 clang-3.9.0-4.fc26.x86_64 package clang-devel is not installed libcxx-3.9.0-3.fc26.x86_64 libcxxabi-3.9.0-1.fc26.x86_64 My error, my bad. After running koji download-build --arch=x86_64 libcxx-3.9.0-3.fc26 and installing the downloaded RPMs, I saw libcxxabi-devel being pulled as a dependency because it was not yet installed. The code compile well after downgrading libcxx and libcxx-devel to 3.9.0.2 while having libcxxabi-devel onto the box. For the record: $ rpm --query llvm llvm-devel clang clang-devel libcxx libcxx-devel libcxxabi libcxxabi-devel llvm-3.9.0-7.fc26.x86_64 llvm-devel-3.9.0-7.fc26.x86_64 clang-3.9.0-4.fc26.x86_64 clang-devel-3.9.0-4.fc26.x86_64 libcxx-3.9.0-2.fc26.x86_64 libcxx-devel-3.9.0-2.fc26.x86_64 libcxxabi-3.9.0-1.fc26.x86_64 libcxxabi-devel-3.9.0-1.fc26.x86_64 $ clang++ -stdlib=libc++ -lc++ -lc++abi -o bar hello-world.cpp $ ./bar abc Thanks for your time and all the packages you maintain, it's really amazing to realize the great stuff you do for the distro. My impression is this bug should now be closed. Thanks for the kind words (and your patience). |