[LLVMdev] llvm-gcc-4.2 and -O4

Owen Anderson
Sat, 29 Dec 2007 17:11:29 -0000

Using -O4 requires support from the system linker, because the files
written out are LLVM bitcode files rather than object files.

--Owen

On Dec 29, 2007, at 11:43 AM, Jack Howarth wrote:

>   What are the current limitations of using -O4 in
> llvm-gcc-4.2? As a first test, I compiled the molscript
> program first as -O3 and it works fine. However if i
> try to compile the same code as -O4, the build fails with...
>
> ar -cru clib.a args.o str_utils.o dynstring.o err.o indent.o
> vector3.o matrix3.o quaternion.o body3d.o extent3d.o io_utils.o
> colour.o key_value.o named_data.o double_hash.o hermite_curve.o
> element_lookup.o aa_lookup.o mol3d.o mol3d_init.o mol3d_io.o
> mol3d_utils.o mol3d_chain.o mol3d_secstruc.o sgi_image.o vrml.o
> ogl_utils.o ogl_body.o ogl_bitmap_character.o
> llvm-gcc -o molscript -O4 molscript.tab.o global.o lex.o col.o
> select.o state.o graphics.o segment.o coord.o xform.o postscript.o
> raster3d.o vrml.o regex.o opengl.o image.o eps_img.o sgi_img.o
> jpeg_img.o png_img.o   clib/clib.a \
>              -L/sw/lib -lglut -lGLU -lGL /System/Library/Frameworks/
> OpenGL.framework/Libraries/libGL.dylib -L/usr/X11R6/lib -lX11 -lXi -
> lXmu -L/sw/lib -ljpeg -L/sw/lib -lpng  -lz -bind_at_load -lm
> ld: warning in molscript.tab.o, file is not of required architecture
> ld: warning in global.o, file is not of required architecture
> ld: warning in lex.o, file is not of required architecture
> ld: warning in col.o, file is not of required architecture
> ld: warning in select.o, file is not of required architecture
> ld: warning in state.o, file is not of required architecture
> ld: warning in graphics.o, file is not of required architecture
> ld: warning in segment.o, file is not of required architecture
> ld: warning in coord.o, file is not of required architecture
> ld: warning in xform.o, file is not of required architecture
> ld: warning in postscript.o, file is not of required architecture
> ld: warning in raster3d.o, file is not of required architecture
> ld: warning in vrml.o, file is not of required architecture
> ld: warning in regex.o, file is not of required architecture
> ld: warning in opengl.o, file is not of required architecture
> ld: warning in image.o, file is not of required architecture
> ld: warning in eps_img.o, file is not of required architecture
> ld: warning in sgi_img.o, file is not of required architecture
> ld: warning in jpeg_img.o, file is not of required architecture
> ld: warning in png_img.o, file is not of required architecture
> Undefined symbols:
>  "_main", referenced from:
>      start in crt1.10.5.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make: *** [molscript] Error 1
>
> where all of the object files are reported by the file program
> as 'data' instead of 'Mach-O object ppc'. Thanks in advance
> for any clarifications.
>                    Jack
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev