From bb66d15d08513e50c6d66d6c6d78854ca0348ba1 Mon Sep 17 00:00:00 2001 From: Martin Aumüller Date: Wed, 27 Sep 2023 16:41:32 +0200 Subject: ffmpeg: fix build with XCode 15 (#40187) As reported in #40159, a shared library build of ffmpeg 6.0 fails with the linker that was added with XCode 15: ld: building exports trie: duplicate symbol '_av_ac3_parse_header' clang: error: linker command failed with exit code 1 (use -v to see invocation) Forcing the old linker with -Wl,-ld_classic works around this. --- var/spack/repos/builtin/packages/ffmpeg/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/ffmpeg/package.py b/var/spack/repos/builtin/packages/ffmpeg/package.py index cfc1db119c..ff597653ff 100644 --- a/var/spack/repos/builtin/packages/ffmpeg/package.py +++ b/var/spack/repos/builtin/packages/ffmpeg/package.py @@ -128,6 +128,10 @@ class Ffmpeg(AutotoolsPackage): headers.directories = [self.prefix.include] return headers + @when("@:6.0 %apple-clang@15:") + def setup_build_environment(self, env): + env.append_flags("LDFLAGS", "-Wl,-ld_classic") + def enable_or_disable_meta(self, variant, options): switch = "enable" if "+{0}".format(variant) in self.spec else "disable" return ["--{0}-{1}".format(switch, option) for option in options] -- cgit v1.2.3-60-g2f50