Skip to content

Commit

Permalink
libvpx: fix configuration for arm64
Browse files Browse the repository at this point in the history
* Disable switch to the iphoneos sdk for arm targets
* Disable unsupported "runtime-cpu-detect" feature on arm64
* Add arm64 to `supported_archs`

Fixes: https://trac.macports.org/ticket/60940
  • Loading branch information
jpanetta authored and kencu committed Feb 4, 2021
1 parent 7669082 commit d78818b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
11 changes: 10 additions & 1 deletion multimedia/libvpx/Portfile
Expand Up @@ -32,7 +32,7 @@ git.url https://chromium.googlesource.com/webm/${name}
git.branch v${version}

# support for non-intel archs removed in version 1.5.0
supported_archs x86_64 i386
supported_archs x86_64 i386 arm64

depends_build-append port:yasm

Expand Down Expand Up @@ -72,6 +72,14 @@ configure.args --enable-vp8 \
--disable-examples \
--disable-unit-tests

# libvpx does not yet support runtime detection of NEON features on macOS/iOS.
# For arm64 builds (and universal builds targeting arm) we disable this feature,
# meaning NEON support is determined at compile time.
# For x86* architectures in universal builds, this feature is re-enabled below.
if { ${build_arch} eq "arm64" || [variant_isset universal] } {
configure.args-delete --enable-runtime-cpu-detect
}

configure.env LD=${configure.cc}

# add in when docs are installed correctly
Expand Down Expand Up @@ -113,6 +121,7 @@ foreach my_arch {i386 x86_64} {
if {[info exists my_targets(${my_arch})]} {
set merger_configure_args(${my_arch}) --force-target=$my_targets(${my_arch})-${os.platform}-gcc
}
lappend merger_configure_args(${my_arch}) --enable-runtime-cpu-detect
}
if {![info exists universal_possible]} {
set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
Expand Down
31 changes: 25 additions & 6 deletions multimedia/libvpx/files/patch-build-make-configure.sh.diff
@@ -1,11 +1,30 @@
--- build/make/configure.sh.orig 2020-08-01 00:27:21.000000000 +0200
+++ build/make/configure.sh 2020-08-01 00:29:56.000000000 +0200
@@ -854,7 +854,7 @@
fi
;;
x86*-darwin*)
--- build/make/configure.sh.orig 2020-11-26 14:23:30.000000000 -0800
+++ build/make/configure.sh 2020-11-26 14:26:37.000000000 -0800
@@ -845,16 +845,8 @@
# Handle darwin variants. Newer SDKs allow targeting older
# platforms, so use the newest one available.
case ${toolchain} in
- arm*-darwin*)
- add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
- iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
- if [ -d "${iphoneos_sdk_dir}" ]; then
- add_cflags "-isysroot ${iphoneos_sdk_dir}"
- add_ldflags "-isysroot ${iphoneos_sdk_dir}"
- fi
- ;;
- x86*-darwin*)
- osx_sdk_dir="$(show_darwin_sdk_path macosx)"
+ *-darwin*)
+ osx_sdk_dir="$(configure.sdkroot)"
if [ -d "${osx_sdk_dir}" ]; then
add_cflags "-isysroot ${osx_sdk_dir}"
add_ldflags "-isysroot ${osx_sdk_dir}"
@@ -1085,7 +1077,7 @@
;;

darwin*)
- if ! enabled external_build; then
+ if false; then
XCRUN_FIND="xcrun --sdk iphoneos --find"
CXX="$(${XCRUN_FIND} clang++)"
CC="$(${XCRUN_FIND} clang)"

0 comments on commit d78818b

Please sign in to comment.