[erlang-questions] Building 64-bit Erlang on Solaris 11

Mikael Pettersson <>
Thu Oct 2 09:57:35 CEST 2008

Paul Fisher writes:
 > Joel Reymont wrote:
 > > ./configure --prefix=/opt/local --enable-64bit CFLAGS='-m64'
 > > ...
 > > gmake
 > > ...
 > > ld: fatal: file obj/i386-pc-solaris2.11/opt/plain/erl_main.o: wrong
 > > ELF class: ELFCLASS64
 > > ld: fatal: File processing errors. No output written to /home/admin/
 > > otp_src_R12B-4/bin/i386-pc-solaris2.11/beam
 > > 
 > > What am I doing wrong?
 > > 
 > >         Thanks, Joel
 > > 
 > > P.S. Omitting CFLAGS='-m64' builds a 32-bit Erlang.
 > Not so straight forward (esp. if you use linked in drivers as we do). 
 > Here is what it takes

I believe the problem is that the otp build system probably
overrides CFLAGS, which would cancel any user setting of CFLAGS.
What I and others typically do for 64-bit builds is to set
CC='gcc -m64' or to point CC to a script that always adds -m64.

The real fix IMO is not to add --enable-64bit because in theory
there can be other compilation mode defaults the user may want
to override. Instead the build system should be made to respect
the user's CFLAGS.

More information about the erlang-questions mailing list