[erlang-bugs] Building R13B01 on IRIX problems

Patrick Baggett baggett.patrick@REDACTED
Fri Jun 26 08:55:56 CEST 2009


On Thu, Jun 25, 2009 at 6:34 PM, Mikael Pettersson <mikpe@REDACTED> wrote:

> Patrick Baggett writes:
>  > I'm having a problem building Erlang/OTP R13B01 on IRIX using MIPSpro C
>  > compiler v7.4.4. Previously, some of the R12 releases build with a bit
> of
>  > convincing, but now it doesn't seem to want to work. I am having two
> issues:
>
> Did you report those issues? I don't recall ever seeing any reports about
> IRIX.
>

I never reported  isse #1 that I was having then with uio.h. This is me
reporting it now. As mentioned in previous email, #2 is a new  (and more
serious) issue.


>
>  > 2) Problem that is new for R13B+, possibly earlier. I get linker errors
> to
>  > the "functions" __builtin_return_address() and __builtin_expect(). These
> are
>  > GCC-specific extensions to the C language which are not available to
>  > MIPSpro. Usually this is solved by #define'ing a macro for them. The
> modules
>  > with linking errors are sys_float.c and ethread.c. The configure script
>  > detects whether or not GCC is being used -- shouldn't the system be able
> to
>  > handle when GCC isn't used?
>
> Correct, using GCC should be optional.
>
> Prior to the linkage error there ought to be some compile-time warnings
> about calling undeclared functions (those __builtin_*()s).
> Can you see if these warnings are present and if so where they occur and
> if the compiler identifies their origin? (typically .h files)
>

I did not see any warning about it, surprisingly. The only thing that I
found was in erts/emulator/sys/erl_sys_unix.h about __builtin_expect, but
nothing about __builtin_return_address. Anyone help here?




> As far as handling !GCC, that's normally done by #ifdef tests on __GNUC__
> not by heavy-weight autoconf machinery.
>
> What options did you pass to ./configure before attempting the build?
>

I gave it "--enable-threads --disable-hipe"


>
> Out of curiosity, why aren't you using GCC? Does MIPSpro generate better
> code than gcc-4.x? (gcc-3.x and older are completely obsolete). Also,
> you should know that not using GCC disables an important optimisation
> in the core Erlang VM interpreter.
>

MIPSpro gives vastly more efficient code than GCC 4 usually on the order of
15-25% for integer stuff on R4x00 processors, even larger gap on R10000 and
later due to the multiple functional units on the processor and GCC's lack
of knowledge of them (no flags to specify R10000+). For floating point, one
can expect yet higher speed-ups. The issue doesn't seem to be the ability to
correctly optimize code at a higher level, but that the instruction stream
is god awful, and on a computer running with 5 insn/cycle but a much lower
clock speeds than x86, that's a big deal. Maybe one day I can compare
performances again. YMMV. I didn't know that not using GCC caused a lack of
optimization at source level in the emulator.


More information about the erlang-bugs mailing list