[erlang-questions] Build/release 18.0 with enable-native-libs doesn't work
Bruno Matos Tavares
Thu Aug 13 00:12:52 CEST 2015
I’ve tried 1. and 2. and it compiles but not with native libs.
> On 11 Aug 2015, at 21:00, Mikael Pettersson <mikpelinux@REDACTED> wrote:
> Bruno Matos Tavares writes:
>> 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 \
>> make: 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: 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,,
>> 108,101,109,101,110,116,5,101,114,114,111,114,8,114,116,108,95,100,97,116, [..]
>> 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: *** [../ebin/hipe_rtl.beam] Error 1
>> make: Leaving directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib/hipe/rtl'
>> make: *** [opt] Error 2
>> make: Leaving directory `/home/ec2-user/tmp/tmp_1/otp_src_18.0/lib/hipe'
>> make: *** [opt] Error 2
>> make: 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,
>> 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
> exec /usr/bin/gcc -m64 "@*"
> (replace /usr/bin/ if needed) then ./configure without the option and make.
More information about the erlang-questions