Opened 8 years ago

Closed 6 years ago

Last modified 20 months ago

#52507 closed defect (fixed)

erlang @19.1_0+hipe+ssl.darwin_10.x86_64 fails to compile/assemble?

Reported by: macportsraf Owned by: ci42
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: snowleopard Cc: ci42
Port: erlang

Description

Upgrading, cleaning, uninstalling and reinstalling didn't work. Here are the errors from the logfile:

:info:build  CC	obj/x86_64-apple-darwin10.8.0/opt/smp/erl_alloc.o
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/.tmp/ccZprxSk.s:9392:Expected comma after symbol-name
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/.tmp/ccZprxSk.s:9392:Rest of line ignored. 1st junk character valued 95 (_).
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/.tmp/ccZprxSk.s:9395:Expected comma after symbol-name
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/.tmp/ccZprxSk.s:9395:Rest of line ignored. 1st junk character valued 95 (_).
:info:build make[3]: *** [obj/x86_64-apple-darwin10.8.0/opt/smp/erl_alloc.o] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-19.1/erts/emulator'
:info:build make[2]: *** [opt] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-19.1/erts/emulator'
:info:build make[1]: *** [smp] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-19.1/erts'
:info:build make: *** [emulator] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-19.1'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_erlang/erlang/work/erlang-19.1" && /usr/bin/make -w all 
:info:build Exit code: 2
:error:build org.macports.build for port erlang returned: command execution failed
:debug:build Error code: CHILDSTATUS 56527 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"portbuild::build_main org.macports.build"
    ("eval" body line 1)
    invoked from within
"eval $procedure $targetname"
:info:build Warning: targets not executed for erlang: org.macports.activate org.macports.build org.macports.destroot org.macports.install

Attachments (2)

main.log (18.2 KB) - added by macportsraf 8 years ago.
complete logfile from a clean install attempt
main-edited.log (2.4 KB) - added by shamekas 6 years ago.
Build log failing at the same place.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 8 years ago by ci42

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

Please provide a complete log from a clean install attempt.

Last edited 8 years ago by ci42 (previous) (diff)

Changed 8 years ago by macportsraf

Attachment: main.log added

complete logfile from a clean install attempt

Changed 6 years ago by shamekas

Attachment: main-edited.log added

Build log failing at the same place.

comment:2 Changed 6 years ago by shamekas

This ticket is almost 4 years old. Is anyone looking into this?

Version 0, edited 6 years ago by shamekas (next)

comment:3 Changed 6 years ago by kencu (Ken)

looks like erlang built fine on 10.6.8 through the 18.x series, but stopped as of the 19.x series. Cause is not obvious from the (previous) log. May or may not be fixable. 10.6.8 has limited ( but loyal! ) users now, and resources on Macports focus on the tickets involving the past three system versions, which affect 99% of users.

Some assistance is needed. Did you try forcing a newer compiler?

comment:4 Changed 6 years ago by kencu (Ken)

the website says erlang still supports 10.6.8, so that is encouraging.

comment:5 Changed 6 years ago by kencu (Ken)

OK. It installs:

$ port -v installed erlang
The following ports are currently installed:
  erlang @20.3_0+hipe+ssl (active) platform='darwin 10' archs='x86_64' date='2018-05-12T10:30:23-0700'

My system is set up with LibcxxOnOlderSystems, and defaults to macports-clang-3.9 as a compiler. I did not see the error you saw above, so presumably my newer compiler got by that error.

However, the build did error out on the patch that was put in for 10.6 some years ago

$ cat patch-erts_emulator_sys_unix_ddll.c.diff
--- erts/emulator/sys/unix/erl_unix_sys_ddll.c.orig
+++ erts/emulator/sys/unix/erl_unix_sys_ddll.c
@@ -49,6 +49,13 @@ static char **errcodes = NULL;
 static int num_errcodes = 0;
 static int num_errcodes_allocated = 0;
 
+static void call_cf_initialize() __attribute__ ((constructor));
+
+static void call_cf_initialize()
+{
+    __CFInitialize();
+}
+
 #define my_strdup(WHAT) my_strdup_in(ERTS_ALC_T_DDLL_ERRCODES, WHAT);
 
 static char *my_strdup_in(ErtsAlcType_t type, char *what)

