LLVM and Clang 3.1 on CentOS 5.6 GCC 4.4

After starting configure as:

CC=gcc44 CXX=g++44 ../configure --prefix=/home/dev/software-builds/llvm-3.1_install --enable-optimized --enable-assertions --with-c-include-dirs=/usr/include/c++/4.4.6

I get this error message:

...
MKDIR: /home/dev/software-builds/llvm-3.1.src/build/tools/clang/runtime/compiler-rt/clang_linux/asan-i386

COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/absvdi2.c
COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/absvsi2.c

COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/absvti2.c
COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/adddf3.c

COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/addsf3.c
In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/absvdi2.c:15:

In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/int_lib.h:41:
In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/int_types.h:21:

/home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/int_endianness.h:71In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/absvsi2.c:15:

In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/int_lib.h:41:
In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/int_types.h:21:

/home/dev/software-builds/llvm-3.1.src/projects/compiler-rt/lib/int_endianness.h:71:10: fatal error: 'endian.h' file not found
:#include <endian.h>

^
10: fatal error: 'endian.h' file not found
#include <endian.h>

^1 error generated.

What am I doing wrong?

You are missing /usr/include in --with-c-include-dirs list

Konstantin Tokarev <annulen@...> writes:

> After starting configure as:
>
> CC=gcc44 CXX=g++44 ../configure --prefix=/home/dev/software-builds/llvm-

3.1_install

--enable-optimized --enable-assertions --with-c-include-

dirs=/usr/include/c++/4.4.6

>
> I get this error message:
>
> ...
> MKDIR: /home/dev/software-builds/llvm-

3.1.src/build/tools/clang/runtime/compiler-rt/clang_linux/asan-i386

>
> COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/absvdi2.c

> COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/absvsi2.c

>
> COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/absvti2.c

> COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/adddf3.c

>
> COMPILE: clang_linux/full-i386/i386: /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/addsf3.c

> In file included from /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/absvdi2.c:15:

>
> In file included from /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/int_lib.h:41:

> In file included from /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/int_types.h:21:

>
> /home/dev/software-builds/llvm-3.1.src/projects/compiler-

rt/lib/int_endianness.h:71In file

included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-

rt/lib/absvsi2.c:15:

>
> In file included from /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/int_lib.h:41:

> In file included from /home/dev/software-builds/llvm-

3.1.src/projects/compiler-rt/lib/int_types.h:21:

>
> /home/dev/software-builds/llvm-3.1.src/projects/compiler-

rt/lib/int_endianness.h:71:10:

fatal error: 'endian.h' file not found
> :#include <endian.h>
>
> ^
> 10: fatal error: 'endian.h' file not found
> #include <endian.h>
>
> ^1 error generated.
>
> What am I doing wrong?

You are missing /usr/include in --with-c-include-dirs list

--
Regards,
Konstantin

That didn't work

  COMPILE: clang_linux/asan-i386/i386: /home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt/lib/asan/asan_poisoning.cc
  COMPILE: clang_linux/asan-i386/i386: /home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt/lib/asan/asan_posix.cc
In file included from /home/dev/software-builds/llvm-3.1.src/projects/compiler-
rt/lib/asan/asan_posix.cc:35:
In file included from /usr/lib/gcc/i386-redhat-
linux/4.1.2/../../../../include/c++/4.1.2/algorithm:64:
In file included from /usr/lib/gcc/i386-redhat-
linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:69:
In file included from /usr/lib/gcc/i386-redhat-
linux/4.1.2/../../../../include/c++/4.1.2/iosfwd:45:
In file included from /usr/lib/gcc/i386-redhat-
linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++io.h
COMPILE: clang_linux/asan-i386/i386: /home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt/lib/asan/asan_printf.cc
:38:
In file included from /usr/lib/gcc/i386-redhat-
linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/gthr.h:132:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:100:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_once)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:101:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_getspecific)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:102:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_setspecific)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:103:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_create)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:104:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_cancel)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
  COMPILE: clang_linux/asan-i386/i386: /home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt/lib/asan/asan_rtl.cc
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:105:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutex_lock)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:106:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutex_trylock)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:107:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutex_unlock)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:108:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutex_init)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:109:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_cond_broadcast)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:110:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_cond_wait)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:113:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_key_create)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:114:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_key_delete)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:115:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutexattr_init)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:116:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutexattr_settype)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:117:1: error: weakref declaration must have internal
linkage
__gthrw(pthread_mutexattr_destroy)
^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:81:23: note: expanded from macro '__gthrw'
#define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                      ^
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-
linux/bits/gthr-default.h:72:46: note: expanded from macro '__gthrw2'
  extern __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                             ^
  COMPILE: clang_linux/asan-i386/i386: /home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt/lib/asan/asan_stack.cc
  COMPILE: clang_linux/asan-i386/i386: /home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt/lib/asan/asan_stats.cc
