Bug#706495: clang++ fails to find standard header files

Jaap Eldering eldering at a-eskwadraat.nl
Tue Apr 30 21:15:04 UTC 2013


Package: clang
Version: 1:3.0-6.2
Severity: normal

Hi,

When trying to compile a C++ file with libboost headers included using
clang++, I got the following error:

$ clang++ test-clang-boost.cpp 
In file included from test-clang-boost.cpp:1:
In file included from /usr/include/boost/static_assert.hpp:17:
In file included from /usr/include/boost/config.hpp:40:
In file included from /usr/include/boost/config/select_stdlib_config.hpp:18:
In file included from /usr/include/c++/4.4/cstddef:42:
In file included from /usr/include/c++/4.4/i486-linux-gnu/64/bits/c++config.h:243:
In file included from /usr/include/c++/4.4/i486-linux-gnu/64/bits/os_defines.h:39:
/usr/include/features.h:323:10: fatal error: 'bits/predefs.h' file not found
#include <bits/predefs.h>
         ^
1 diagnostic generated.


The file I tried to compile contains:

========== test-clang-boost.cpp ===========
#include <boost/static_assert.hpp>

int main()
{
        return 0;
}
===========================================

Initially, I had the libc-dev-amd64 package installed (I'm running a
standard Debian amd64 kernel on i386 userland). In that case I got the
errors below:

$ clang++ test-clang-boost.cpp 
In file included from test-clang-boost.cpp:1:
In file included from /usr/include/boost/static_assert.hpp:17:
In file included from /usr/include/boost/config.hpp:40:
In file included from /usr/include/boost/config/select_stdlib_config.hpp:18:
In file included from /usr/include/c++/4.4/cstddef:42:
In file included from /usr/include/c++/4.4/i486-linux-gnu/64/bits/c++config.h:243:
In file included from /usr/include/c++/4.4/i486-linux-gnu/64/bits/os_defines.h:39:
In file included from /usr/include/features.h:388:
/usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found
# include <gnu/stubs-32.h>
          ^
1 diagnostic generated.


Since I have a feeling this might be related to bug #643959, here's the
same debug output as requested for there:

$ clang++ -v -c test-clang-boost.cpp 
clang version 1.1 (branches/release_27)
Target: i386-unknown-linux-gnu
Thread model: posix
 "/usr/local/bin/clang" -cc1 -triple i386-unknown-linux-gnu -S -disable-free -main-file-name test-clang-boost.cpp -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -v -resource-dir /usr/local/lib/clang/1.1 -fmessage-length 100 -fexceptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-vGYZKY.s -x c++ test-clang-boost.cpp
