Problem while compling SPEC2000 with llvm-gcc

Hi, all

I use llvm-gcc –O4 to compile SPEC 2000, some benchmarks can’t be built successfully, such as 164.gzip, 175.vpr etc.

The error messages are as follows.

……

zh.o unlzw.o unpack.o unzip.o util.o zip.o -o gzip

bits.o: file not recognized: File format not recognized

collect2: ld returned 1 exit status

specmake: *** [gzip] Error 1

specmake options 2> options.err | tee options.out

COMP: /home2/lishengmei/tools/llvm-gcc-4.2/bin/llvm-gcc -c -o options.o -O4

LINK: /home2/lishengmei/tools/llvm-gcc-4.2/bin/llvm-gcc -o options

Some files did not appear to be built: gzip

*** Error building 164.gzip

If you wish to ignore this error, please use ‘-I’ or ignore errors.

When I use O3 instead of O4, the errors disappear. I use llvm-2.6 version on Red hat Linux. The CPU is “Dual-Core AMD Opteron™ Processor 8218”

Can anyone give help?

Btw, some benchmarks run more slowly wth llvm-gcc O3 than with gcc O3(version is 4.4.2) on my system. Such as 186.crafty, 253.perlbmk, 254.gap

Anyone give comments?

Thanks

Shengmei

Hi, all

         I use llvm-gcc –O4 to compile SPEC 2000, some benchmarks
can’t be built successfully, such as 164.gzip, 175.vpr etc.

The error messages are as follows.

……

zh.o unlzw.o unpack.o unzip.o util.o zip.o -o gzip

bits.o: file not recognized: File format not recognized

-O4 outputs LLVM bitcode, instead of ELF files, thus requires a linker
that is able to understand it (such as the Gold linker, with the LLVM
plugin).
Try compiling any C source file with -O4, it won't work unless you have
special support from the linker.

collect2: ld returned 1 exit status

specmake: *** [gzip] Error 1

specmake options 2> options.err | tee options.out

COMP: /home2/lishengmei/tools/llvm-gcc-4.2/bin/llvm-gcc -c -o
options.o -O4

LINK: /home2/lishengmei/tools/llvm-gcc-4.2/bin/llvm-gcc
-o options

  Some files did not appear to be built: gzip

*** Error building 164.gzip

If you wish to ignore this error, please use '-I' or ignore errors.

When I use O3 instead of O4, the errors disappear. I use llvm-2.6
version on Red hat Linux. The CPU is “Dual-Core AMD Opteron(tm)
Processor 8218”

Can anyone give help?

This page describes how to build Gold, and LLVM's plugin:
http://llvm.org/docs/GoldPlugin.html

Btw, some benchmarks run more slowly wth llvm-gcc O3 than with gcc
O3(version is 4.4.2) on my system. Such as 186.crafty, 253.perlbmk,
254.gap

Anyone give comments?

How much slower?

Best regards,
--Edwin

Thanks a lot, Edwim
  About the performance of comparison between gcc and llvm-gcc, I use llvm-gcc -O3 directly to compile SPEC2000. I think it's not necessary to do the steps as follows:
llvm-gcc -emit-llvm hello.c -c -o hello.bc
llc hello.bc -o hell.s
gcc hello.s -o hello
./hello

Right?

Because on the website "http://llvm.org/docs/GettingStarted.html" There is a sentence "Note that using llvm-gcc to compile directly to native code (i.e. when the -emit-llvm option is not present) does steps 6/7/8 for you."

The results are as follows. The number is the time(s). You can see many benchmarks run more slowly with llvm-gcc -O3 than gcc -O3. I hope we can have further discussion. Thanks.

  GCC -O3 llvm-gcc O3
164.gzip 109 106
175.vpr 146 165
176.gcc 95.1 99.3
181.mcf 391 395
186.crafty 72.1 96.7
197.parser 191 200
252.eon
253.perlbmk 171 261
254.gap 172 198
255.vortex 206 226
256.bzip2 142 154
300.twolf 271 272

Shengmei