Skip to content

Commit

Permalink
deps.ffmpeg: Force classic linker for AppleClang 15.0.0+
Browse files Browse the repository at this point in the history
Works around linker issues introduced by Xcode 15 beta 2 (tracked as
FB13208302).
  • Loading branch information
PatTheMav authored and RytoEX committed Feb 8, 2024
1 parent 4366d45 commit 6b2b373
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
22 changes: 20 additions & 2 deletions deps.ffmpeg/40-x264.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,26 @@ config() {
autoload -Uz universal_config && universal_config
return
;;
macos-arm64) args+=(--host="aarch64-apple-darwin${target_config[darwin_target]}") ;;
macos-x86_64) args+=(--host="x86_64-apple-darwin${target_config[darwin_target]}") ;;
macos-arm64)
args+=(--host="aarch64-apple-darwin${target_config[darwin_target]}")

local clang_version=$(clang --version | head -1 | cut -d ' ' -f 4)

autoload -Uz is-at-least
if is-at-least 15.0.0 ${clang_version}; then
ld_flags+=(-Wl,-ld_classic)
fi
;;
macos-x86_64)
args+=(--host="x86_64-apple-darwin${target_config[darwin_target]}")

local clang_version=$(clang --version | head -1 | cut -d ' ' -f 4)

autoload -Uz is-at-least
if is-at-least 15.0.0 ${clang_version}; then
ld_flags+=(-Wl,-ld_classic)
fi
;;
windows-x*)
args+=(
--host="${target_config[cross_prefix]}-pc-mingw32"
Expand Down
7 changes: 7 additions & 0 deletions deps.ffmpeg/99-ffmpeg.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ config() {
${ld_flags}
)

local clang_version=$(clang --version | head -1 | cut -d ' ' -f 4)

autoload -Uz is-at-least
if is-at-least 15.0.0 ${clang_version}; then
ff_ldflags+=(-Wl,-ld_classic)
fi

args+=(
--cc=clang
--cxx=clang++
Expand Down

0 comments on commit 6b2b373

Please sign in to comment.