GCC 4.1 ABI and clang

Hi,

I'm trying to find some written evidence to present to the powers
that be that clang/llvm is ABI compatible with GCC 4.1 linux
64 bit.

This would allow me to work with clang/llvm at my day-job and
I would like nothing better!

This is a pretty big app(millions of lines of code), so it would be
interesting to see how llvm/clang behaves.

Better warnings/errors and cutting down on build times
would be huge wins.

Hi,

I'm trying to find some written evidence to present to the powers
that be that clang/llvm is ABI compatible with GCC 4.1 linux
64 bit.

This would allow me to work with clang/llvm at my day-job and
I would like nothing better!

This is a pretty big app(millions of lines of code), so it would be
interesting to see how llvm/clang behaves.

Better warnings/errors and cutting down on build times
would be huge wins.

Hi Øyvind,

I'm trying to find some written evidence to present to the powers
that be that clang/llvm is ABI compatible with GCC 4.1 linux
64 bit.

both clang and gcc-4.1 are supposed to conform to the platform ABI (if they
don't then that is a bug), and thus be ABI compatible.

Ciao, Duncan.

Starting with which version?

I think GCC last changed the C++ ABI with version 3.4.

Joerg

All versions.

Ciao, Duncan.

Starting with which version?

I think GCC last changed the C++ ABI with version 3.4.

Sorry, I meant from which version of clang? I'm using Ubuntu 10 and
I was wondering if clang/llvm 2.8 would do it.

clang --version
clang version 2.8 (branches/release_28)

Sorry, I meant from which version of clang? I'm using Ubuntu 10 and
I was wondering if clang/llvm 2.8 would do it.

Perhaps I better try the latest, got an error when I tried 2.8:

In file included from testsuite/test.cpp:8:
In file included from ./testsuite/precompile.h:4:
./util/precompile.h:17:12: fatal error: 'iosfwd' file not found

Sorry, I meant from which version of clang? I'm using Ubuntu 10 and
I was wondering if clang/llvm 2.8 would do it.

Perhaps I better try the latest, got an error when I tried 2.8:

C++ support in clang 2.8 was poor.

Ciao, Duncan.

It was supposed to work for quite a while now, but a bug related to
this (where Clang got it wrong) was fixed just yesterday:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20110627/043358.html

That should go in to 3.0, but for now I guess for best results you
should use a recent trunk version.

I'll try to build & install clang from svn/git and see how that goes...

Hmmm... it crashed. Last time I tried to build it it worked. I'll try
2.9 release sources.

llvm[5]: Building Clang attribute classes with tblgen
0 tblgen 0x000000000054163f
1 tblgen 0x0000000000541e37
2 libpthread.so.0 0x00002b63f82fdc60
3 tblgen 0x000000000043c0cc
4 tblgen 0x000000000051c896
5 libc.so.6 0x00002b63f8ed1eff __libc_start_main + 255
6 tblgen 0x00000000004061b9
Stack dump:
0. Program arguments: /home/oyvind/llvm/build/Release/bin/tblgen -I
/home/oyvind/llvm/llvm/tools/clang/include/clang/AST -I
/home/oyvind/llvm/llvm/include -I /home/oyvind/llvm/llvm/include -I
/home/oyvind/llvm/llvm/lib/Target -gen-clang-attr-classes -o
/home/oyvind/llvm/build/tools/clang/include/clang/AST/Release/Attrs.inc.tmp
-I /home/oyvind/llvm/llvm/tools/clang/include/clang/AST/../../
/home/oyvind/llvm/llvm/tools/clang/include/clang/AST/../Basic/Attr.td
make[5]: *** [/home/oyvind/llvm/build/tools/clang/include/clang/AST/Release/Attrs.inc.tmp]
Segmentation fault

I'll try to build & install clang from svn/git and see how that goes...

Hmmm... it crashed. Last time I tried to build it it worked. I'll try
2.9 release sources.

Usually this means that clang / llvm is miscompiled by your system compiler.
Check this list: Getting Started with the LLVM System — LLVM 18.0.0git documentation to
make sure you're not using the broken one.