[erlang-questions] Can't build on new Sun T2?

Mikael Pettersson mikpe@REDACTED
Fri Oct 5 08:56:03 CEST 2007


On Thu, 04 Oct 2007 13:55:23 -0700, Tim Bray wrote:
> sca12-3200a-32 ~/dev/otp_src_R11B-5/> uname -a
> SunOS sca12-3200a-32 5.10 Generic_120011-13 sun4v sparc SUNW,SPARC- 
> Enterprise-****
> 
> ./configure showed no problems.
> 
> sca12-3200a-32 ~/dev/otp_src_R11B-5/> gmake
> ... hundreds of lines omitted ...
> 
> ld: fatal: relocation error: R_SPARC_32: file obj/sparc-sun- 
> solaris2.10/opt/hybrid/hipe_sparc_glue.o: symbol <unknown>: offset  
> 0xfcec0f6e is non-aligned
> ld: fatal: relocation error: R_SPARC_32: file obj/sparc-sun- 
etc

Here we go again. If you look in the mailing list archives you
will find that this issue is reported a few times per year.

It's a toolchain bug. You're using a gcc that's been configured
to use GNU as but Sun's ld. That combination fails to handle some
of the assembly code in the native-code compiler's runtime system,
resulting in the linker errors you quoted.

Rebuilding gcc to use Sun's as and Sun's ld solves the problem.

(Also, the issue doesn't occur on SPARC/Linux where gcc uses
GNU as and GNU ld. It's only GNU as + Sun's ld that bugs out.)

The native code compiler's SPARC backend and runtime system are
scheduled for a complete rewrite later this year, at which time
this issue _may_ finally be solved (or not, since we don't know
why the issue occurs in the first place).

The linker errors can be avoided by doing ./configure --disable-hipe
before make, but then you lose the native-code Erlang compiler.

/Mikael



More information about the erlang-questions mailing list