Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#30032 closed defect (fixed)

perl @5.8.9 build failure on Lion - toke.c fails to compile

Reported by: jpr5@… Owned by: ghosthound
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: lion mountainlion Cc: boo@…, tmandry@…, mfisher@…, st+macports@…, angleto@…, jcmdev0@…, fyu+macports@…, whcordis@…, jasper@…
Port: perl5.8

Description

Perl 5.8.9 fails to build on OSX 10.7 Build 11A511 (Gold Master).

Specifically, it chokes on building toke.c. Off the cuff, it doesn't appear to be a Portfile issue.

Build log snippet:

:info:build `sh  cflags "optimize='-O3'" toke.o`  toke.c
:info:build       CCCMD =  /Developer/usr/bin/llvm-gcc-4.2 -DPERL_CORE -c -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/opt/local/include  -std=c89 -O3  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC
:info:build toke.c:1997:1: warning: use of C99 long long integer constant
:info:build toke.c: In function 'Perl_yylex':
:info:build toke.c:5516: error: lvalue required as unary '&' operand
:info:build toke.c:5516: error: lvalue required as unary '&' operand
:info:build toke.c: In function 'S_pending_ident':
:info:build toke.c:5755: error: lvalue required as unary '&' operand
:info:build toke.c:5755: error: lvalue required as unary '&' operand
:info:build toke.c: In function 'S_scan_heredoc':
:info:build toke.c:9785: error: invalid operands to binary + (have 'char *' and 'char *')
:info:build toke.c:9785: error: lvalue required as unary '&' operand
:info:build toke.c:9785: error: lvalue required as unary '&' operand
:info:build toke.c: In function 'S_scan_formline':
:info:build toke.c:10814: error: invalid operands to binary + (have 'char *' and 'char *')
:info:build toke.c:10814: error: lvalue required as unary '&' operand
:info:build toke.c:10814: error: lvalue required as unary '&' operand
:info:build make: *** [toke.o] Error 1

os: Darwin rapture.local 11.0.0 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64 x86_64

gcc: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

Attachments (2)

main.log (5.0 KB) - added by avtargill@… 9 years ago.
perl5.8 build log
patch-Configure-libc.diff (391 bytes) - added by jcmdev0@… 9 years ago.
Make configure inspect the libc dependencies for symbol names.

Download all attachments as: .zip

Change History (32)

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

Cc: ricci@… openmaintainer@… removed
Keywords: perl 5.8.9 toke.c removed
Owner: changed from macports-tickets@… to ricci@…

As per the ticket guidelines, it's not useful to cc openmantainer.

You should really install from the release_2_0 branch on 10.7. There will be a few issues with 1.9.2 (though it does more or less work).

Changed 9 years ago by avtargill@…

Attachment: main.log added

perl5.8 build log

comment:2 Changed 9 years ago by avtargill@…

I can't build perl5.8 either. I have OS X 10.7, Xcode 4.1 and MacPorts 2.0.0 rc1 installed. MacPorts installed using this dmg: http://distfiles.macports.org/MacPorts/testing/MacPorts-2.0.0-rc1-10.7-Lion.dmg

$ uname -a Darwin charles.local 11.0.0 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64 x86_64

Entire build log attached but here's a snippet:

:info:build make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5.8/perl5.8/work/perl-5.8.9'
:info:build `sh  cflags "optimize='-O3'" toke.o`  toke.c
:info:build `sh  cflags "optimize='-O3'" perly.o`  perly.c
:info:build 	  CCCMD =  /Developer/usr/bin/llvm-gcc-4.2 -DPERL_CORE -c -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/opt/local/include  -std=c89 -O3  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
:info:build 	  CCCMD =  /Developer/usr/bin/llvm-gcc-4.2 -DPERL_CORE -c -pipe -O2 -arch x86_64 -fno-common -DPERL_DARWIN -I/opt/local/include -no-cpp-precomp -fno-strict-aliasing -I/opt/local/include  -std=c89 -O3  -Wall -ansi -pedantic -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat -DPERL_GCC_PEDANTIC 
:info:build toke.c:1997:1: warning: use of C99 long long integer constant
:info:build toke.c: In function 'Perl_yylex':
:info:build toke.c:5516: error: lvalue required as unary '&' operand
:info:build toke.c:5516: error: lvalue required as unary '&' operand
:info:build toke.c: In function 'S_pending_ident':
:info:build toke.c:5755: error: lvalue required as unary '&' operand
:info:build toke.c:5755: error: lvalue required as unary '&' operand
:info:build toke.c: In function 'S_scan_heredoc':
:info:build toke.c:9785: error: invalid operands to binary + (have 'char *' and 'char *')
:info:build toke.c:9785: error: lvalue required as unary '&' operand
:info:build toke.c:9785: error: lvalue required as unary '&' operand
:info:build toke.c: In function 'S_scan_formline':
:info:build toke.c:10814: error: invalid operands to binary + (have 'char *' and 'char *')
:info:build toke.c:10814: error: lvalue required as unary '&' operand
:info:build toke.c:10814: error: lvalue required as unary '&' operand
:info:build make: *** [toke.o] Error 1
:info:build make: *** Waiting for unfinished jobs....
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5.8/perl5.8/work/perl-5.8.9'
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5.8/perl5.8/work/perl-5.8.9" && /usr/bin/make -j2 -w all " returned error 2

