Opened 2 years ago

Last modified 4 months ago

#69817 assigned defect

openjdk17 @17.0.13_0+release+server: Build fails on x86_64 Sonoma 14.7 undefined symbols

Reported by: rswail (Ron Wail) Owned by: usersxx
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: Cc: breun (Nils Breunese)
Port: openjdk17

Description

Build failed with the following errors in the log:

  :info:build gmake[3]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports
  _release_tarballs_ports_java_openjdk17/openjdk17/work/jdk-17.0.11+9/make'
  :info:build Creating support/modules_libs/java.base/libverify.dylib from 1 file(s)
  :info:build Creating support/modules_libs/java.base/libjava.dylib from 60 file(s)
  :info:build Creating support/native/java.base/libfdlibm.a from 57 file(s)
  :info:build Creating support/modules_libs/java.base/libzip.dylib from 5 file(s)
  :info:build Creating support/modules_libs/java.base/libjimage.dylib from 6 file(s)
  :info:build Creating support/modules_libs/java.base/libjli.dylib from 8 file(s)
  :info:build Creating support/modules_libs/java.base/libnet.dylib from 22 file(s)
  :info:build Creating support/modules_libs/java.base/libnio.dylib from 22 file(s)
  :info:build Creating support/modules_libs/java.base/libosxsecurity.dylib from 1 file(s)
  :info:build Creating support/modules_libs/java.base/libjsig.dylib from 1 file(s)
  :info:build Undefined symbols for architecture x86_64:
  :info:build   "_NET_Bind", referenced from:
  :info:build       _Java_sun_nio_ch_Net_bind0 in Net.o
  :info:build   "_NET_GetPortFromSockaddr", referenced from:
  :info:build       _Java_sun_nio_ch_Net_localPort in Net.o
  :info:build       _Java_sun_nio_ch_Net_remotePort in Net.o
  :info:build   "_NET_GetSockOpt", referenced from:
  :info:build       _Java_sun_nio_ch_Net_getIntOption0 in Net.o
  :info:build   "_NET_InetAddressToSockaddr", referenced from:
  :info:build       _Java_sun_nio_ch_Net_bind0 in Net.o
  :info:build       _Java_sun_nio_ch_Net_connect0 in Net.o
  :info:build   "_NET_SetSockOpt", referenced from:
  :info:build       _Java_sun_nio_ch_Net_setIntOption0 in Net.o
  :info:build   "_NET_SockaddrToInetAddress", referenced from:
  :info:build       _Java_sun_nio_ch_InheritedChannel_inetPeerAddress0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_InheritedChannel_peerPort0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_Net_accept in Net.o
  :info:build       _Java_sun_nio_ch_Net_localInetAddress in Net.o
  :info:build       _Java_sun_nio_ch_Net_remoteInetAddress in Net.o
  :info:build   "_NET_SocketAvailable", referenced from:
  :info:build       _Java_sun_nio_ch_Net_available in Net.o
  :info:build   "_initInetAddressIDs", referenced from:
  :info:build       _Java_sun_nio_ch_InheritedChannel_initIDs in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_Net_initIDs in Net.o
  :info:build   "_ipv4_available", referenced from:
  :info:build       _Java_sun_nio_ch_Net_socket0 in Net.o
  :info:build   "_ipv6_available", referenced from:
  :info:build       _Java_sun_nio_ch_InheritedChannel_inetPeerAddress0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_InheritedChannel_peerPort0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_Net_isIPv6Available0 in Net.o
  :info:build       _Java_sun_nio_ch_Net_socket0 in Net.o
  :info:build   "_reuseport_available", referenced from:
  :info:build       _Java_sun_nio_ch_Net_isReusePortAvailable0 in Net.o

Attachments (1)

main.log.gz (11.1 KB) - added by snowflake (Dave Evans) 4 months ago.
main.log for sudo port -sd openjdk17 on macOS 15.7.5 x86_64

Download all attachments as: .zip

Change History (24)

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

Owner: set to usersxx
Status: newassigned

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

Cc: breun added
Summary: Build of release+server version 17.0.11_1 fails on x86_64 Sonoma 14.4.1 undefined symbolsopenjdk17 @17.0.11_1+release+server: Build fails on x86_64 Sonoma 14.4.1 undefined symbols

comment:3 Changed 2 years ago by breun (Nils Breunese)

I don't have access to a device with macOS Sonoma x86_64, but https://ports.macports.org/port/openjdk17/details/ shows a successful build on Sonoma x86_64.

