[LLVMdev] Frontend incompatibility precluding use of llvm-gcc as a drop-in replacement of gcc

Denis Vlasenko vda.linux at googlemail.com
Fri Oct 19 04:54:47 PDT 2007


Hi,

I built llvm-gcc and tried to use it as drop-in replacement
of gcc. I attempted to build busybox with it. It choked on -std=gnu99.

Reduced testcase:

struct stat {};
struct stat64 {};
int fxstat(int n, int fd, struct stat *sb);
int fxstat64(int n, int fd, struct stat64 *sb);
extern int fstat(int fd, struct stat *buf) asm("fstat64");
extern inline int fstat(int fd, struct stat *sb) { return fxstat(3, fd, sb); }
extern inline int fstat64(int fd, struct stat64 *sb) { return
fxstat64(3, fd, sb); }

With llvm-gcc4.0-2.1:

gcc -fgnu89-inline -std=gnu99 -c testcase.c
    error:
    unrecognized command line option "-fgnu89-inline"
gcc -std=gnu99 -c testcase.c
    error:
    Assembler messages:
    /tmp/cc9R2Ci9.s:33: Error: symbol `fstat64' is already defined
gcc -c testcase.c
    ok


With gcc-4.2.1:

gcc -fgnu89-inline -std=gnu99 -c testcase.c
    ok
gcc -std=gnu99 -c testcase.c
    warning:
     C99 inline functions are not supported; using GNU89
gcc -c testcase.c
    ok

Bug is also reported here: http://llvm.org/bugs/show_bug.cgi?id=1736
--
vda



More information about the llvm-dev mailing list