which g++ to compile LLVM CVS on Linux/AMD64?

Hello All,

What version of g++ is usable to compile the latest LLVM CVS snapshot on a
Linux/x86-64 (AMD64) Debian/ Sid or Etch plateform?

What compiler do LLVM dzevelopers use to compile LLVM on Linux/X86-64
systems? IKt seems that most versions of g++ fail to compile LLVM and that
some others compile it wrongly (producing buggy code)?

Why can't g++-4.1 be used?

FWIW, the latest gcc snapshot from yesterday gcc version 4.3.0 20070501
(experimental) fail to compile latest LLVM (with compile errors!).

Is LLVM bootstraped thru g++-llvm?

Regards

I am using gcc version 4.1.2 on debian testing without problem.

Andrew

What version of g++ is usable to compile the latest LLVM CVS snapshot on a
Linux/x86-64 (AMD64) Debian/ Sid or Etch plateform?

Please look here:
http://llvm.org/docs/GettingStarted.html#brokengcc

I'd suggest late versions of GCC 4.0.x. The 4.1 series has had numerous problems compiling LLVM on x86-64, though some people have had success with some vendor versions.

FWIW, the latest gcc snapshot from yesterday gcc version 4.3.0 20070501
(experimental) fail to compile latest LLVM (with compile errors!).

Please file an llvm bug report with these errors. It may be that we are doing something illegal in C++ that is only now getting caught. If the source is valid and G++ is incorrectly complaining, please file a bug against GCC.

Is LLVM bootstraped thru g++-llvm?

Yes, it can be, and it works.

-Chris

Le Thu, May 03, 2007 at 09:36:22AM -0700, Chris Lattner écrivait/wrote:

>

> FWIW, the latest gcc snapshot from yesterday gcc version 4.3.0 20070501
> (experimental) fail to compile latest LLVM (with compile errors!).

Please file an llvm bug report with these errors. It may be that we are
doing something illegal in C++ that is only now getting caught. If the
source is valid and G++ is incorrectly complaining, please file a bug
against GCC.

I'm sorry to reply on the list (but I failed even waiting 15 minutes to get
a mailed password from the LLVM bugzilla system).

With the latest CVS and with ./configure CXX=g++-snap where
g++-snap is yesterday's GCC trunk :
g++-snap -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --disable-multilib --program-suffix=-snap --enable-languages=c,c++
Thread model: posix
gcc version 4.3.0 20070501 (experimental)

I am getting the following errors

llvm[1]: Building Debug Archive Library libLLVMSystem.a
make[1]: Leaving directory `/usr/src/Lang/llvm/lib/System'
make[1]: Entering directory `/usr/src/Lang/llvm/lib/Support'
llvm[1]: Compiling APInt.cpp for Debug build
In file included from /usr/src/Lang/llvm/include/llvm/Type.h:14,
                 from /usr/src/Lang/llvm/include/llvm/DerivedTypes.h:21,
                 from APInt.cpp:17:
/usr/src/Lang/llvm/include/llvm/AbstractTypeUser.h:19:51: error: missing terminating ' character
In file included from APInt.cpp:16:
/usr/src/Lang/llvm/include/llvm/ADT/APInt.h:1041: warning: type qualifiers ignored on function return type
/usr/src/Lang/llvm/include/llvm/ADT/APInt.h:1047: warning: type qualifiers ignored on function return type
In file included from APInt.cpp:17:
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h: In member function 'virtual void llvm::OpaqueType::refineAbstractType(const llvm::DerivedType*, const llvm::Type*)':
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h:412: error: 'abort' was not declared in this scope
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h: In member function 'virtual void llvm::OpaqueType::typeBecameConcrete(const llvm::DerivedType*)':
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h:415: error: 'abort' was not declared in this scope

Hope that this could help someone. I really don't know if it is a bug in GCC
(tuesday's SVN snapshot) or in LLVM (today's CVS snapshot)

Regards.

Basile,

Le Thu, May 03, 2007 at 09:36:22AM -0700, Chris Lattner écrivait/wrote:

>

> FWIW, the latest gcc snapshot from yesterday gcc version 4.3.0 20070501
> (experimental) fail to compile latest LLVM (with compile errors!).

Please file an llvm bug report with these errors. It may be that we are
doing something illegal in C++ that is only now getting caught. If the
source is valid and G++ is incorrectly complaining, please file a bug
against GCC.

I'm sorry to reply on the list (but I failed even waiting 15 minutes to get
a mailed password from the LLVM bugzilla system).

With the latest CVS and with ./configure CXX=g++-snap where
g++-snap is yesterday's GCC trunk :
g++-snap -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --disable-multilib --program-suffix=-snap --enable-languages=c,c++
Thread model: posix
gcc version 4.3.0 20070501 (experimental)

I am getting the following errors

llvm[1]: Building Debug Archive Library libLLVMSystem.a
make[1]: Leaving directory `/usr/src/Lang/llvm/lib/System'
make[1]: Entering directory `/usr/src/Lang/llvm/lib/Support'
llvm[1]: Compiling APInt.cpp for Debug build
In file included from /usr/src/Lang/llvm/include/llvm/Type.h:14,
                from /usr/src/Lang/llvm/include/llvm/DerivedTypes.h:21,
                from APInt.cpp:17:
/usr/src/Lang/llvm/include/llvm/AbstractTypeUser.h:19:51: error: missing terminating ' character

This is likely a bug in gcc. Its not liking ' in a #error pragma .. go figure.

I fixed this by removing the '

In file included from APInt.cpp:16:
/usr/src/Lang/llvm/include/llvm/ADT/APInt.h:1041: warning: type qualifiers ignored on function return type
/usr/src/Lang/llvm/include/llvm/ADT/APInt.h:1047: warning: type qualifiers ignored on function return type

These two are bugs in your compiler.

In file included from APInt.cpp:17:
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h: In member function 'virtual void llvm::OpaqueType::refineAbstractType(const llvm::DerivedType*, const llvm::Type*)':
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h:412: error: 'abort' was not declared in this scope

This is either a bug in the compiler or a difference in <cassert> which is included in DerivedTypes.h via AbstractTypeUser.h.

/usr/src/Lang/llvm/include/llvm/DerivedTypes.h: In member function 'virtual void llvm::OpaqueType::typeBecameConcrete(const llvm::DerivedType*)':
/usr/src/Lang/llvm/include/llvm/DerivedTypes.h:415: error: 'abort' was not declared in this scope

Hope that this could help someone. I really don't know if it is a bug in GCC
(tuesday's SVN snapshot) or in LLVM (today's CVS snapshot)

I would try using a different GCC (4.0.X works well).

Reid.