LLVM and Clang 3.1 on CentOS 5.6 GCC 4.4

Do I need to apply patches to the 3.1 tarball to make it compile on CentOS 5.6 x86? From my searching it seems like using GCC 4.4 on CentOS 5.6 x86 is supported but it fails when trying to compile ASan.

What are the right flags to pass to configure? By default CentOS 5.6 uses GCC 4.1 so the headers - even after installing GCC 4.4 - that configure uses when I tell it to us a different compiler are still the 4.1 ones.

CC=gcc44 CXX=g++44 …/configure …

This is the bug report: http://llvm.org/bugs/show_bug.cgi?id=12522

I guess my question is what am I missing from the configure line?

—Mohamed

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?

—Mohamed