Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg, ffmpeg-devel, ffmpeg6: fix compilation problems with Xcode 15 #20609

Merged
merged 1 commit into from Sep 27, 2023

Conversation

czo
Copy link
Contributor

@czo czo commented Sep 27, 2023

Description

Xcode 15 introduced a new linker, which is faster (said by Apple) but it cause some problems with existing software. Compiling ffmpeg port's cannot be done, because somewhere in the building process, multiple symbol exports are created with the same name, and the new linker cant link it. Apple introduced a new ldflag, which can bring back the old one, but this is a temporary solution, because this flag will be phased out in the future (date not disclosed yet).

Closes: https://trac.macports.org/ticket/68234

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 13.6 22G120 x86_64
Xcode 15.0 15A240d

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

Due to the new linker in Xcode 15, to made the compilation success,
a '-ld_classic' ldflags are required. This is a temporary solution,
because Apple will remove this flag in the future. More info:
https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes

Closes: https://trac.macports.org/ticket/68234
@macportsbot
Copy link

Notifying maintainers:
@mascguy for port ffmpeg-devel, ffmpeg, ffmpeg6.
@dbevans for port ffmpeg.
@jeremyhu for port ffmpeg.

@macportsbot macportsbot added type: bugfix maintainer: open Affects an openmaintainer port labels Sep 27, 2023
Copy link
Member

@mascguy mascguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, will merge once CI completes.

Thank you for your contribution!

@mascguy mascguy merged commit 70c609d into macports:master Sep 27, 2023
3 checks passed
@Vargol
Copy link

Vargol commented Oct 20, 2023

Nevermind, forced a Command Line Tool re-install and it now works , even though though the clang version information is the same.

Leaving this here in case some one else has the same issue, re-install using,,,
https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt

Hi, this pull has broken ffmpeg compiles for me.

/usr/bin/clang -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -pipe -Os -DHAVE_LRINTF -Wno-deprecated-declarations -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch arm64 -c -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/.tmp/ffconf.XZwEItEy/test.o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/.tmp/ffconf.XZwEItEy/test.c
/usr/bin/clang -L/opt/local/lib -Wl,-headerpad_max_install_names -Wl,-ld_classic -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -arch arm64 -o /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/.tmp/ffconf.XZwEItEy/test /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/.tmp/ffconf.XZwEItEy/test.o
ld: library not found for -ld_classic
clang: error: linker command failed with exit code 1 (use -v to see invocation)
C compiler test failed.
% /usr/bin/clang -v
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer: open Affects an openmaintainer port type: bugfix
6 participants