Opened 11 years ago

Last modified 12 months ago

#50824 new defect

nspr does not compile for ppc64

Reported by: land.apfel@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: potmj (Michael Pot)
Port: nspr

Description (last modified by ryandesign (Ryan Carsten Schmidt))

When installing nspr +universal (with universal_archs = ppc ppc64), the ppc build runs through, but the ppc64 build fails at:

make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/nspr-4.12/nspr-ppc64/pr/src/io'
ccache /usr/bin/gcc-4.2 -arch ppc -o prfdcach.o -c    -I/opt/local/include -pipe -Os -arch ppc64 -Wall -fno-common -pthread -Os -fPIC  -UDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DNDEBUG=1 -DXP_UNIX=1 -DDARWIN=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1 -DHAVE_CRT_EXTERNS_H=1 -DXP_MACOSX=1 -DHAVE_DLADDR=1 -DHAVE_LCHOWN=1 -DHAVE_SETPRIORITY=1 -DHAVE_STRERROR=1 -DHAVE_SYSCALL=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I../../../dist/include/nspr -I../../../pr/include -I../../../pr/include/private  prfdcach.c
In file included from ../../../pr/include/md/prosdep.h:62,
                 from ../../../pr/include/private/primpl.h:44,
                 from prfdcach.c:6:
../../../pr/include/md/_darwin.h:32:2: error: #error "Unknown CPU architecture"
lipo: can't open input file: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/.tmp/cc72DDO4.out (No such file or directory)
make[3]: *** [prfdcach.o] Error 1

If I apply the attachment:patch-arch-ppc64.diff​, it continues building but fails again with attachment:log-ppc64-build.txt.txt​

Unless someone has an idea how this could be fixed, I think building for ppc64 should be disabled.

Attachments (3)

patch-arch-ppc64.diff​ (415 bytes) - added by land.apfel@… 11 years ago.
log-ppc64-build.txt.txt​ (8.8 KB) - added by land.apfel@… 11 years ago.
patch-portfile-darwin9.diff​ (583 bytes) - added by potmj (Michael Pot) 12 months ago.
Also support ppc64 build on intel

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by land.apfel@…

Attachment: patch-arch-ppc64.diff​ added

Changed 11 years ago by land.apfel@…

Attachment: log-ppc64-build.txt.txt​ added

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

Description: modified (diff)

comment:2 in reply to:  description Changed 4 years ago by barracuda156

Replying to land.apfel@…:

When installing nspr +universal (with universal_archs = ppc ppc64), the ppc build runs through, but the ppc64 build fails at:

make[3]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/nspr-4.12/nspr-ppc64/pr/src/io'
ccache /usr/bin/gcc-4.2 -arch ppc -o prfdcach.o -c    -I/opt/local/include -pipe -Os -arch ppc64 -Wall -fno-common -pthread -Os -fPIC  -UDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DNDEBUG=1 -DXP_UNIX=1 -DDARWIN=1 -DHAVE_BSD_FLOCK=1 -DHAVE_SOCKLEN_T=1 -DHAVE_CRT_EXTERNS_H=1 -DXP_MACOSX=1 -DHAVE_DLADDR=1 -DHAVE_LCHOWN=1 -DHAVE_SETPRIORITY=1 -DHAVE_STRERROR=1 -DHAVE_SYSCALL=1 -DFORCE_PR_LOG -D_PR_PTHREADS -UHAVE_CVAR_BUILT_ON_SEM -D_NSPR_BUILD_ -I../../../dist/include/nspr -I../../../pr/include -I../../../pr/include/private  prfdcach.c
In file included from ../../../pr/include/md/prosdep.h:62,
                 from ../../../pr/include/private/primpl.h:44,
                 from prfdcach.c:6:
../../../pr/include/md/_darwin.h:32:2: error: #error "Unknown CPU architecture"
lipo: can't open input file: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/.tmp/cc72DDO4.out (No such file or directory)
make[3]: *** [prfdcach.o] Error 1

If I apply the attachment:patch-arch-ppc64.diff​, it continues building but fails again with attachment:log-ppc64-build.txt.txt​

Unless someone has an idea how this could be fixed, I think building for ppc64 should be disabled.

Fixed that, should work now.

Changed 12 months ago by potmj (Michael Pot)

Attachment: patch-portfile-darwin9.diff​ added

Also support ppc64 build on intel

comment:3 Changed 12 months ago by potmj (Michael Pot)

Thanks for the work on this and leading me to the applying the patch when I didn't have the ppc64 code. I have then had some success on 10.5.8 intel, so will post my progress here in case it helps others (perhaps with arm64 ticket:65534 as I think I ended up in the same place in my intel journey):-

It seems desirable to include patch-darwin-ppc64.diff for all machines that can build ppc64 (so include intel). The Portfile ppc arch tests seam unnecessary, given platform darwin 9 attachment:patch-portfile-darwin9.diff​. This helps in building fat 4 arch libraries like distributed with 10.5.8, and hence supporting dependencies, especially when trying to build compilers.

There are still problems with configure not creating correct make files but I don't know how to fix this in Macports. Manually, nspr can be built 4 arch on 10.5.8 intel and installed by fixing the problems when port upgrade nspr fails and restarting without a port clean to continue the build. I have found the following fixes work for me at my fail points (your paths may differ):-

1/ make not accepting os.arch generated utilities, expecting ppc (which will run).

In cd /opt/local/var/macports/build/nspr-f52f05de/work/nspr-4.37/nspr-ppc/config

Build rosetta executables and let the make continue by adding -arch ppc and running:-

sudo /usr/bin/gcc-4.2 -std=gnu99  -arch ppc    now.o   -o now
sudo /usr/bin/gcc-4.2 -std=gnu99  -arch ppc    nsinstall.o   -o nsinstall

2/ Again later on for ppc64

In cd /opt/local/var/macports/build/nspr-f52f05de/work/nspr-4.37/nspr-ppc64/config

Build ppc64 executables to let the make continue by adding -arch ppc64 and running:-

sudo /usr/bin/gcc-4.2 -std=gnu99  -arch ppc64  now.o   -o now
sudo /usr/bin/gcc-4.2 -std=gnu99  -arch ppc64  nsinstall.o   -o nsinstall

These won't work on intel, but the let make continue and we can fix this later on.

The best way to fix these ppc files would be by convincing configure to produce a makefile to continue on and install the build tools now and nsinstall which it already makes as os.arch. I don't know how to do this.

3/ Further on, the ppc64 install tool fails.

In cd /opt/local/var/macports/build/nspr-f52f05de/work/nspr-4.37/nspr-ppc64/pr/include/md

The best trick seems to be to copy over the functioning nsinstall rosetta ppc executable and let the make run it as if it were the ppc64 one.

sudo cp -pv ../../../../nspr-ppc/config/./nsinstall ../../../config/./nsinstall

And stop the make from wanting to rebuild nsinstall on the timestamp.

sudo touch ../../../config/./nsinstall

The install now completes for me, solving dependencies.

sh-3.2$ port -v installed nspr
The following ports are currently installed:
  nspr @4.10_1+universal requested_variants='+universal' platform='darwin 9' archs='i386 ppc' date='2015-01-13T02:01:59+1300'
  nspr @4.37_0+universal (active) requested_variants='+universal' platform='darwin 9' archs='i386 ppc ppc64 x86_64' date='2025-10-21T20:53:35+1300'
sh-3.2$

comment:4 Changed 12 months ago by potmj (Michael Pot)

Cc: potmj added
Note: See TracTickets for help on using tickets.