[erlang-questions] Build/release 18.0 with enable-native-libs doesn't work

Bruno Matos Tavares tavaresbm@REDACTED
Thu Aug 13 00:12:52 CEST 2015


Hi Mikael,

I’ve tried 1. and 2. and it compiles but not with native libs.

1> code:is_loaded(gen_server).
{file,"/opt/erlang//lib/stdlib-2.5/ebin/gen_server.beam"}
2> code:is_loaded(gen_server).
{file,”/opt/erlang//lib/stdlib-2.5/ebin/gen_server.beam"}

Thank you,
Bruno.


> On 11 Aug 2015, at 21:00, Mikael Pettersson <mikpelinux@REDACTED> wrote:
> 
> Bruno Matos Tavares writes:
>> Hi,
>> 
>> I'm trying to build Erlang on Amazon Linux AMI 2015.03 (HVM) (c3.4xlarge) without success. 
>> 
>> After some research I've bumped into this post https://groups.google.com/forum/#!searchin/erlang-programming/enable-native-libs/erlang-programming/qFJmWtUQHuA/EBHC750-4UYJ <https://groups.google.com/forum/#!searchin/erlang-programming/enable-native-libs/erlang-programming/qFJmWtUQHuA/EBHC750-4UYJ> but the recipe doesn't work either.  
>> 
>> ./configure --prefix=/usr/local \
>> --disable-debug \
>> --enable-silent-rules \
>> --enable-m64-build \
>> --enable-threads \
>> --enable-smp-support \
>> --enable-kernel-poll \
>> --enable-hipe \
>> --enable-native-libs \
>> --with-ssl=/usr/bin \
>> --without-docs \
>> --without-wx \
>> --without-javac \
>> --without-odbc
>> 
>> 
>> make[2]: Entering directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib/hipe'
>> Makefile:72: warning: overriding recipe for target `clean'
>> /home/ec2-user/tmp/tmp_1/otp_src_18.0/make/otp_subdir.mk:29: warning: ignoring old recipe for target `clean'
>> === Entering application hipe
>> make[3]: Entering directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib/hipe/rtl'
>> ERLC   ../ebin/hipe_rtl.beam
>> hipe_rtl.erl: internal error in native_compile;
>> crash reason: undef
>> 
>>  in function  hipe:compile/4
>>     called as hipe:compile(hipe_rtl,[],
>> <<70,79,82,49,0,0,235,184,66,69,65,77,65,116,111,109,0,0,12,228,0,0,1,36,8,
>>   104,105,112,101,95,114,116,108,6,109,107,95,114,116,108,3,114,116,108,7,114,
>>   116,108,95,102,117,110,10,114,116,108,95,112,97,114,97,109,115,14,114,116,
>>   108,95,105,115,95,99,108,111,115,117,114,101,11,114,116,108,95,105,115,95,
>>   108,101,97,102,8,114,116,108,95,99,111,100,101,15,114,116,108,95,99,111,100,
>>   101,95,117,112,100,97,116,101,6,101,114,108,97,110,103,10,115,101,116,101,
>>   108,101,109,101,110,116,5,101,114,114,111,114,8,114,116,108,95,100,97,116, [..]
>> 57,201,58,201,59,201,60,201,69,201,70,201,71,201,72,201,73,201,74,201,75,
>>   201,76,201,77,201,142,201,117,201,87,201,199,201,202,201,207,201,208,201,
>>   211,201,213,201,214,201,215,201,217,201,218,201,219,201,227,201,228,201,225,
>>   201,232,201,235,201,236,201,240,201,242,201,247,233,2,233,6,233,10,233,12,
>>   233,22,233,23,233,25,233,28,233,30,41,199,0,0>>,
>> [])
>>  in call from compile:native_compile_1/1 (compile.erl, line 1361)
>>  in call from compile:'-internal_comp/4-anonymous-1-'/2 (compile.erl, line 295)
>>  in call from compile:fold_comp/3 (compile.erl, line 321)
>>  in call from compile:internal_comp/4 (compile.erl, line 305)
>>  in call from compile:'-do_compile/2-anonymous-0-'/2 (compile.erl, line 155)
>> make[3]: *** [../ebin/hipe_rtl.beam] Error 1
>> make[3]: Leaving directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib/hipe/rtl'
>> make[2]: *** [opt] Error 2
>> make[2]: Leaving directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib/hipe'
>> make[1]: *** [opt] Error 2
>> make[1]: Leaving directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib'
>> make: *** [libs] Error 2
>> 
>> However when I just use `enable-native-libs' it does `make'.
>> 
>> Is it something wrong with my config or some limitation on AWS Linux that I'm not aware of.
>> 
>> Thank you,
>> Bruno.
>> 
>> full log (configure + make):
>> [ tmp_1]$ cat output.log
>> Ignoring the --cache-file argument since it can cause the system to be erroneously configured
>> Disabling caching
>> checking build system type... x86_64-unknown-linux-gnu
>> checking host system type... x86_64-unknown-linux-gnu
>> checking for gcc... gcc
> 
> I can reproduce this error on Fedora 20 Linux / x86_64: it's triggered by the --enable-m64-build
> option, which is totally weird:
> 
> - gcc on x86_64-linux defaults to -m64 (except on obscure systems defaulting to -x32)
>  so the -m64 added by --enable-m64-build shouldn't have any effect, but it does; and
> 
> - building with a fake gcc script that prepends -m64 to the command line arguments doesn't
>  cause this (or any other) error.
> 
> I tried comparing the bin/ and erts/ directories from builds with and without --enable-m64-build,
> but every single object file diffed, and numerous generated files also diffed (like symbolic
> constants being listed in different order and with different values).
> 
> Anyway, there are three easy workarounds:
> 
> 1. Drop the --enable-m64-build option, it's unnecessary on normal systems.
> 2. ./configure without the option but with CFLAGS='-O2 -m64' in the environment
> 3. adjust PATH to point to a 'gcc' script that contains
> ==snip==
> #!/bin/sh
> exec /usr/bin/gcc -m64 "@*"
> ==snip==
> (replace /usr/bin/ if needed) then ./configure without the option and make.
> 
> /Mikael




More information about the erlang-questions mailing list