Skip to content

Commit

Permalink
macOS: upgrade earliest supported version to 10.13
Browse files Browse the repository at this point in the history
Prevent use of API newer than deployment target
Patch orc to prevent use of pthread_jit functions on 10.x
  • Loading branch information
lovell committed Nov 8, 2022
1 parent 34c25b5 commit 3b4b9ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ for flavour in darwin-x64 darwin-arm64v8; do
# Use pkg-config provided by Homebrew
export PKG_CONFIG="$(brew --prefix)/bin/pkg-config --static"

# 10.9 should be a good minimal release target
export MACOSX_DEPLOYMENT_TARGET="10.9"
# Earliest supported version of macOS
export MACOSX_DEPLOYMENT_TARGET="10.13"

# Added -fno-stack-check to workaround a stack misalignment bug on macOS 10.15
# See:
# https://forums.developer.apple.com/thread/121887
# https://trac.ffmpeg.org/ticket/8073#comment:12
export FLAGS="-fno-stack-check"
# Prevent use of API newer than the deployment target
export FLAGS+=" -Werror=unguarded-availability-new"

if [ $PLATFORM = "darwin-arm64v8" ]; then
# ARM64 builds work via cross compilation from an x86_64 machine
Expand Down
4 changes: 4 additions & 0 deletions build/lin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ make install-strip
mkdir ${DEPS}/orc
$CURL https://gstreamer.freedesktop.org/data/src/orc/orc-${VERSION_ORC}.tar.xz | tar xJC ${DEPS}/orc --strip-components=1
cd ${DEPS}/orc
# Prevent detection of pthread_jit for macOS 10 deployment target
if [ "$PLATFORM" == "darwin-x64" ]; then
sed -i'.bak' "s/cc.has_function('pthread_jit_write_protect_np')/false/" meson.build
fi
meson setup _build --default-library=static --buildtype=release --strip --prefix=${TARGET} ${MESON} \
-Dorc-test=disabled -Dbenchmarks=disabled -Dexamples=disabled -Dgtk_doc=disabled -Dtests=disabled -Dtools=disabled
ninja -C _build
Expand Down
4 changes: 2 additions & 2 deletions darwin-x64/Toolchain.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SET(CMAKE_C_COMPILER clang)
SET(CMAKE_CXX_COMPILER clang++)

# 10.9 should be a good minimal release target
SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
# Earliest supported version of macOS
SET(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
Expand Down

0 comments on commit 3b4b9ce

Please sign in to comment.