16 errors generated.
make[5]: *** [/home/dev/software-builds/llvm-
3.1.src/build/tools/clang/runtime/compiler-rt/clang_linux/asan-
i386/i386/SubDir.lib__asan/asan_posix.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: Leaving directory `/home/dev/software-builds/llvm-
3.1.src/projects/compiler-rt'
make[4]: *** [BuildRuntimeLibraries] Error 2
rm /home/dev/software-builds/llvm-
3.1.src/build/Release+Asserts/lib/clang/3.1/lib/linux/.dir
make[4]: Leaving directory `/home/dev/software-builds/llvm-
3.1.src/build/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory `/home/dev/software-builds/llvm-
3.1.src/build/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/home/dev/software-builds/llvm-
3.1.src/build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/home/dev/software-builds/llvm-3.1.src/build/tools'
make: *** [all] Error 1

Configure line:

[dev@localhost build]$ ./config.status --v
LLVM config.status 3.1
configured by ../configure, generated by GNU Autoconf 2.60,
  with options "'--prefix=/home/dev/software-builds/llvm-3.1_install' '--enable-
optimized' '--enable-assertions' '--with-c-include-
dirs=/usr/include/c++/4.4.6:/usr/include' 'CC=gcc44' 'CXX=g++44'"

Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.

I also tried

--with-c-include-dirs=/usr/include:/usr/include/c++/4.4.6

—Mohamed

Any thoughts on this? I just need someone to confirm if they've managed to get
clang 3.1 working on stock CentOS 5.6 x86, and if so how they compiled clang.

—Mohamed

I was able to build clang 3.1 from SVN on CentOS 5.8 (x86_64) with GCC 4.4

$ uname -a
Linux sbn 2.6.18-308.8.2.el5 #1 SMP Tue Jun 12 09:58:12 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/redhat-release
CentOS release 5.8 (Final)
$ /usr/bin/gcc44 --version | head -1
gcc44 (GCC) 4.4.6 20110731 (Red Hat 4.4.6-3)
$ CC=/usr/bin/gcc44 CXX=/usr/bin/g++44 ../llvm/configure
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
...
config.status: executing tools/Makefile commands
config.status: executing tools/sample/Makefile commands
$ make -j 8
llvm[0]: Constructing LLVMBuild project information.
...
make[1]: Leaving directory `/nfshome/sbn/src/build-clang-lin/bindings'
llvm[0]: ***** Completed Debug+Asserts Build
llvm[0]: ***** Note: Debug build can be 10 times slower than an
llvm[0]: ***** optimized build. Use make ENABLE_OPTIMIZED=1 to
llvm[0]: ***** make an optimized build. Alternatively you can
llvm[0]: ***** configure with --enable-optimized.
$ ./Debug+Asserts/bin/clang --version
clang version 3.1 (branches/release_31 161861)
Target: x86_64-unknown-linux-gnu
Thread model: posix

But I have problems when I tried to build 32-bit version:

$ CC='/usr/bin/gcc44 -m32' CXX='/usr/bin/g++44 -m32' ../llvm/configure
checking for C compiler default output file name... a.out
...
config.status: executing tools/Makefile commands
config.status: executing tools/sample/Makefile commands
$ make -j 8
llvm[0]: Constructing LLVMBuild project information.
make[1]: Entering directory `/nfshome/sbn/src/build-clang-lin32/lib/Support'
...
   ARCHIVE: clang_linux/full-i386/i386: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/full-i386/i386/libcompiler_rt.a
   ARCHIVE: clang_linux/full-x86_64/x86_64: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/full-x86_64/x86_64/libcompiler_rt.a
   ARCHIVE: clang_linux/profile-i386/i386: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/profile-i386/i386/libcompiler_rt.a
   ARCHIVE: clang_linux/profile-x86_64/x86_64: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/profile-x86_64/x86_64/libcompiler_rt.a
   FINAL-ARCHIVE: clang_linux/profile-i386: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/profile-i386/libcompiler_rt.a
   FINAL-ARCHIVE: clang_linux/profile-x86_64: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/profile-x86_64/libcompiler_rt.a
   FINAL-ARCHIVE: clang_linux/full-i386: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/full-i386/libcompiler_rt.a
   FINAL-ARCHIVE: clang_linux/full-x86_64: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/full-x86_64/libcompiler_rt.a
   ARCHIVE: clang_linux/asan-x86_64/x86_64: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/asan-x86_64/x86_64/libcompiler_rt.a
   FINAL-ARCHIVE: clang_linux/asan-x86_64: /nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/asan-x86_64/libcompiler_rt.a
make[5]: Leaving directory `/nfshome/sbn/src/llvm/projects/compiler-rt'
llvm[4]: Copying runtime library linux/profile-i386 to build dir
llvm[4]: Copying runtime library linux/full-i386 to build dir
llvm[4]: Copying runtime library linux/asan-i386 to build dir
cp: cannot stat `/nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt/clang_linux/asan-i386/libcompiler_rt.a': No such file or directory
make[4]: *** [/nfshome/sbn/src/build-clang-lin32/Debug+Asserts/lib/clang/3.1/lib/linux/libclang_rt.asan-i386.a] Error 1
make[4]: *** Waiting for unfinished jobs....
rm /nfshome/sbn/src/build-clang-lin32/Debug+Asserts/lib/clang/3.1/lib/linux/.dir
make[4]: Leaving directory `/nfshome/sbn/src/build-clang-lin32/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory `/nfshome/sbn/src/build-clang-lin32/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/nfshome/sbn/src/build-clang-lin32/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory `/nfshome/sbn/src/build-clang-lin32/tools'
make: *** [all] Error 1

Could you try to add --build=i686-redhat6E-linux in configure?

Er, I might be half asleep; "i386-redhat-linux6E" is correct.