Opened 13 years ago

Closed 12 years ago

#30516 closed defect (fixed)

erlang @R14B03_1+ssl fails to build on OS X 10.6

Reported by: easye Owned by: bfulgham@…
Priority: Normal Milestone:
Component: ports Version: 2.0.0
Keywords: Cc: andre.david@…, jrjsmrtn, harry.weppner@…, rhanneken@…
Port: erlang

Description

erlang @R14B03_1+ssl fails to build on OS X 10.6 hanging at the following step:

[…]
make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-R14B03/lib/hipe/rtl'
erlc -W  +debug_info +inline -o../ebin hipe_rtl.erl
(no error logger present) error: "Error in process <0.1.0> with exit value: {{badfun,[<<5 bytes>>,<<142 bytes>>,<<9 bytes>>,<<3 bytes>>,<<2 bytes>>,<<5 bytes>>,<<14 bytes>>,<<2 bytes>>,<<8 bytes>>,<<8 bytes>>,<<5 bytes>>,<<7 bytes>>,<<5 bytes>>,<<11 bytes>>,<<2 bytes>>,<<11 bytes>>,<<15 bytes>>,<<4 bytes>>,<<145 bytes>>,<<5 bytes>>,<<1 byte>>,<<7 bytes>>,<<10 bytes>>,<<7 bytes>>,<<6 bytes>>,<<7 bytes>>,<<7 bytes>>,<<6 bytes>>,<<12 bytes>>]},[{erlang,apply,2}]}\n"

Attachments (2)

Portfile (7.5 KB) - added by easye 13 years ago.
Erlang Portfile working on OS X 10.6 with XCode 4
Portfile.patch (832 bytes) - added by dmitry.gladkov@… 13 years ago.
Includes previous Portfile's fix for 10.6 and possible fix for Lion

Download all attachments as: .zip

Change History (16)

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to bfulgham@…

comment:2 Changed 13 years ago by andre.david@…

Cc: andre.david@… added

Cc Me!

comment:3 Changed 13 years ago by jrjsmrtn

Cc: jrjsmrtn@… added

Cc Me!

comment:4 Changed 13 years ago by harry.weppner@…

Cc: harry.weppner@… added

Cc Me!

comment:5 Changed 13 years ago by easye

Apparently related to #30012

It looks like this error occurs when one has Xcode 4 installed on OS X 10.6, as the configure process on my machine picks up the llvm-gcc-4.2 compiler.

Patching as follows enables the build to get past the hipe error on OS X 10.6:

Index: Portfile
===================================================================
--- Portfile	(revision 82103)
+++ Portfile	(working copy)
@@ -102,6 +102,11 @@
     # This is a workaround.
     patchfiles-append   patch-erts_emulator_sys_unix_ddll.c.diff
     configure.ldflags-append -framework CoreFoundation
+
+    configure.cflags-delete -O2
+    configure.cxxflags-delete -O2
+    configure.cflags-append -O0
+    configure.cxxflags-append -O0
 }
 
 platform darwin 11 {

The "correct" thing is probably to first detect if XCode 4 is installed on OS X 10.6, then change the compiler flags. Can someone reference an example of such logic somewhere?

Or should we just force the use of gcc-4.2 under OS X 10.6?

===================================================================
--- Portfile	(revision 82103)
+++ Portfile	(working copy)
@@ -102,6 +102,8 @@
     # This is a workaround.
     patchfiles-append   patch-erts_emulator_sys_unix_ddll.c.diff
     configure.ldflags-append -framework CoreFoundation
+    
+    configure.compiler  gcc-4.2
 }
 
 platform darwin 11 {

comment:6 Changed 13 years ago by oleksiy.khilkevich@…

Thanks so much for this! I was totally new to macports and in just few hours had to grok it upside down, just to find out why the f*k erlang build takes forever to complete. without any visible reason.

Any info on which particular optimization caused this?

comment:7 Changed 13 years ago by wbunton@…

Same Problem. Erlang hangs when installing.

Xcode 4.1.1 installed OSX 10.6.8

This is the verbose output from port install erlang (the last several lines anyway where things go wonky)

Entering application hipe

make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-R14B03/lib/hipe/rtl' erlc -W +debug_info +inline -o../ebin hipe_rtl.erl (no error logger present) error: "Error in process <0.1.0> with exit value: {{badfun,[<<5 bytes>>,<<142 bytes>>,<<9 bytes>>,<<3 bytes>>,<<2 bytes>>,<<5 bytes>>,<<14 bytes>>,<<2 bytes>>,<<8 bytes>>,<<8 bytes>>,<<5 bytes>>,<<7 bytes>>,<<5 bytes>>,<<11 bytes>>,<<2 bytes>>,<<11 bytes>>,<<15 bytes>>,<<4 bytes>>,<<145 bytes>>,<<5 bytes>>,<<1 byte>>,<<7 bytes>>,<<10 bytes>>,<<7 bytes>>,<<6 bytes>>,<<7 bytes>>,<<7 bytes>>,<<6 bytes>>,<<12 bytes>>]},[{erlang,apply,2}]}\n"

Hope it helps.

comment:8 in reply to:  6 Changed 13 years ago by easye

Replying to oleksiy.khilkevich@…:

Thanks so much for this! I was totally new to macports and in just few hours had to grok it upside down, just to find out why the f*k erlang build takes forever to complete. without any visible reason.

Any info on which particular optimization caused this?

According to the link http://llvm.org/bugs/show_bug.cgi?id=7883 from #30012 the problem stems from using LLVM itself rather than any particular optimization.

Changed 13 years ago by easye

Attachment: Portfile added

Erlang Portfile working on OS X 10.6 with XCode 4

comment:9 Changed 13 years ago by rhanneken@…

Cc: rhanneken@… added

Cc Me!

Changed 13 years ago by dmitry.gladkov@…

Attachment: Portfile.patch added

Includes previous Portfile's fix for 10.6 and possible fix for Lion

comment:10 Changed 13 years ago by bfulgham@…

Please try the new R14B04 sources. The upstream Erlang team claims to have fixed this in the current source tree.

comment:11 Changed 13 years ago by andre.david@…

erlang @R14B04_1+ssl works for me.

comment:12 Changed 13 years ago by bfulgham@…

Resolution: fixed
Status: newclosed

comment:13 Changed 12 years ago by chad@…

Resolution: fixed
Status: closedreopened

unfortunately it looks like this bug has reappeared.

running OS X 10.7.2, Xcode 4.2.1, and getting the same error message previously reported.

as mentioned in a previous post, adding the following to the Portfile fixed the problem:

  configure.cflags-delete -O2
  configure.cxxflags-delete -O2
  configure.cflags-append -O0
  configure.cxxflags-append -O0

comment:14 Changed 12 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed

R15B builds fine.

Note: See TracTickets for help on using tickets.