Opened 8 years ago

Last modified 7 years ago

#52290 new defect

perl5: cannot be built as ppc/i386 universal on x86_64

Reported by: ridethecliche@… Owned by: mojca (Mojca Miklavec)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ryandesign (Ryan Carsten Schmidt), larryv (Lawrence Velázquez), ridethecliche@…, MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: perl5.22

Description

Hello,

When building Perl 5.22 on my ancient 2006 Mac Mini I get a compilation error:

:info:build 	     	\
:info:build 	  
:info:build ld: warning: in re_exec.o, missing required architecture x86_64 in file
:info:build ld: warning: in re_comp.o, missing required architecture x86_64 in file
:info:build ld: warning: in re.o, missing required architecture x86_64 in file
:info:build chmod 755 ../../lib/auto/re/re.bundle
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5/perl5.22/work/perl-5.22.2/ext/re/../../miniperl "-I../../lib" "-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- re.bs ../../lib/auto/re/re.bs 644
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5/perl5.22/work/perl-5.22.2/ext/re'
:info:build DYLD_LIBRARY_PATH=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5/perl5.22/work/perl\-5.22.2  ./perl -Ilib -f pod/buildtoc -q
:info:build Can't load 'lib/auto/re/re.bundle' for module re: dlopen(lib/auto/re/re.bundle, 1): no suitable image found.  Did find:
:info:build 	lib/auto/re/re.bundle: mach-o, but wrong architecture at lib/XSLoader.pm line 73.
:info:build 
:info:build Compilation failed in require at lib/Text/Wrap.pm line 58.
:info:build BEGIN failed--compilation aborted at lib/Text/Wrap.pm line 58.
:info:build Compilation failed in require at pod/buildtoc line 7.
:info:build BEGIN failed--compilation aborted at pod/buildtoc line 7.
:info:build make: *** [pod/perltoc.pod] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5/perl5.22/work/perl-5.22.2'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_perl5/perl5.22/work/perl-5.22.2" && /usr/bin/make -j2 -w all 
:info:build Exit code: 2
:error:build org.macports.build for port perl5.22 returned: command execution failed
:debug:build Error code: CHILDSTATUS 19017 2
:debug:build Backtrace: command execution failed

Any guidance on how to get around this? Thanks. ~RTC

Attachments (1)

main.log (302.1 KB) - added by ridethecliche@… 8 years ago.

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by ridethecliche@…

Attachment: main.log added

comment:1 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added
Keywords: perl5.22 removed
Owner: changed from macports-tickets@… to mojca@…
Port: perl5.22 added; perl5 removed
Summary: Perl5.22 - Build failure on 10.6perl5.22 @5.22.2: Build failure on 10.6

Ok, I see the deployment target is 10.5. I assume that means you're running Leopard.

I see that it's trying to build perl5.22 for both i386 and ppc architectures. I assume that's because you've requested the +universal variant.

The reason for the failure is that the build system failed to supply the -arch flags to a few compiler invocations. We need to fix that. I'm surprised we haven't encountered this problem before; that kind of problem would seem to affect all Mac operating system versions when building universal, and I build universal by default on my system, so I should have seen it.

I am curious why in the absence of -arch flags the compiler seems to have defaulted to build for x86_64. It was my understanding that the compiler defaulted to i386 or ppc on Leopard and earlier.

Does your Mac mini have an Intel or PowerPC processor?

comment:2 Changed 8 years ago by larryv (Lawrence Velázquez)

Cc: larryv@… added

Cc Me!

comment:3 Changed 8 years ago by ridethecliche@…

Hello,

That's correct, I requested the +universal variant. The Mac Mini is running MacOS 10.6 and has an Intel processor. My intent was to compile the package on an Intel Mac running 10.6 and be able to use the binary on a PPC Mac running 10.5. Sorry I forgot to mention setting the deployment target in my initial bug report.

