Bug 200322 - lang/erlang failes to build on armv6 with HiPE enabled
Summary: lang/erlang failes to build on armv6 with HiPE enabled
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Only Me
Assignee: Jimmy Olgeni
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-19 08:39 UTC by Andreas Andersson
Modified: 2015-06-29 06:06 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (olgeni)


Attachments
make configure output (39.93 KB, text/plain)
2015-05-19 13:35 UTC, Andreas Andersson
no flags Details
armv6 fix (362 bytes, patch)
2015-05-19 13:56 UTC, Mikael Urankar
no flags Details | Diff
Fix for HiPe in lang/erlang (447 bytes, patch)
2015-05-20 18:44 UTC, Andreas Andersson
no flags Details | Diff
Erlang patch (370 bytes, patch)
2015-05-20 19:02 UTC, Andreas Andersson
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Andersson 2015-05-19 08:39:40 UTC
On a Raspberry PI 2 the lang/erlang port fails to build with HiPE enabled. Disabling HiPE and build works.

CC	obj/armv6-portbld-freebsd11.0/opt/smp/erl_bif_info.o
beam/erl_bif_info.c:2109:10: error: use of undeclared identifier 'am_arm'; did you mean 'alarm'?
        BIF_RET(hipe_arch_name);
                ^~~~~~~~~~~~~~
                alarm
hipe/hipe_arm.h:39:24: note: expanded from macro 'hipe_arch_name'
#define hipe_arch_name  am_arm
                        ^
beam/bif.h:118:28: note: expanded from macro 'BIF_RET'
#define BIF_RET(x) return (x)
                           ^
/usr/include/unistd.h:323:15: note: 'alarm' declared here
unsigned int     alarm(unsigned int);
                 ^
1 error generated.
armv6-portbld-freebsd11.0/Makefile:685: recipe for target 'obj/armv6-portbld-freebsd11.0/opt/smp/erl_bif_info.o' failed
gmake[5]: *** [obj/armv6-portbld-freebsd11.0/opt/smp/erl_bif_info.o] Error 1
gmake[5]: Leaving directory '/usr/ports/lang/erlang/work/otp_src_17.5/erts/emulator'
/usr/ports/lang/erlang/work/otp_src_17.5/make/run_make.mk:34: recipe for target 'opt' failed
gmake[4]: *** [opt] Error 2
gmake[4]: Leaving directory '/usr/ports/lang/erlang/work/otp_src_17.5/erts/emulator'
Makefile:60: recipe for target 'smp' failed
gmake[3]: *** [smp] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/erlang/work/otp_src_17.5/erts'
Makefile:443: recipe for target 'emulator' failed
gmake[2]: *** [emulator] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/erlang/work/otp_src_17.5'
*** Error code 1
Comment 1 Andreas Andersson 2015-05-19 13:35:24 UTC
Created attachment 156940 [details]
make configure output

Log from make configure as requested by port maintainer.
Comment 2 Andreas Andersson 2015-05-19 13:36:33 UTC
Port maintainer wanted to know the following in  previous email:

Output from uname -m:
arm

"Does it compile without HiPE enable?"
Yes

Let me know if you want more information.
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2015-05-19 13:56:05 UTC
Created attachment 156941 [details]
armv6 fix

Hi,

Can you try the attached patch?
Comment 4 Andreas Andersson 2015-05-19 14:19:39 UTC
(In reply to mikael.urankar from comment #3)
Got the same error with that patch.
Comment 5 Andreas Andersson 2015-05-19 15:49:45 UTC
Maybe I applied it incorrectly?

root@rpi2:/usr/ports/lang/erlang # patch < test.patch
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- /dev/null
|+++ files/patch-erts_configure.in
--------------------------
Patching file files/patch-erts_configure.in using Plan A...
Empty context always matches.
Hunk #1 succeeded at 1.
done
Comment 6 Jimmy Olgeni freebsd_committer freebsd_triage 2015-05-19 15:50:56 UTC
(In reply to a.andersson.thn from comment #5)

Hi, can you check if the patch file ended up in files/ or in the main port directory?
Comment 7 Andreas Andersson 2015-05-19 16:05:10 UTC
The patch created this file: files/patch-erts_configure.in
Comment 8 Andreas Andersson 2015-05-20 18:44:26 UTC
Created attachment 156980 [details]
Fix for HiPe in lang/erlang

Turns out the fix was rather easy. Mikaël Urankar told me he got it to compile with:

.if ${ARCH} == armv6
MAKE_ARGS+=     ARCH=arm
.endif

This allows HiPE in erlang to be compiled on arm. Tested and verified to work as well.
Comment 9 Andreas Andersson 2015-05-20 19:02:43 UTC
Created attachment 156981 [details]
Erlang patch

As per Mikaël Urankars direction I am submitting a cleaned up diff.
Comment 10 Jimmy Olgeni freebsd_committer freebsd_triage 2015-05-20 19:09:11 UTC
(In reply to a.andersson.thn from comment #9)

Great news - are you able to build erlang-runtime15 and 16 with this patch?
Comment 11 Andreas Andersson 2015-05-20 19:52:14 UTC
(In reply to Jimmy Olgeni from comment #10)
Nope, I only tried lang/erlang. I can check tomorrow though.
Comment 12 commit-hook freebsd_committer freebsd_triage 2015-05-20 20:10:55 UTC
A commit references this bug:

Author: olgeni
Date: Wed May 20 20:09:55 UTC 2015
New revision: 386887
URL: https://svnweb.freebsd.org/changeset/ports/386887

Log:
  Unbreak build on armv6.

  PR:		200322
  Submitted by:	a.andersson.thn@gmail.com

Changes:
  head/lang/erlang/Makefile
  head/lang/erlang-runtime17/Makefile
Comment 13 Jimmy Olgeni freebsd_committer freebsd_triage 2015-05-26 11:25:46 UTC
If you are able check the runtime ports for armv6 I can update them too :)