Description of problem: Attempting to compile any program with the shipped clang in Fedora fails. The application is unusable as shipped. How reproducible: cat >c.c <<__EOF__ int main(){ printf("hello world"); } __EOF__ [nmavrogi@dhcp-10-40-1-102 libidn2]$ clang c.c [...] /usr/bin/ld: cannot find -lgcc_s clang-4.0: error: linker command failed with exit code 1 (use -v to see invocation)
$ rpm -q clang clang-4.0.0-3.fc26.x86_64
Going through strace it seems it is configured for x86_64-linux-gnu, while libgcc_s resides in x86_64-redhat-linux. 18277 open("/usr/bin/../lib/gcc/x86_64-linux-gnu/7/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/gcc/x86_64-linux-gnu/7/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/gcc/x86_64-linux-gnu/7/../../../../lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/gcc/x86_64-linux-gnu/7/../../../../lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/lib/../lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/lib/../lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/lib/../lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/lib/../lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/gcc/x86_64-linux-gnu/7/../../../libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/gcc/x86_64-linux-gnu/7/../../../libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/bin/../lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("/usr/lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/x86_64-redhat-linux/lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/x86_64-redhat-linux/lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/local/lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/local/lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//lib64/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//lib64/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/x86_64-redhat-linux/lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/x86_64-redhat-linux/lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/local/lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/local/lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/lib/libgcc_s.so", O_RDONLY) = -1 ENOENT (No such file or directory) 18277 open("//usr/lib/libgcc_s.a", O_RDONLY) = -1 ENOENT (No such file or directory)
Which versions of gcc do you have installed?
$ rpm -q gcc gcc-7.1.1-3.fc26.x86_64
It looks like you may have two versions of gcc installed, which version is installed in /usr/bin/../lib/gcc/x86_64-linux-gnu/7 ?
$ rpm -qf /usr/bin/../lib/gcc/x86_64-linux-gnu/7 gcc-x86_64-linux-gnu-7.0.1-0.4.fc26.x86_64 No idea what was that, and removing it didn't pull out any other dependencies. Removing it fixes the issue. Thank you.
gcc-x86_64-linux-gnu-7.2.1-1.fc27.x86_64 is a cross gcc that's handy for doing cross builds of a kernel. it's not a complete gcc and clang seems to try to use that which is probably the issue. not a show stopper but would be nice to resolve
clang-5.0.1-3.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-acf8a9ad84
clang-5.0.1-3.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-acf8a9ad84
clang-5.0.1-3.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.
Fixed in rawhide: clang-6.0.0-3.fc29
pocl-1.1-2.fc28 lldb-6.0.0-3.fc28 clang-6.0.0-5.fc28 llvm-6.0.0-11.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319
clang-6.0.0-5.fc28, lldb-6.0.0-3.fc28, llvm-6.0.0-11.fc28, mesa-18.0.0-2.fc28.1, pocl-1.1-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319
clang-6.0.0-5.fc28 lldb-6.0.0-3.fc28 llvm-6.0.0-11.fc28 mesa-18.0.0-3.fc28 pocl-1.1-2.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319
clang-6.0.0-5.fc28, lldb-6.0.0-3.fc28, llvm-6.0.0-11.fc28, mesa-18.0.0-3.fc28, pocl-1.1-2.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-02c4091319
clang-6.0.0-5.fc28, lldb-6.0.0-3.fc28, llvm-6.0.0-11.fc28, mesa-18.0.0-3.fc28, pocl-1.1-2.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.