comment:4 Changed 2 years ago by breun (Nils Breunese)

https://packages.macports.net/openjdk17/ also shows openjdk17-17.0.11_1+release+server.darwin_23.x86_64.tbz2, so I believe MacPorts should be able to fetch this pre-built binary archive. Did you specifically request a build from source?

comment:5 Changed 2 years ago by rswail (Ron Wail)

No, just a normal "port upgrade outdated". I don't have the output from when I ran that to see whether or not it tried to get the binary and failed.

Just retried and it was able to be downloaded as a binary and install successfully.

comment:6 Changed 22 months ago by rswail (Ron Wail)

Further update that there is no binary build of release 17.0.13_0+release+server.darwin_23.x86_64 in the macports binary archive and the build fails when building from source with the same _NET symbols missing.

Note that there is a build for darwin_24.

comment:7 Changed 22 months ago by rswail (Ron Wail)

Summary: openjdk17 @17.0.11_1+release+server: Build fails on x86_64 Sonoma 14.4.1 undefined symbolsopenjdk17 @17.0.13_0+release+server: Build fails on x86_64 Sonoma 14.7 undefined symbols

comment:8 Changed 22 months ago by breun (Nils Breunese)

The build bots do show a successful build on macOS 14 x86_64: https://build.macports.org/builders/ports-14_x86_64-builder/builds/50223

comment:9 Changed 22 months ago by rswail (Ron Wail)

Binary is not in the archive at https://packages.macports.org/openjdk17/ for darwin23. There is an ARM build, but not an x86_64.

May be related to #69440.

Similar issues when building via homebrew for MacOS and Linux, see https://gist.github.com/clpo13/9e8df29fbaad96949da295afbc7d0c04

Relevant log information here:

 :info:build gmake[3]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs
  _ports_java_openjdk17/openjdk17/work/jdk-17.0.13+11/make/hotspot'
  :info:build gmake[3]: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarball
  s_ports_java_openjdk17/openjdk17/work/jdk-17.0.13+11/make'
  :info:build Creating support/modules_libs/java.base/libverify.dylib from 1 file(s)
  :info:build Creating support/modules_libs/java.base/libjava.dylib from 60 file(s)
  :info:build Creating support/native/java.base/libfdlibm.a from 57 file(s)
  :info:build Creating support/modules_libs/java.base/libzip.dylib from 5 file(s)
  :info:build Creating support/modules_libs/java.base/libjimage.dylib from 6 file(s)
  :info:build Creating support/modules_libs/java.base/libjli.dylib from 8 file(s)
  :info:build Creating support/modules_libs/java.base/libnet.dylib from 22 file(s)
  :info:build Creating support/modules_libs/java.base/libnio.dylib from 22 file(s)
  :info:build Creating support/modules_libs/java.base/libosxsecurity.dylib from 1 file(s)
  :info:build Creating support/modules_libs/java.base/libjsig.dylib from 1 file(s)
  :info:build Undefined symbols for architecture x86_64:
  :info:build   "_NET_Bind", referenced from:
  :info:build       _Java_sun_nio_ch_Net_bind0 in Net.o
  :info:build   "_NET_GetPortFromSockaddr", referenced from:
  :info:build       _Java_sun_nio_ch_Net_localPort in Net.o
  :info:build       _Java_sun_nio_ch_Net_remotePort in Net.o
  :info:build   "_NET_GetSockOpt", referenced from:
  :info:build       _Java_sun_nio_ch_Net_getIntOption0 in Net.o
  :info:build   "_NET_InetAddressToSockaddr", referenced from:
  :info:build       _Java_sun_nio_ch_Net_bind0 in Net.o
  :info:build       _Java_sun_nio_ch_Net_connect0 in Net.o
  :info:build   "_NET_SetSockOpt", referenced from:
  :info:build       _Java_sun_nio_ch_Net_setIntOption0 in Net.o
  :info:build   "_NET_SockaddrToInetAddress", referenced from:
  :info:build       _Java_sun_nio_ch_InheritedChannel_inetPeerAddress0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_InheritedChannel_peerPort0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_Net_accept in Net.o
  :info:build       _Java_sun_nio_ch_Net_localInetAddress in Net.o
  :info:build       _Java_sun_nio_ch_Net_remoteInetAddress in Net.o
  :info:build   "_NET_SocketAvailable", referenced from:
  :info:build       _Java_sun_nio_ch_Net_available in Net.o
  :info:build   "_initInetAddressIDs", referenced from:
  :info:build       _Java_sun_nio_ch_InheritedChannel_initIDs in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_Net_initIDs in Net.o
  :info:build   "_ipv4_available", referenced from:
  :info:build       _Java_sun_nio_ch_Net_socket0 in Net.o
  :info:build   "_ipv6_available", referenced from:
  :info:build       _Java_sun_nio_ch_InheritedChannel_inetPeerAddress0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_InheritedChannel_peerPort0 in InheritedChannel.o
  :info:build       _Java_sun_nio_ch_Net_isIPv6Available0 in Net.o
  :info:build       _Java_sun_nio_ch_Net_socket0 in Net.o
  :info:build   "_reuseport_available", referenced from:
  :info:build       _Java_sun_nio_ch_Net_isReusePortAvailable0 in Net.o
  :info:build ld: symbol(s) not found for architecture x86_64
  :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
  :info:build gmake[3]: *** [Lib.gmk:71: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_p
  orts_java_openjdk17/openjdk17/work/jdk-17.0.13+11/build/release/support/modules_libs/java.base/libnio.dylib] Error 1
  :info:build gmake[3]: *** Waiting for unfinished jobs....
  :info:build gmake[3]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs
  _ports_java_openjdk17/openjdk17/work/jdk-17.0.13+11/make'
  :info:build gmake[2]: *** [make/Main.gmk:199: java.base-libs] Error 2
  :info:build gmake[2]: *** Waiting for unfinished jobs....
  :info:build gmake[3]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs
  _ports_java_openjdk17/openjdk17/work/jdk-17.0.13+11/make'
  :info:build gmake[2]: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs
  _ports_java_openjdk17/openjdk17/work/jdk-17.0.13+11'
  :info:build ERROR: Build failed for target 'images' in configuration 'release' (exit code 2)
