Opened 14 months ago

Closed 14 months ago

Last modified 14 months ago

#68247 closed defect (fixed)

flac @1.4.3 +universal: many undefined symbols

Reported by: ashterenli Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: ventura Cc:
Port: flac

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

--->  Computing dependencies for flac
--->  Fetching archive for flac
--->  Attempting to fetch flac-1.4.3_0+universal.darwin_22.arm64-x86_64.tbz2 from https://mse.uk.packages.macports.org/flac
--->  Attempting to fetch flac-1.4.3_0+universal.darwin_22.arm64-x86_64.tbz2 from https://fra.de.packages.macports.org/flac
--->  Attempting to fetch flac-1.4.3_0+universal.darwin_22.arm64-x86_64.tbz2 from https://packages.macports.org/flac
--->  Building flac
Error: Failed to build flac: command execution failed    
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_audio_flac/flac/main.log for details.

The main.log is attached

Attachments (2)

main.log (492.3 KB) - added by ashterenli 14 months ago.
flac build log
main2.log (40.2 KB) - added by ashterenli 14 months ago.

Download all attachments as: .zip

Change History (18)

Changed 14 months ago by ashterenli

Attachment: main.log added

flac build log

comment:1 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: ventura added
Port: flac added
Summary: flac 1.4.3 -- many undefined symbols on Ventura 13.6 (Darwin Kernel Version 22.6.0)flac @1.4.3: many undefined symbols
Version: 2.8.1

It's strange... On the one hand, I can see that the configure script was generated with a broken version of libtool (< 2.4.7) that predates its support for macOS 11 and later, with support for only macOS 11 patched in. Thus on macOS 11 and earlier, it will call for runtime handling of undefined symbols, and on macOS 12 and later, it won't. We have a standard patchfile we can apply to fix that. On the other hand, the port built successfully on our build system on all systems including macOS 12 and 13 suggesting that this software didn't make use of undefined symbols.

comment:2 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

I tried building it on my macOS 12 system and it succeeded.

Do you happen to have an older version of flac installed? Check the output of port installed flac.

comment:3 Changed 14 months ago by jmroot (Joshua Root)

:info:build libtool: link: /usr/bin/clang++ -r -keep_private_externs -nostdlib -o .libs/libFLAC++.10.dylib-master.o  .libs/metadata.o .libs/stream_decoder.o .libs/stream_encoder.o

-arch flags are missing from this link command.

comment:4 Changed 14 months ago by jmroot (Joshua Root)

Summary: flac @1.4.3: many undefined symbolsflac @1.4.3 +universal: many undefined symbols

comment:5 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

I also built successfully with the universal variant on my system. No occurrences of "dylib-master" in my log.

comment:6 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Looks like that's a thing libtool does when it can't use the -single_module flag.

My configure output:

checking for -single_module linker flag... yes

vs. the output from the attached log:

checking for -single_module linker flag... ld: warning: -single_module is obsolete
ld: warning: -single_module is obsolete
no

comment:7 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Must be a new Xcode 15 thing. I had seen this line in the log, but had only read the Xcode version:

Xcode 14.3.1, CLT 15.0.0.0.1.1694021235

So there's a mismatch between Xcode and CLT. Best to keep them matched. If you want to build this immediately, downgrade to version 14.x of the CLT. Otherwise, upgrade Xcode to 15 and hopefully someone will figure out how to add the -arch flags where they're needed.

comment:8 Changed 14 months ago by jmroot (Joshua Root)

The silly thing is, this option hasn't been needed since Tiger. From the ld manual:

     -single_module
             This is now the default so does not need to be specified.

     -multi_module
             Multi-modules in dynamic libraries have been ignored at runtime
             since Mac OS X 10.4.0.  This option is obsolete.

comment:9 Changed 14 months ago by ashterenli

Somebody asked for this info:

$ port installed flac
The following ports are currently installed:
  flac @1.4.2_0+universal (active)
Last edited 14 months ago by ashterenli (previous) (diff)

comment:10 Changed 14 months ago by ashterenli

I should clarify that I didn't apply any custom flags on any of my ports. I've no idea why my flac is built with +universal.

I see it was pulled in when I installed x2goclient:

% port dependents flac
libsndfile depends on flac
% port dependents libsndfile
pulseaudio depends on libsndfile
% port dependents pulseaudio
x2goclient depends on pulseaudio

comment:11 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Yes, the x2goclient Portfile specifies that it does not support the arm64 architecture, therefore on an arm64 Mac it will be installed for x86_64 and its dependencies must be installed universal.

comment:12 Changed 14 months ago by ashterenli

I updated to:

% /usr/bin/xcodebuild -version
Xcode 15.0
Build version 15A240d

and did port selfupdate and port upgrade outdated and still see this error.

The updated log file is attached.

Changed 14 months ago by ashterenli

Attachment: main2.log added

comment:13 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

Exactly, this is a new problem in Xcode 15.x / CLT 15.x. If you want to avoid the problem, downgrade both to 14.x.

comment:14 Changed 14 months ago by ashterenli

"If you want to build this immediately, downgrade to version 14.x of the CLT. Otherwise, upgrade Xcode to 15 and hopefully someone will figure out how to add the -arch flags where they're needed."

I'll wait.

Thank you for looking into it.

comment:15 Changed 14 months ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 280eddc283db1e6a7bd35f4ef174ae86a3f99e6c/macports-ports (master):

flac: fix build with Xcode 15

Closes: #68247

comment:16 Changed 14 months ago by ashterenli

yes, I confirm:

% port info flac
flac @1.4.3 (audio)
Variants:             universal

Thank you!

Note: See TracTickets for help on using tickets.