comment:3 Changed 9 years ago by avtargill@…

Cc: avtargill@… added

Cc Me!

comment:4 Changed 9 years ago by jmroot (Joshua Root)

Interestingly enough, this looks like the same error as in #20027.

comment:5 Changed 9 years ago by boo@…

Cc: boo@… added

Cc Me!

comment:6 Changed 9 years ago by tmandry@…

Cc: tmandry@… added

Cc Me!

comment:7 Changed 9 years ago by tmandry@…

Same issue here, on OSX 10.7 release. I selfupdated MacPorts to 2.0 after installing Lion, then got this. For the record perl5.10 works.

comment:8 Changed 9 years ago by mfisher@…

Cc: mfisher@… added

Cc Me!

comment:9 Changed 9 years ago by st+macports@…

Same scenario as tmandry@…

comment:10 Changed 9 years ago by st+macports@…

Cc: st+macports@… added

Cc Me!

Changed 9 years ago by jcmdev0@…

Attachment: patch-Configure-libc.diff added

Make configure inspect the libc dependencies for symbol names.

comment:11 Changed 9 years ago by angleto@…

Cc: angleto@… added

Cc Me!

comment:12 Changed 9 years ago by jcmdev0@…

It looks like the perl Configure script checks for libc functions by doing a symbol dump on libc.dylib. This doesn't work on Lion because they decided to split the functionality of libc into separate dynamic libraries (/usr/lib/system/libsystem_c.dylib, /usr/lib/system/libsystem_kernel.dylib, ...). This means that all of the symbol lookups fail and perl starts trying to use all of it's internal versions of many functions. Because most people on most systems wouldn't actually be using the perl implementations, they aren't compatible with modern compilers. To fix this, I made a little hack to the Configure script to pull in the libc.dylib dependencies to be included in the symbol lookup query.

If you drop the patch in /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/perl5.8/files (or equivalent) and add patch-Configure-libc.diff to the patchfiles line in /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/perl5.8/Portfile, then a "port clean perl5.8; port install perl5.8' will hopefully work.

comment:13 Changed 9 years ago by jcmdev0@…

Cc: jcmdev0@… added

Cc Me!

comment:14 in reply to:  12 Changed 9 years ago by angleto@…

Replying to jcmdev0@…:

I tried the patch and it works on mac os X 10.7. thanks.

comment:15 Changed 9 years ago by avtargill@…

Thanks. I was able to build perl5.8 without any issues using this patch.

comment:16 Changed 9 years ago by smitty1e@…

Thank you for the fix!

comment:17 Changed 9 years ago by jmroot (Joshua Root)

The patch that was applied to 5.12 and 5.10 in r76831 and r76832 should also work.

comment:18 Changed 9 years ago by fyu+macports@…

Cc: fyu+macports@… added

Cc Me!

comment:19 Changed 9 years ago by whcordis@…

Cc: whcordis@… added

Cc Me!

comment:20 in reply to:  17 Changed 9 years ago by afb@…

Resolution: fixed
Status: newclosed

Fixed, r81168.

comment:21 Changed 8 years ago by micah.bucy@…

Need to additionally patch for mountain lion too, which is darwin 12

comment:22 in reply to:  21 Changed 8 years ago by jasper@…

Resolution: fixed
Status: closedreopened

Replying to micah.bucy@…:

Need to additionally patch for mountain lion too, which is darwin 12

I can confirm running port upgrade outdated fails on Mountain Lion because of this same issue.

comment:23 Changed 8 years ago by avtargill@…

Cc: avtargill@… removed

Cc Me!

comment:24 Changed 8 years ago by avtargill@…

Cc: avtargill@… added

Cc Me!

comment:25 Changed 8 years ago by avtargill@…

Cc: avtargill@… removed

Cc Me!

comment:26 Changed 8 years ago by jasper@…

Cc: jasper@… added

Cc Me!

comment:27 in reply to:  21 ; Changed 8 years ago by philippe.lang@…

Replying to micah.bucy@…:

Need to additionally patch for mountain lion too, which is darwin 12

Just to make things clear: the patch is still necessary under Mountain Lion / XCode 4.4, but works like a charm.

comment:28 in reply to:  27 Changed 8 years ago by eric.lebihen@…

Replying to philippe.lang@…:

Replying to micah.bucy@…:

Need to additionally patch for mountain lion too, which is darwin 12

Just to make things clear: the patch is still necessary under Mountain Lion / XCode 4.4, but works like a charm.

Confirmed.

It is maybe worth mentioning that the patch should go under the /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/perl5.8/files folder and the filename appended to the Portfile file in the patchfiles list entry

comment:29 Changed 8 years ago by neverpanic (Clemens Lang)

Keywords: mountainlion added
Resolution: fixed
Status: reopenedclosed

Fixed in r96453.

comment:30 Changed 8 years ago by jasper@…

Fixe worked, just updated without adding patches myself.

Note: See TracTickets for help on using tickets.