[LLVMdev] make error building llvm/clang 3.2 on Linux

Michael Young mikado_282 at hotmail.com
Wed Feb 20 16:15:19 PST 2013


I'm attempting to build a native build of clang from the 3.2 source
distribution tarballs, but I ran into this build error that's got me
really puzzled.  My platform is Linux - 32-bit Ubuntu (12.04) running
on a PC.  Here's the (abbreviated) output from make:

***************************************
   ...
make[3]: Entering directory `/home/youngmj/DevTools/LLVM/Version_3.2/build/tools/clang/runtime'
make[4]: Entering directory `/home/youngmj/DevTools/LLVM/Version_3.2/build/tools/clang/runtime/compiler-rt'
make[5]: Entering directory `/home/youngmj/DevTools/LLVM/Version_3.2/source/compiler-rt-3.2.src'
  MKDIR:     /home/youngmj/DevTools/LLVM/Version_3.2/build/tools/clang/runtime/compiler-rt/clang_linux/full-i386/i386/SubDir.lib
  COMPILE:   clang_linux/full-i386/i386: /home/youngmj/DevTools/LLVM/Version_3.2/source/llvm-3.2.src/projects/compiler-rt/lib/absvdi2.c
 <* SNIP *>
  COMPILE:   clang_linux/full-i386/i386: /home/youngmj/DevTools/LLVM/Version_3.2/source/llvm-3.2.src/projects/compiler-rt/lib/divxc3.c
  COMPILE:   clang_linux/full-i386/i386: /home/youngmj/DevTools/LLVM/Version_3.2/source/llvm-3.2.src/projects/compiler-rt/lib/enable_execute_stack.c
In file included from /home/youngmj/DevTools/LLVM/Version_3.2/source/llvm-3.2.src/projects/compiler-rt/lib/enable_execute_stack.c:13:
/usr/include/i386-linux-gnu/sys/mman.h:23:10: fatal error: 'features.h' file not found
#include <features.h>
         ^
1 error generated.
    ...
***************************************

[Note: I created a symlink from <LLVM_SRC_DIR>/projects/compiler-rt to
the directory created by unpacking the tarball source for compiler-rt
(which is located on the same level as <LLVM_SRC_DIR> and has a suffix
of "-3.2.src" in the name), so that's why the directory names may look
a little funny.]

Running "gcc -x c -E -v -" gives me the following:

***************************************
$ gcc -xc -E -v -
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-linux-gnu/4.6/cc1 -E -quiet -v -imultilib . -imultiarch i386-linux-gnu - -mtune=generic -march=i686 -fstack-protector
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i686-linux-gnu/4.6/../../../../i686-linux-gnu/include"
ignoring duplicate directory "/usr/include/i386-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/i386-linux-gnu
 /usr/lib/gcc/i686-linux-gnu/4.6/include
 /usr/local/include
 /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i686'
$
***************************************

Running "gcc -x c++ -E -v -" gives me the following:

***************************************
$ gcc -x c++ -E -v -
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-linux-gnu/4.6/cc1plus -E -quiet -v -imultilib . -imultiarch i386-linux-gnu -D_GNU_SOURCE - -mtune=generic -march=i686 -fstack-protector
ignoring nonexistent directory "/usr/local/include/i386-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/i686-linux-gnu/4.6/../../../../i686-linux-gnu/include"
ignoring duplicate directory "/usr/include/i386-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/i386-linux-gnu
 /usr/include/c++/4.6
 /usr/include/c++/4.6/i686-linux-gnu/.
 /usr/include/c++/4.6/backward
 /usr/lib/gcc/i686-linux-gnu/4.6/include
 /usr/local/include
 /usr/lib/gcc/i686-linux-gnu/4.6/include-fixed
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.6/:/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=i686'
$
***************************************

Notice that "#include<...> search" has "/usr/include" in the list, for
both c and c++.  Now I do a ls -l /usr/include/features.h, and I see
the following:

***************************************

$ ls -l /usr/include/features.h
-rw-r--r-- 1 root root 13084 Oct  5 16:34 /usr/include/features.h
$

***************************************

So I'm confused!  Why can't the header file be found by the compiler
when making clang/compiler-rt?

Thanks,
   Michael
 		 	   		  



More information about the llvm-dev mailing list