Compiling llvm and Clang on Linux

Yes, it is the same error referring to 4.1.2.

/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)

There are several such errors.

Are you sure you are usin gcc44? Don't you need to run CC=gcc44 CXX=g++44 ../llvm/configure instead?

I ran "configure -help " and it says

usage: configure [OPTION]..... [VAR=VALUE]

So I assume configure CC=... is the right syntax. Isn't it?

Regard,
Sitvanit

Hi Sitvanit,

I ran "configure -help " and it says

usage: configure [OPTION]..... [VAR=VALUE]

So I assume configure CC=... is the right syntax. Isn't it?

while you might think so, try it the other way round. Also, by doing
   make VERBOSE=1
you can see which compiler is really being used.

Ciao, Duncan.

I tried

CC=gcc44 CXX=g++44 ../llvm/configure

and got

CC=gcc44: Command not found

So the syntax is indeed as wriiten in the help.

Sitvanit Ruah
Formal Verification Group
IBM Haifa Research Laboratory
Tel: 972-4-828-1249

Hi Sitvanit,

I tried

  CC=gcc44 CXX=g++44 ../llvm/configure

and got

CC=gcc44: Command not found

So the syntax is indeed as wriiten in the help.

actually, no, this just means that you are using a shell that doesn't support
this syntax. What shell are you using? Try
   export CC=gcc44
   export CXX=g++44
   ../llvm/configure

Ciao, Duncan.

PS: Do you actually have gcc-4.4 installed and in your path? What do the
commands
   gcc44 -v
and
   g++44 -v
output?

In order to isolate the problem I am now running on a machine whose only
installation of gcc/g++ is gcc44, g++44

For this installation I am getting the following error:

  COMPILE:
clang_linux/asan-i386/i386: /gpfs/haifa-p4/00/pincette/sitvanit/LLVM/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc
/.../sitvanit/LLVM/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:19:10:
fatal error:
      'new' file not found
#include <new>
         ^
1 error generated.
make[5]: ***
[/gpfs/haifa-p4/00/pincette/sitvanit/LLVM/build/tools/clang/runtime/compiler-rt/clang_linux/asan-i386/i386/SubDir.lib__asan/asan_new_delete.o]
Error 1
make[5]: Leaving directory
`/gpfs/haifa-p4/00/pincette/sitvanit/LLVM/llvm/projects/compiler-rt'
make[4]: *** [BuildRuntimeLibraries] Error 2
make[4]: Leaving directory
`/gpfs/haifa-p4/00/pincette/sitvanit/LLVM/build/tools/clang/runtime/compiler-rt'
make[3]: *** [compiler-rt/.makeall] Error 2
make[3]: Leaving directory
`/gpfs/haifa-p4/00/pincette/sitvanit/LLVM/build/tools/clang/runtime'
make[2]: *** [all] Error 1
make[2]: Leaving directory
`/gpfs/haifa-p4/00/pincette/sitvanit/LLVM/build/tools/clang'
make[1]: *** [clang/.makeall] Error 2
make[1]: Leaving directory
`/gpfs/haifa-p4/00/pincette/sitvanit/LLVM/build/tools'
make: *** [all] Error 1

Ok, I got. You should install libstdc++44-devel, too.

Please try to install gcc44-c++ and libstdc++44-devel.

Note: gcc44-c++ depends on gcc44, but gcc44-c++ and libstdc++44-devel
are independent each other, at least on my host, CentOS5.

...Takumi

Note: gcc44-c++ depends on gcc44, but gcc44-c++ and libstdc++44-devel
are independent each other, at least on my host, CentOS5.

Oh sorry, gcc44-c++ depends on libstdc++44-devel, too, for me.

Do I have to recompile from scratch whenever I am changing the
configuration?

It looks like I need to give additional flags to the configure command.
Anything else I need except CC, CXX and CXXFLAGS?

Do I need any of the following too?
--with-c-include-dirs Colon separated list of directories clang will
                          search for headers

  --includedir=DIR C header files [PREFIX/include]

What is the difference between the above two options?

--libdir=DIR object code libraries [EPREFIX/lib]

Sitvanit Ruah
Formal Verification Group
IBM Haifa Research Laboratory
Tel: 972-4-828-1249