Just now I did a clean install of MacPorts, and did a "sudo port -v -s install perl5 +universal" and got a clean run (Producing a i386 and x86_64 binary).

However if I set build_arch to i386 in macports.conf and do "sudo port -v -s install perl5" the build fails in the same manner as my first report.

Hope this helps, ~RTC

comment:4 Changed 8 years ago by ridethecliche@…

Cc: ridethecliche@… added

Cc Me!

comment:5 Changed 7 years ago by mojca (Mojca Miklavec)

It would help to ask the upstream for help.

Just in case, can you please try to change

if {[variant_isset universal]} {

into

if {true} {

and check whether that makes any difference? I don't think it does, but ...

comment:6 Changed 7 years ago by ken-cunningham-webuse

On this lovely 17" macbookpro 2,1 that I have and refuse to trash, running 10.6 with libc++ upgrade, there seems to be no problem installing any recent version of perl, universal or otherwise.

perl5.22 @5.22.2_1 platform='darwin 10' archs='x86_64'
perl5.22 @5.22.2_1+universal (active) platform='darwin 10' archs='i386 x86_64'
perl5.24 @5.24.0_0 platform='darwin 10' archs='x86_64'
perl5.24 @5.24.0_0+universal (active) platform='darwin 10' archs='i386 x86_64'

I would not think it would be possible to build something on macports 10.6 and deploy it on 10.5. However, why bother with that hassle?? Perl builds and installs just fine on 10.5 PPC.

perl5.22 @5.22.2_1 (active) platform='darwin 9' archs='ppc'
perl5.24 @5.24.0_0 (active) platform='darwin 9' archs='ppc'

I would just suggest to the OP to build it on the 10.5 PPC machine, and be done with it.

best, Ken

comment:7 Changed 7 years ago by ken-cunningham-webuse

FYI, it builds and installs just fine on 10.4 PPC as well.

perl5.22 @5.22.1_1 platform='darwin 8' archs='ppc'
perl5.22 @5.22.2_0 platform='darwin 8' archs='ppc'
perl5.22 @5.22.2_1 (active) platform='darwin 8' archs='ppc'
perl5.24 @5.24.0_0 (active) platform='darwin 8' archs='ppc'

comment:8 in reply to:  6 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ken.cunningham.webuse@…:

I would not think it would be possible to build something on macports 10.6 and deploy it on 10.5.

MacPorts does include functionality that's supposed to make this possible, specifically changing the deployment target. However, this macports.conf setting is not advertised, because support for this setting varies greatly among ports. Looks like the perl ports may be among those that don't support it properly.

Or it may relate to building for a non-default architecture, since the reporter mentioned that:

However if I set build_arch to i386 in macports.conf and do "sudo port -v -s install perl5" the build fails in the same manner as my first report.

I assume that means the deployment target was not changed to 10.5 for that test.

comment:9 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

And in some cases, in addition to the deployment target, you may have to change the SDK. And again, support for doing that varies by port, so we don't advertise that macports.conf setting either.

I agree with Ken that if you want to build for PowerPC and target 10.5, the most reliable and straightforward way to do so is to build on a PowerPC Mac running 10.5.

comment:10 Changed 7 years ago by mojca (Mojca Miklavec)

Cc: mcalhoun@… added
Version: 2.3.4

comment:11 Changed 7 years ago by mojca (Mojca Miklavec)

Summary: perl5.22 @5.22.2: Build failure on 10.6perl5: cannot be built as ppc/i386 universal on x86_64

comment:12 Changed 7 years ago by mojca (Mojca Miklavec)

Potentially related patches are in #52739.

comment:13 Changed 7 years ago by mojca (Mojca Miklavec)

Are you willing to test whether the patches in the other ticket solve the problem for you?

comment:14 Changed 7 years ago by mojca (Mojca Miklavec)

PING. Can you please test the patches from #52739 and report if any of them solves the problem for you?

Note: See TracTickets for help on using tickets.