Last edited 22 months ago by rswail (Ron Wail) (previous) (diff)

comment:10 in reply to:  8 Changed 22 months ago by rswail (Ron Wail)

Replying to breun:

The build bots do show a successful build on macOS 14 x86_64: https://build.macports.org/builders/ports-14_x86_64-builder/builds/50223

There is a binary build now available, but before that I was digging through the logs and the only thing I found was a mention of the MacOS15.sdk in one part and MacOS14.sdk in another. The actual function NET_Bind et al are in the native part of the java.base net source. There is an implementation under the unix/ and windows/ directories, but not under macosx/.

comment:11 Changed 22 months ago by breun (Nils Breunese)

I don't know why this failed on your machine, but for me locally (macOS 15) and the build bot (macOS 10.14 - 15) this build was successful.

Last edited 22 months ago by breun (Nils Breunese) (previous) (diff)

comment:12 in reply to:  11 ; Changed 4 months ago by snowflake (Dave Evans)

Replying to breun:

I don't know why this failed on your machine, but for me locally (macOS 15) and the build bot (macOS 10.14 - 15) this build was successful.

18 months later and it is still working on the buildbots and failing locally with the same error. I'm on Sequoia 15.7.5 with Xcode 16.4. I've also tried Xcode 26.2. There must be some port installed here (and not on the buildbots) which is confusing the configure phase. libunwind is not installed here.

I've also tried building with configure.compiler=macports-clang-20, as Apple clang sometimes crashes during the configure phase.

comment:13 in reply to:  12 ; Changed 4 months ago by breun (Nils Breunese)

Replying to snowflake:

Replying to breun:

I don't know why this failed on your machine, but for me locally (macOS 15) and the build bot (macOS 10.14 - 15) this build was successful.

18 months later and it is still working on the buildbots and failing locally with the same error. I'm on Sequoia 15.7.5 with Xcode 16.4. I've also tried Xcode 26.2. There must be some port installed here (and not on the buildbots) which is confusing the configure phase. libunwind is not installed here.

I'm sorry, but I really don't know enough about Xcode to know where to start troubleshooting the issue you're seeing on your system.

The only things I can think of are:

  1. Is Xcode installed fully (e.g. when you run Xcode, does it still want to install stuff on startup or not)?
  2. What path does xcode-select --print-path show (my system shows /Applications/Xcode.app/Contents/Developer)? If it shows a different path, you could try resetting it via sudo xcode-select --reset. I don't know if this is relevant.

comment:14 in reply to:  13 Changed 4 months ago by snowflake (Dave Evans)

