Tell GCC to build 'SPARC' binaries

Marek Kubica marek@xivilization.net
Mon Feb 9 19:05:00 GMT 2009


Hi,

I am having a small problem with GCC 4.2.3 on Solaris 10/SPARC. I'm
trying to build WebKit 1.0.1 here and after some patching it compiles
but aborts during linking with the following error:

/usr/lib/libicui18n.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status

That sounded strange and indeed, libicu is ok:

$ file /usr/lib/libicui18n.so
/usr/lib/libicui18n.so: ELF 32-bit MSB dynamic lib SPARC Version 1,
dynamically linked, not stripped

Checking the object files that I got gets me this:

$ file libWebCore_la-CSSBorderImageValue.o 
libWebCore_la-CSSBorderImageValue.o:    ELF 32-bit MSB relocatable
SPARC32PLUS Version 1, V8+ Required

I guess its a bad idea to link SPARC32PLUS with SPARC, so I'd need to
tell GCC to generate SPARC binaries.

So I wrote myself this little test program:

#include <stdio.h>

int main()
{
    printf("Hello World\n");
    return 0;
}

Compiling it with

$ gcc -mcpu=v8 -mno-v8plus --save-temps hw.c -o hw

works, but the binary is still SPARC32PLUS. The object files are SPARC,
though.

So my question is: how do I tell the linker to output SPARC binaries.
Or actually: how do I get webkit to link against libicu properly?

regards,
Marek



More information about the Gcc-help mailing list