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

macOS: linker error (starting in ffmpeg) with Xcode 15 #808

Closed
jhoyt4 opened this issue Oct 26, 2023 · 5 comments · Fixed by #809
Closed

macOS: linker error (starting in ffmpeg) with Xcode 15 #808

jhoyt4 opened this issue Oct 26, 2023 · 5 comments · Fixed by #809

Comments

@jhoyt4
Copy link
Contributor

jhoyt4 commented Oct 26, 2023

With the introduction to Xcode 15, Apple has moved to a new linker and introduced the "-ld_classic" linker flag as a work around. Without this flag, FFMPEG fails to compile on systems with Xcode 15 (i.e. Sonoma) and possibly beyond.

I've successfully tested a fix at compile time by adding this line to the compile script (or manually in the shell)
export LDFLAGS="$LDFLAGS -Wl,-ld_classic"

  • Platform: macOS 14.0 (Sonoma) with Xcode 15 (arm64 and X86_64)

  • MythTV version: fixes/33 and master

  • Package version:

  • Component:ffmpeg

What steps will reproduce the bug?

Attempt to compile MythTV either manually or with the "compileMythfrontendAnsible.zsh" script in packaging.

How often does it reproduce? Is there a required condition?

Every time with Xcode 15

What is the expected behaviour?

Successful compilation.

What do you see instead?

Logs from v33 and master attached. X86_64 shows similar errors.

Additional information

See related FFMPEG bug report and proposed fix from the Spack community for proposed bandaid.

v33 ARM.txt
master ARM.txt

@jhoyt4 jhoyt4 changed the title macOS: ffmpeg linker error with Xcode 15 macOS: linker error (starting in ffmpeg) with Xcode 15 Oct 26, 2023
@jhoyt4
Copy link
Contributor Author

jhoyt4 commented Oct 26, 2023

I'm looking for a suggestion on where to add the "-ld_classic" linker flag so that it only gets fed to FFMPEG to see if that is the only component broken with the new linker.

@linuxdude42
Copy link
Contributor

Try adding "add_ldflags -ld_classic" somewhere in mythtv/external/FFmpeg/configure before the line that reads "cat > ffbuild/config.mak <<EOF".

@linuxdude42
Copy link
Contributor

Looks like I need a new mac mini. I can't upgrade past Monterey.

@jhoyt4
Copy link
Contributor Author

jhoyt4 commented Oct 26, 2023

Have you considered running OpenCore to patch your current system to run more a recent version?

@jhoyt4
Copy link
Contributor Author

jhoyt4 commented Oct 26, 2023

Try adding "add_ldflags -ld_classic" somewhere in mythtv/external/FFmpeg/configure before the line that reads "cat > ffbuild/config.mak <<EOF".

Thanks! I added "test ${clang_version%%.*} -ge 15 && add_ldflags -ld_classic" to line 5550 (in the darwin clang section). It's gotten past the FFMPEG issue and successfully compiled. Trying again with mythplugins. If all goes well, I'll work up a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants