Opened 2 years ago

Closed 2 years ago

#57168 closed defect (fixed)

nspr does not build on Mojave 10.14

Reported by: breiter (Brian Reiter) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: nspr


nspr fails to build on macOS Mojave 10.10.

:debug:build system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/nspr-4.20/nspr" && /usr/bin/make -j8 -w all 
:info:build make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/nspr-4.20/nspr'
:info:build /Applications/ -C config export
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_nspr/nspr/work/nspr-4.20/nspr/config'
:info:build /usr/bin/clang -arch i386  now.o -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-syslibroot,/Applications/ -arch x86_64  -o now
:info:build ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
:info:build ld: warning: ignoring file /Applications/, missing required architecture i386 in file /Applications/
:info:build Undefined symbols for architecture i386:

This happens because at build time CC gets defined in config/ as /usr/bin/clang -arch i386 and the MacOS10.14.sdk does not contain i386 symbols. CC should not be defined to use -arch i386. Rather, ./configure should have the argument --enable-64bit passed and then the build system will configure /usr/bin/clang -arch x86_64 and the software builds and works.

The seems to be an attempt to conditionally set this argument in the Portfile using set merger_configure_args which I don't understand. This does not work to set the argument on configure.args. It does work if I explicitly set the argument in the configure.args expression, however this would mean it would not build correctly in a 32-bit Intel system.

--- Portfile.old	2018-09-26 11:44:45.000000000 +0200
+++ Portfile	2018-09-26 11:45:12.000000000 +0200
@@ -33,10 +33,8 @@
 configure.args \
     --disable-debug \
     --enable-optimize='${configure.optflags}' \
-    --libdir=${prefix}/lib/nspr
-set merger_configure_args(ppc64)  "--enable-64bit"
-set merger_configure_args(x86_64) "--enable-64bit"
+    --libdir=${prefix}/lib/nspr \
+    --enable-64bit"
 variant debug description "build with debugging symbols" {
     configure.args-delete   --disable-debug \

Change History (2)

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

Port: nspr added

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

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In a19d0eec8c3e9f2e5ca5f70befab418460e9bd6e/macports-ports (master):

nspr: restore --enable-64bit for non-universal

This was removed, apparently incorrectly, in 41cb766.

Fixes: #57168

Note: See TracTickets for help on using tickets.