clang -cc1 version 1.1 based upon llvm 2.7 hosted on i386-unknown-linux-gnu
ignoring nonexistent directory "/usr/include/c++/4.4.3"
ignoring nonexistent directory "/usr/include/c++/4.4.3/x86_64-pc-linux-gnu/32"
ignoring nonexistent directory "/usr/include/c++/4.4.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.4.3"
ignoring nonexistent directory "/usr/include/c++/4.4.3/i686-pc-linux-gnu/"
ignoring nonexistent directory "/usr/include/c++/4.4.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.4/x86_64-linux-gnu/32"
ignoring nonexistent directory "/usr/include/c++/4.1.3"
ignoring nonexistent directory "/usr/include/c++/4.1.3/i486-linux-gnu/"
ignoring nonexistent directory "/usr/include/c++/4.1.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.3.3"
ignoring nonexistent directory "/usr/include/c++/4.3.3/x86_64-linux-gnu/32"
ignoring nonexistent directory "/usr/include/c++/4.3.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.4.1"
ignoring nonexistent directory "/usr/include/c++/4.4.1/x86_64-linux-gnu/32"
ignoring nonexistent directory "/usr/include/c++/4.4.1/backward"
ignoring nonexistent directory "/usr/include/c++/4.1.2"
ignoring nonexistent directory "/usr/include/c++/4.1.2/i386-redhat-linux/"
ignoring nonexistent directory "/usr/include/c++/4.1.2/backward"
ignoring nonexistent directory "/usr/include/c++/4.3.0"
ignoring nonexistent directory "/usr/include/c++/4.3.0/i386-redhat-linux/"
ignoring nonexistent directory "/usr/include/c++/4.3.0/backward"
ignoring nonexistent directory "/usr/include/c++/4.3.2"
ignoring nonexistent directory "/usr/include/c++/4.3.2/i386-redhat-linux/"
ignoring nonexistent directory "/usr/include/c++/4.3.2/backward"
ignoring nonexistent directory "/usr/include/c++/4.3.2"
ignoring nonexistent directory "/usr/include/c++/4.3.2/x86_64-redhat-linux/32"
ignoring nonexistent directory "/usr/include/c++/4.3.2/backward"
ignoring nonexistent directory "/usr/include/c++/4.4.1"
ignoring nonexistent directory "/usr/include/c++/4.4.1/i586-redhat-linux/"
ignoring nonexistent directory "/usr/include/c++/4.4.1/backward"
ignoring nonexistent directory "/usr/include/c++/4.4.2"
ignoring nonexistent directory "/usr/include/c++/4.4.2/i686-redhat-linux/"
ignoring nonexistent directory "/usr/include/c++/4.4.2/backward"
ignoring nonexistent directory "/usr/include/c++/4.4.3"
ignoring nonexistent directory "/usr/include/c++/4.4.3/i686-redhat-linux/"
ignoring nonexistent directory "/usr/include/c++/4.4.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.3"
ignoring nonexistent directory "/usr/include/c++/4.3/i586-suse-linux/"
ignoring nonexistent directory "/usr/include/c++/4.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.3"
ignoring nonexistent directory "/usr/include/c++/4.3/x86_64-suse-linux/32"
ignoring nonexistent directory "/usr/include/c++/4.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.4/i586-suse-linux/"
ignoring nonexistent directory "/usr/include/c++/4.4/x86_64-suse-linux/"
ignoring nonexistent directory "/usr/include/c++/4.3.1"
ignoring nonexistent directory "/usr/include/c++/4.3.1/i686-pc-linux-gnu/"
ignoring nonexistent directory "/usr/include/c++/4.3.1/backward"
ignoring nonexistent directory "/usr/include/c++/4.3.1"
ignoring nonexistent directory "/usr/include/c++/4.3.1/x86_64-unknown-linux-gnu/"
ignoring nonexistent directory "/usr/include/c++/4.3.1/backward"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/i686-pc-linux-gnu/"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/include/g++-v4/backward"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4/i686-pc-linux-gnu/"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4/backward"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/i686-pc-linux-gnu/"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4/backward"
ignoring nonexistent directory "/usr/include/c++/4.3"
ignoring nonexistent directory "/usr/include/c++/4.3/i486-pc-linux-gnu/"
ignoring nonexistent directory "/usr/include/c++/4.3/backward"
ignoring nonexistent directory "/usr/include/c++/4.3"
ignoring nonexistent directory "/usr/include/c++/4.3/i486-linux-gnu/"
ignoring nonexistent directory "/usr/include/c++/4.3/backward"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/i686-pc-linux-gnu/"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/include/g++-v4/backward"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4/x86_64-pc-linux-gnu/"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/include/g++-v4/backward"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4/x86_64-pc-linux-gnu/32"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.3/include/g++-v4/backward"
ignoring duplicate directory "/usr/include/c++/4.4"
ignoring duplicate directory "/usr/include/c++/4.4/backward"
ignoring duplicate directory "/usr/include/c++/4.4"
ignoring duplicate directory "/usr/include/c++/4.4/backward"
ignoring duplicate directory "/usr/include/c++/4.4"
ignoring duplicate directory "/usr/include/c++/4.4/backward"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/clang/1.1/include
 /usr/include/c++/4.4
 /usr/include/c++/4.4/backward
 /usr/include/c++/4.4/i486-linux-gnu/64
 /usr/local/include
 /usr/include
End of search list.
In file included from test-clang-boost.cpp:1:
In file included from /usr/include/boost/static_assert.hpp:17:
In file included from /usr/include/boost/config.hpp:40:
In file included from /usr/include/boost/config/select_stdlib_config.hpp:18:
In file included from /usr/include/c++/4.4/cstddef:42:
In file included from /usr/include/c++/4.4/i486-linux-gnu/64/bits/c++config.h:243:
In file included from /usr/include/c++/4.4/i486-linux-gnu/64/bits/os_defines.h:39:
/usr/include/features.h:323:10: fatal error: 'bits/predefs.h' file not found
#include <bits/predefs.h>
         ^
1 diagnostic generated.


Best,
Jaap


-- System Information:
Debian Release: 7.0
  APT prefers testing-updates
  APT policy: (500, 'testing-updates'), (500, 'testing')
Architecture: i386 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages clang depends on:
ii  libc6                2.13-38
ii  libclang-common-dev  1:3.0-6.2
ii  libffi5              3.0.10-3
ii  libgcc1              1:4.7.2-5
ii  libllvm3.0           3.0-10
ii  libstdc++6           4.7.2-5
ii  libstdc++6-4.6-dev   4.6.3-14

Versions of packages clang recommends:
ii  llvm-3.0-dev  3.0-10
ii  python        2.7.3-4

clang suggests no packages.

-- no debconf information



More information about the Pkg-llvm-team mailing list