erlang-runtime21 builds successfully on amd64 FreeBSD 11.2-STABLE r336056M amd64 1102501 1102501, using both clang 6.0.0 and gcc7; however fails on i386 with an "Alignment error", as follows: erlc -W +debug_info -Werror +inline +warn_unused_import +warn_export_vars -o../ebin hipe_rtl.erl beam/erl_alloc_util.c:6249:erts_alcu_start: Alignment error gmake[4]: *** [/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/make/i386-portbld-freebsd11.2/otp.mk:124: ../ebin/hipe_rtl.beam] Abort trap gmake[4]: Leaving directory '/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/lib/hipe/rtl' gmake[3]: *** [/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/make/otp_subdir.mk:29: opt] Error 2 gmake[3]: Leaving directory '/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/lib/hipe' gmake[2]: *** [/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/make/otp_subdir.mk:29: opt] Error 2 gmake[2]: Leaving directory '/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/lib' gmake[1]: *** [Makefile:572: secondary_bootstrap_build] Error 2 gmake[1]: Leaving directory '/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0' *** Error code 1 (similar failure with clang6 and gcc7). No options were selected, the defaults were used DIRTY=on: Enable Dirty schedulers HIPE=on: Build native HiPE compiler KQUEUE=on: Enable Kernel Poll (kqueue) support OPENSSL=on: SSL/TLS support via OpenSSL SCTP=on: Enable SCTP support THREADS=on: Threading support
Maintainer informed via mail
(In reply to dewayne from comment #0) Unfortunately the alignment error remains on FreeBSD 11.2-STABLE r336359M i386 1102501 1102501 trying to build lang/erlang-runtime21, PORTVERSION= 21.0.3. The upgrade from 21.0.2 wasnt a fix clang 6.0.1 erlc -W +debug_info -Werror +inline +warn_unused_import +warn_export_vars -o../ebin hipe_rtl.erl beam/erl_alloc_util.c:6249:erts_alcu_start: Alignment error gmake[4]: *** [/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/make/i386-portbld-freebsd11.2/otp.mk:131: ../ebin/hipe_rtl.beam] Abort trap gcc 7 set -e; LLVM_PROFILE_FILE="obj/i386-portbld-freebsd11.2/opt/smp/erlc-%m.profraw" \ ERL_FLAGS="-emu_type prof +S 1" erlc -W -DPGO \ -o obj/i386-portbld-freebsd11.2/opt/smp test/estone_SUITE.erl > obj/i386-portbld-freebsd11.2/opt/smp/PROFILE_LOG gmake[5]: *** [i386-portbld-freebsd11.2/Makefile:731: obj/i386-portbld-freebsd11.2/opt/smp/PROFILE] Bus error gmake[5]: Leaving directory '/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/erts/emulator' gmake[4]: *** [/var/ports/usr/ports/lang/erlang-runtime21/work/otp_src_21.0/make/run_make.mk:35: opt] Error 2 erlang 21.0.3 does build on amd64. erlang 19, and 20 build successfully on i386. All were built (or attempted) using the same options on i386 and amd64 at same OS revision level (as above).
Dewayne reported this issue upstream: https://bugs.erlang.org/browse/ERL-677 And the Erlang/OTP team came with a patch which fixes the problem (see the link above). I'm going to commit the patch to both lang/erlang-runtime20 and lang/erlang-runtime21. Thank you Dewayne!
A commit references this bug: Author: dumbbell Date: Mon Jul 30 09:14:41 UTC 2018 New revision: 475871 URL: https://svnweb.freebsd.org/changeset/ports/475871 Log: lang/erlang-runtime{20,21}: Add patch to fix build on i386 Those two ports fail to build on FreeBSD/i386 (all versions) for quite some time. The Erlang/OTP team provided a patch after Dewayne Geraghty reported the issue upstream. Here is the entry in the Erlang/OTP bug tracker: https://bugs.erlang.org/browse/ERL-677 The patch was successfully tested on FreeBSD 10.4 and 11.1, both i386 and amd64. Dewayne also confirmed success on FreeBSD 11.2. PR: 229600 Reported by: Dewayne Geraghty <dewayne@heuristicsystems.com.au> Obtained from: https://bugs.erlang.org/browse/ERL-677 MFH: 2018Q3 Changes: head/lang/erlang-runtime20/Makefile head/lang/erlang-runtime20/files/patch-erts_emulator_beam_erl__alloc.c head/lang/erlang-runtime21/Makefile head/lang/erlang-runtime21/files/patch-erts_emulator_beam_erl__alloc.c
Thank-you for assembling the patch, and to the Erlang VM team for isolating and rectifying the problem. :)
A commit references this bug: Author: dumbbell Date: Tue Jul 31 14:50:07 UTC 2018 New revision: 476004 URL: https://svnweb.freebsd.org/changeset/ports/476004 Log: MFH: r475871 lang/erlang-runtime{20,21}: Add patch to fix build on i386 Those two ports fail to build on FreeBSD/i386 (all versions) for quite some time. The Erlang/OTP team provided a patch after Dewayne Geraghty reported the issue upstream. Here is the entry in the Erlang/OTP bug tracker: https://bugs.erlang.org/browse/ERL-677 The patch was successfully tested on FreeBSD 10.4 and 11.1, both i386 and amd64. Dewayne also confirmed success on FreeBSD 11.2. PR: 229600 Reported by: Dewayne Geraghty <dewayne@heuristicsystems.com.au> Obtained from: https://bugs.erlang.org/browse/ERL-677 Approved by: portmgr (riggs) Changes: _U branches/2018Q3/ branches/2018Q3/lang/erlang-runtime20/Makefile branches/2018Q3/lang/erlang-runtime20/files/patch-erts_emulator_beam_erl__alloc.c branches/2018Q3/lang/erlang-runtime21/Makefile branches/2018Q3/lang/erlang-runtime21/files/patch-erts_emulator_beam_erl__alloc.c