[erlang-questions] R12.0B and Sparcs

Mikael Pettersson mikpe@REDACTED
Wed Jan 2 14:26:26 CET 2008


Bruce O'Neel writes:
 > Happy New Year,
 > 
 > Here at the home for ancient, disused, and discarded computers we noticed that 
 > while R11B-5 built and ran just fine on Sparcs, R12B-0 did not at least on 
 > OpenBSD and NetBSD.

What exactly is the failure? Compile-time warning from the assembler
on the V9 instructions? Runtime SIGILL?

 > No, not Ultras, the sparcs that Sun hasn't actually shipped for 10+ years, the old
 > V7 and V8 systems (ie SPARCstation 10s, 20s, 4s, and 5s etc).
 > 
 > It turns out that a small change to 
 > 
 > erts/include/internal/ethread.h 
 > 
 > allows them to work again.
 > 
 > 82a83,85
 > > /* BEO  for SPARC OpenBSD only.  Not SPARC64! */
 > > #  define ETHR_DISABLE_NATIVE_IMP
 > >
 > 
 > Basically the above define throws away the optimized assembly code in 
 > erts/include/internal/sparc32 which is V9 (ie Ultra) specific.

The SPARC v9 (actually v8+) code referenced by ethread.h is
essentially the same in R11B-5 and R12B-0.
I suspect some configuration change is causing your problems.

- Did you build R11B-5 with SMP support on SPARC v7/v8?
  If so, was it autoenabled or did you enable it explicitly.
- Does R12B-0 autoenable SMP on BSD/SPARC or do you enable
  it explicitly?

GCC's __sparcv9 macro is unfortunately useless here
(it seems to be set if and only if 64-bit code is generated),
so to disable the v8+/v9 code automatically we'd have to add
a check in erts/configure.in and use that to #define a macro
which we then check in ethread.h.

/Mikael



More information about the erlang-questions mailing list