Bug 1896076 - Unable to compile anything with Clang: bits/c++config.h not found
Summary: Unable to compile anything with Clang: bits/c++config.h not found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: clang
Version: 33
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-09 16:46 UTC by Gabriel Ravier
Modified: 2020-11-12 03:06 UTC (History)
5 users (show)

Fixed In Version: clang-11.0.0-2.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-12 03:06:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Gabriel Ravier 2020-11-09 16:46:21 UTC
Description of problem:
I cannot seem to be able to compile any kind of C++ program using Clang, as it fails to find `bits/c++config.h` when including any standard C++ header

Version-Release number of selected component (if applicable):
clang version 11.0.0 (Fedora 11.0.0-1.fc33)

How reproducible:
Always

Steps to Reproduce:
1. Create a main.cpp file with these contents :
#include <iostream>
int main(){std::cout << "Hello World\n";}
2. Compile with `clang++ main.cpp`

Actual results:
In file included from main.cpp:1:
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/iostream:38:10: fatal error: 'bits/c++config.h' file not found
#include <bits/c++config.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.

Expected results:
Clang finds /usr/include/c++/10/x86_64-redhat-linux/bits/c++config.h and compiles the program properly

Additional info:
I have a lot of cross compilers, along with multilib installed, so that might be involved ? Idk

Comment 1 Gabriel Ravier 2020-11-09 16:59:55 UTC
Additional note: Here is the output of `clang -E -x c++ - -v < /dev/null` :

$ clang++ -E -x c++ - -v < /dev/null
clang version 11.0.0 (Fedora 11.0.0-1.fc33)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-redhat-linux/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/10
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 (in-process)
 "/usr/bin/clang-11" -cc1 -triple x86_64-unknown-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -v -resource-dir /usr/lib64/clang/11.0.0 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-linux-gnu/c++/10 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-unknown-linux-gnu/c++/10 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/gravier/Downloads -ferror-limit 19 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -o - -x c++ -
clang -cc1 version 11.0.0 based upon LLVM 11.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-linux-gnu/c++/10"
ignoring nonexistent directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-unknown-linux-gnu/c++/10"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10
 /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/backward
 /usr/local/include
 /usr/lib64/clang/11.0.0/include
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 383 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

Comment 2 serge_sans_paille 2020-11-09 17:04:35 UTC
Can you check if https://bodhi.fedoraproject.org/updates/FEDORA-2020-7987e5f6e1 fixes yur issue?

Comment 3 Gabriel Ravier 2020-11-09 17:28:57 UTC
It fixes it.

Comment 4 serge_sans_paille 2020-11-10 13:27:44 UTC
Great, thanks for checking!

Comment 5 Fedora Update System 2020-11-10 13:28:37 UTC
FEDORA-2020-7987e5f6e1 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-7987e5f6e1

Comment 6 Fedora Update System 2020-11-12 03:06:23 UTC
FEDORA-2020-7987e5f6e1 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.