[erlang-questions] build 64bit Erlang on Solairs

Raymond Xiong Raymond.Xiong@REDACTED
Thu May 1 14:24:09 CEST 2008


I am trying to build 64bit Erlang on Soalris, but encountered
some issue. Below are the details, thanks for any suggestion
in advance.

I used the following commands(especially, I used -m64 flag to
tell gcc to generate 64bit code, and used "-R/usr/lib/64
-L/usr/lib/64" to tell ld use 64bit lib):

# echo $ENV
CC=gcc CFLAGS=-m64 LDFLAGS="-R/usr/lib/64 -L/usr/lib/64" CPPFLAGS="-I /usr/include/gd2" CXX=g++
# env $ENV configure --with-ssl=/usr/sfw --enable-dynamic-ssl-lib
# env $ENV gmake install 

The above command could generate 64bit .o object files
successfully, but it failed when trying to generate beam.bmp
executable file. Here is the log:

gcc -o /export/erlang/usr/src/cmd/erlang/root/otp_src_R12B-1/bin/sparc-sun-solaris2.11/beam.smp -R/usr/lib/64 -L/usr/lib/64 obj/sparc-sun-solaris2.11/opt/smp/erl_main.o ...(snipped)
ld: fatal: file obj/sparc-sun-solaris2.11/opt/smp/erl_main.o:
wrong ELF class: ELFCLASS64

>From what I know, the above error message means that ld was
trying to generate 32bit binary file, but found the object
files passed to it were 64bit files.

According to ld(1) man page on Solaris, ld can guess to generate
32bit binary file or 64bit binary file: 

     "No command-line option is  required  to  distinguish 32-bit
     objects  or  64-bit  objects.  The  link-editor uses the ELF
     class of the first relocatable object on the command-line to
     govern  the  mode  in which to operate." 

But why in this case it didn't get it right? I guess(I am not
sure, it is just my guess) it was due to the fact that ssl 
encryption library I specified on configure command line was 
32bit.

Solaris does have 64bit ssl lib, it is under /usr/sfw/lib/64.
But since Erlang use --with-ssl for both lib and header files, I
cannot specify "--with-ssl=/usr/sfw/lib/64".

How can I specify to use 64bit ssl lib? 

I guess there must be many people who compile 64bit Erlang on
Solaris, I googled this but only found this thread, which
sugested to hard code gcc to "gcc -m64": 

    http://www.erlang.org/pipermail/erlang-questions/2006-July/021336.html

I suppose there must be a better way than that?

Thanks,
Raymond



More information about the erlang-questions mailing list