errors building clang on Ubuntu 12.04

Hi,

I’m trying to build clang 3.2 on Ubuntu 12.04 (32-bit), but I’m getting the
following compiler error well into the build process:

In file included from /home/nr/builds/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>
^

I am compiling clang with GCC 4.7.2, and configuring it as follows:

…/llvm-3.2-src/configure --enable-optimized --with-gcc-toolchain=/home/nr/programs/gcc/gcc-4.7.2 --prefix=/home/nr/programs/clang/clang-3.2

What am I doing wrong?

Thanks,
Nate

On my Ubuntu box it's in /usr/include. It came with libc6-dev:

$ dpkg -S /usr/include/features.h
libc6-dev: /usr/include/features.h

-Krzysztof

(sorry, forgot to “Reply All”)

I think this is because of --with-gcc-toolchain. Can you try omitting
that and building with the default system compiler?

Dmitri

I’m trying to build clang 3.2 on Ubuntu 12.04 (32-bit), but I’m getting

the
following compiler error well into the build process:

In file included from

/home/nr/builds/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>
^

I am compiling clang with GCC 4.7.2, and configuring it as follows:

…/llvm-3.2-src/configure --enable-optimized
–with-gcc-toolchain=/home/nr/programs/gcc/gcc-4.7.2
–prefix=/home/nr/programs/clang/clang-3.2

What am I doing wrong?

On my Ubuntu box it’s in /usr/include. It came with libc6-dev:

$ dpkg -S /usr/include/features.h
libc6-dev: /usr/include/features.h

I have a features.h in /usr/include, but I’m still getting the error…

I think this is because of --with-gcc-toolchain. Can you try omitting
that and building with the default system compiler?

I tried that, I built it with the default system compiler which is gcc 4.6.3.
However, I am still getting the same error.

Any other ideas?

Thanks,
Nate