with this error:

 CC	obj/x86_64-apple-darwin10.8.0/opt/smp/erl_unix_sys_ddll.o
sys/unix/erl_unix_sys_ddll.c:57:5: error: implicit declaration of function '__CFInitialize' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    __CFInitialize();
    ^
1 error generated.

That was funny -- looks like it's not seeing the CoreFoundation headers on 10.6.8. I just deleted that patch, and then it built right on through to the end without any troubles for me.

SO: for you to get it built, without going through the whole LibcxxOnOlderSystems routine, I would try a newer compiler, like this perhaps:

sudo port -v install clang-3.9
sudo port -v install erlang configure.compiler=macports-clang-3.9

you can either take out the patch in the Portfile now, or try it yourself, and if it errors, delete the patched bit from:

erts/emulator/sys/unix/erl_unix_sys_ddll.c

like I did.

Still to be considered: that patch was put in there for a reason, as per the note in the Portfile. It should still work. It would probably be best to figure out why the CFInitialize definition can't be found, and fix that -- possibly by including the header in that file? I'm not sure about that just now.

comment:6 Changed 6 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

In 66b25e1930aecb7642060ecaf1d471f4e830e830/macports-ports (master):

erlang: blacklist gcc-4.2

Fixes: #52507

comment:7 Changed 6 years ago by kencu (Ken)

Interesting. This forces the build to llvm-gcc-4.2, which doesn't error on the implicit function definition like clang-3.9 does:

sys/unix/erl_unix_sys_ddll.c:57: warning: implicit declaration of function ‘__CFInitialize’

and I guess finds the objects at the link, in the end.

If we disable the error for implicit function defs, that should fix the rest of the builds with newer compilers.

Now why, I wonder, don't newer clangs error out on that as well, I wonder?

comment:8 Changed 2 years ago by evanmiller (Evan Miller)

In 2279429148fde0261c7c58c68d05c8fc10f4f2cf/macports-ports (master):

erlang: fix build error on 10.6

See: #52507

comment:9 in reply to:  8 Changed 20 months ago by barracuda156

Replying to evanmiller:

In 2279429148fde0261c7c58c68d05c8fc10f4f2cf/macports-ports (master):

erlang: fix build error on 10.6

See: #52507

By the way on Rosetta it fails. To begin with, llvm-gcc-4.2 begins building for Intel. When --build=powerpc-apple-darwin${os.major} is added, it starts building for PPC, but then fails on:

BROKEN KQUEUE!
Erlang has been compiled with kernel-poll support,
but this OS X version is known to have kernel bugs
when using kernel-poll. You have two options:
 1) update to a newer OS X version (OS X Sierra or newer)
 2) recompile erlang without kernel-poll support
make[5]: *** [../../ebin/megaco_flex_scanner.beam] Error 1
make[5]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0/lib/megaco/src/flex'
make[4]: *** [opt] Error 2
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0/lib/megaco/src/flex'
make[3]: *** [opt] Error 2
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0/lib/megaco/src'
make[2]: *** [opt] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0/lib/megaco'
make[1]: *** [opt] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0/lib'
make: *** [libs] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_erlang/erlang/work/otp_src_25.0" && /usr/bin/make -j1 -w all 
Exit code: 2
Error: Failed to build erlang: command execution failed

So instead for Rosetta blacklist should include *gcc-4.* (then all the rest gets correct automatically, no need to specify --build=).

gcc12 gives a number of warnings:

../include/internal/ethread.h:44: warning: "__ppc__" redefined
   44 | #define __ppc__

But the build succeeds.

Last edited 20 months ago by barracuda156 (previous) (diff)

comment:10 in reply to:  7 Changed 20 months ago by barracuda156

Replying to kencu:

Interesting. This forces the build to llvm-gcc-4.2, which doesn't error on the implicit function definition like clang-3.9 does:

For PPC it does error, though differently.

Note: See TracTickets for help on using tickets.