I think the local build may be failing because there is probably a port on my system which is confusing it. I tried deactivating coreutils gsed grep libtool findutils ld64 but it made no difference. I presume the buildbots only install the ports required for the build.

I also tried a build outside of Macports by extracting the source to a directory and running bash configure and make and it succeeded, which proves that Xcode is correctly installed. I don't know whether it built the native network stuff.

comment:15 Changed 4 months ago by snowflake (Dave Evans)

I had a successful build with:

sudo port -sd build openjdk17 configure.cflags="" configure.cxxflags="" configure.ldflags=""

I'm using Macports base as of 2026-04-24 v2.12.99

commit 6bce7be7 macports-base

Last edited 4 months ago by snowflake (Dave Evans) (previous) (diff)

comment:16 in reply to:  15 ; Changed 4 months ago by breun (Nils Breunese)

Replying to snowflake:

I had a successful build with:

sudo port -sd build openjdk17 configure.cflags="" configure.cxxflags="" configure.ldflags=""

I'm no expert on these flags, but what flags are set for the failing MacPorts build? Could you attach the full log for a failing MacPorts build?

Changed 4 months ago by snowflake (Dave Evans)

Attachment: main.log.gz added

main.log for sudo port -sd openjdk17 on macOS 15.7.5 x86_64

comment:17 in reply to:  16 Changed 4 months ago by snowflake (Dave Evans)

Replying to breun:

Replying to snowflake:

I had a successful build with:

sudo port -sd build openjdk17 configure.cflags="" configure.cxxflags="" configure.ldflags=""

I'm no expert on these flags, but what flags are set for the failing MacPorts build? Could you attach the full log for a failing MacPorts build?

sudo port -sd build openjdk17 The -d flag enables debug logging.

At the moment I suspect there is a bug in tclsh that does not provide a null string if configure.cflags is null

comment:18 Changed 4 months ago by snowflake (Dave Evans)

I've just tried building openjdk26 and I get the same error with the same fix. I suspect that running the very latest Macports build system may have something to do with it. What version of Macports are you using?

It may be a very subtle bug.

comment:19 in reply to:  18 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to snowflake:

I suspect that running the very latest Macports build system may have something to do with it.

I see from the log you're using MacPorts 2.12.99. If you've built that recently, there could still be bugs due to us switching to Tcl 9, and I'd recommend staying on 2.12.x where x < 99 for now. However, you're seeing the same error that was reported originally two years ago, which predates our Tcl 9 update attempt.

The log you attached only mentions the MacOSX15 SDK, but an earlier comment said two different SDKs were mentioned in their log.

By clearing CFLAGS, CXXFLAGS, and LDFLAGS when building with MacPorts, you're clearing some of the flags MacPorts uses to communicate the desired SDK (among other things). When you build manually on the command line, if you don't manually supply those flags, they're not used there either.

comment:20 in reply to:  18 Changed 4 months ago by breun (Nils Breunese)

Replying to snowflake:

What version of Macports are you using?

I’m running the latest MacPorts release, which is currently 2.12.5: https://www.macports.org/install.php This is also what the buildbots are running.

Last edited 4 months ago by breun (Nils Breunese) (previous) (diff)

comment:21 Changed 4 months ago by snowflake (Dave Evans)

I installed v2.12.5 and I still get the same error with sudo port -sd build openjdk17, which makes me wonder exactly what the differences are between my setup and breun and buildbots. There is nothing unusual I can see in my environment or /opt/local/etc/macports/macports.conf.

As a side note, I could not get v2.12.5 to install from my local git directory. It was using tclsh9 in places. I had to cd /opt/local/libexec && rm -rf macports before the sudo make install would work.

comment:22 Changed 4 months ago by snowflake (Dave Evans)

I installed v2.12.5 from the official Sequoia package.

I still get the same error with sudo port -sd build openjdk17

comment:23 Changed 4 months ago by snowflake (Dave Evans)

Buildbot emulation.

I created an alternative Macports tree with the --prefix feature of Macports base configure. It had no ports installed. I adjusted my shell PATH to point to the new bin and sbin directories.

I then ran sudo port -s install openjdk17. After about 30 minutes the install succeeded. There were several conftest crashes while bison and/or bison-runtime were building.

I have several hundred ports installed in the old Macports tree. My current theory is that one or more of them is screwing up the configuration of the Java ports. Finding which one is the culprit will be an interesting exercise.

Note: See TracTickets for help on using tickets.