[erlang-patches] fix mipsel compilation

Samuel <>
Thu Nov 17 10:02:33 CET 2011


I'm resending some emails since for some reason all the emails I sent
from my old account in the last few months didn't reach the list.

Back in august I had a minor issue crosscompiling erlang, here is a
possible fix:

To compile for mipsel (with codesourcery toolchain) I have to pass
CFLAGS=-EL and LDFLAGS=-EL. Actually, my crossconfiguration is like

CFLAGS="-Os -EL -I/home/samuel/cross_compiled/include" LDFLAGS="-EL
-L/home/samuel/cross_compiled/lib" ./configure -host=mips-linux-gnu
-target=mips-linux-gnu --disable-hipe

This would file because DED_LDFLAGS are not updated accordingly. In
make/mips-unknown-linux-gnu/otp_ded.mk they will read
DED_LDFLAGS = -shared -Wl,-Bsymbolic

When the right value is (ignoring -L that is not really necessary to
compile any driver)
DED_LDFLAGS = -EL -shared -Wl,-Bsymbolic

CFLAGS are set correctly, so I think this could be an error in the
configuration files. An alternative to this fix is setting all the
DED_ variables in the compilation line, but this feels awkward.

You can fetch my (very simple) patch from

git fetch git://github.com/samuelrivas/otp.git fix-mipsel-compilation

I guess the same problem applies from non-linux builds, but I haven't tested it



More information about the erlang-patches mailing list