diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ffmpeg/module.defs | 2 | ||||
-rw-r--r-- | contrib/libdav1d/P00-darwin-add-applesi-cross-file.patch | 26 | ||||
-rw-r--r-- | contrib/libdav1d/module.defs | 4 | ||||
-rw-r--r-- | contrib/libvpx/P00-darwin-applesi.patch | 157 | ||||
-rw-r--r-- | contrib/libvpx/module.defs | 6 | ||||
-rw-r--r-- | contrib/x264/P00-darwin-applesi.patch | 75 | ||||
-rw-r--r-- | contrib/x264/module.defs | 4 |
7 files changed, 272 insertions, 2 deletions
diff --git a/contrib/ffmpeg/module.defs b/contrib/ffmpeg/module.defs index 1c2859f7c..8733e954d 100644 --- a/contrib/ffmpeg/module.defs +++ b/contrib/ffmpeg/module.defs @@ -94,6 +94,8 @@ ifeq (darwin,$(HOST.system)) ifeq (x86_64,$(HOST.arch)) FFMPEG.CONFIGURE.extra += --arch=x86_64 + else ifeq (arm64,$(HOST.arch)) + FFMPEG.CONFIGURE.extra += --arch=arm64 endif endif diff --git a/contrib/libdav1d/P00-darwin-add-applesi-cross-file.patch b/contrib/libdav1d/P00-darwin-add-applesi-cross-file.patch new file mode 100644 index 000000000..def365bda --- /dev/null +++ b/contrib/libdav1d/P00-darwin-add-applesi-cross-file.patch @@ -0,0 +1,26 @@ +From 3827c5676f4701af1b4995033d52768f9e225ec2 Mon Sep 17 00:00:00 2001 +Date: Mon, 1 Jun 2020 08:41:42 -0700 +Subject: [PATCH] arm64-cross-file + +--- + arm64-darwin-gcc.meson | 9 +++++++++ + 1 file changed, 9 insertions(+) + create mode 100644 arm64-darwin-gcc.meson + +diff --git a/arm64-darwin-gcc.meson b/arm64-darwin-gcc.meson +new file mode 100644 +index 0000000..2ddbe93 +--- /dev/null ++++ b/arm64-darwin-gcc.meson +@@ -0,0 +1,9 @@ ++[binaries] ++c = 'clang' ++cpp = 'clang++' ++[host_machine] ++system = 'darwin' ++cpu_family = 'aarch64' ++cpu = 'aarch64' ++endian = 'little' ++ +-- +2.24.2 (Apple Git-127) diff --git a/contrib/libdav1d/module.defs b/contrib/libdav1d/module.defs index 395c5c2ac..c296c836c 100644 --- a/contrib/libdav1d/module.defs +++ b/contrib/libdav1d/module.defs @@ -29,6 +29,10 @@ else endif endif +ifeq (arm64-darwin,$(HOST.machine)-$(HOST.system)) + LIBDAV1D.CONFIGURE.extra += --cross-file=$(call fn.ABSOLUTE,$(LIBDAV1D.EXTRACT.dir/))/arm64-darwin-gcc.meson -Dc_args="-arch arm64" +endif + ifeq (1-mingw,$(HOST.cross)-$(HOST.system)) LIBDAV1D.CONFIGURE.extra += --cross-file=$(call fn.ABSOLUTE,$(LIBDAV1D.EXTRACT.dir/))$(HOST.machine)-w64-mingw32.meson endif diff --git a/contrib/libvpx/P00-darwin-applesi.patch b/contrib/libvpx/P00-darwin-applesi.patch new file mode 100644 index 000000000..d5e73fa3d --- /dev/null +++ b/contrib/libvpx/P00-darwin-applesi.patch @@ -0,0 +1,157 @@ +From 42c387601ec8ebb84447a92879abe14f9af4de5a Mon Sep 17 00:00:00 2001 +Date: Mon, 1 Jun 2020 07:57:47 -0700 +Subject: [PATCH] arm64-darwin-fixes + +--- + build/make/configure.sh | 80 +++++++++++++++++++++++++++++++++++------ + 1 file changed, 70 insertions(+), 10 deletions(-) + +diff --git a/build/make/configure.sh b/build/make/configure.sh +index 472e7de..fbe5e97 100644 +--- a/build/make/configure.sh ++++ b/build/make/configure.sh +@@ -737,6 +737,9 @@ process_common_toolchain() { + aarch64*) + tgt_isa=arm64 + ;; ++ arm64*) ++ tgt_isa=arm64 ++ ;; + armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf) + tgt_isa=armv7 + float_abi=hard +@@ -768,35 +771,35 @@ process_common_toolchain() { + # detect tgt_os + case "$gcctarget" in + *darwin10*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin10 + ;; + *darwin11*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin11 + ;; + *darwin12*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin12 + ;; + *darwin13*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin13 + ;; + *darwin14*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin14 + ;; + *darwin15*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin15 + ;; + *darwin16*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin16 + ;; + *darwin17*) +- tgt_isa=x86_64 ++ #tgt_isa=x86_64 + tgt_os=darwin17 + ;; + x86_64*mingw32*) +@@ -873,7 +876,7 @@ process_common_toolchain() { + # Handle darwin variants. Newer SDKs allow targeting older + # platforms, so use the newest one available. + case ${toolchain} in +- arm*-darwin*) ++ arm*-ios*) + add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}" + iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)" + if [ -d "${iphoneos_sdk_dir}" ]; then +@@ -881,6 +884,13 @@ process_common_toolchain() { + add_ldflags "-isysroot ${iphoneos_sdk_dir}" + fi + ;; ++ arm*-darwin*) ++ osx_sdk_dir="$(show_darwin_sdk_path macosx)" ++ if [ -d "${osx_sdk_dir}" ]; then ++ add_cflags "-isysroot ${osx_sdk_dir}" ++ add_ldflags "-isysroot ${osx_sdk_dir}" ++ fi ++ ;; + x86*-darwin*) + osx_sdk_dir="$(show_darwin_sdk_path macosx)" + if [ -d "${osx_sdk_dir}" ]; then +@@ -1104,7 +1114,7 @@ EOF + soft_enable unit_tests + ;; + +- darwin*) ++ ios*) + XCRUN_FIND="xcrun --sdk iphoneos --find" + CXX="$(${XCRUN_FIND} clang++)" + CC="$(${XCRUN_FIND} clang)" +@@ -1162,6 +1172,56 @@ EOF + fi + ;; + ++ darwin*) ++ XCRUN_FIND="xcrun --sdk macosx --find" ++ CXX="$(${XCRUN_FIND} clang++)" ++ CC="$(${XCRUN_FIND} clang)" ++ AR="$(${XCRUN_FIND} ar)" ++ AS="$(${XCRUN_FIND} as)" ++ STRIP="$(${XCRUN_FIND} strip)" ++ NM="$(${XCRUN_FIND} nm)" ++ RANLIB="$(${XCRUN_FIND} ranlib)" ++ AS_SFX=.S ++ LD="${CXX:-$(${XCRUN_FIND} ld)}" ++ ++ # ASFLAGS is written here instead of using check_add_asflags ++ # because we need to overwrite all of ASFLAGS and purge the ++ # options that were put in above ++ ASFLAGS="-arch ${tgt_isa} -g" ++ ++ add_cflags -arch ${tgt_isa} ++ add_ldflags -arch ${tgt_isa} ++ ++ alt_libc="$(show_darwin_sdk_path macosx)" ++ if [ -d "${alt_libc}" ]; then ++ add_cflags -isysroot ${alt_libc} ++ fi ++ ++ for d in lib usr/lib usr/lib/system; do ++ try_dir="${alt_libc}/${d}" ++ [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}" ++ done ++ ++ case ${tgt_isa} in ++ armv7|armv7s|armv8|arm64) ++ if enabled neon && ! check_xcode_minimum_version; then ++ soft_disable neon ++ log_echo " neon disabled: upgrade Xcode (need v6.3+)." ++ if enabled neon_asm; then ++ soft_disable neon_asm ++ log_echo " neon_asm disabled: upgrade Xcode (need v6.3+)." ++ fi ++ fi ++ ;; ++ esac ++ ++ asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl" ++ ++ ;; ++ ++ ++ ++ + linux*) + enable_feature linux + if enabled rvct; then +-- +2.24.2 (Apple Git-127) diff --git a/contrib/libvpx/module.defs b/contrib/libvpx/module.defs index e3c1809ea..003a9aae6 100644 --- a/contrib/libvpx/module.defs +++ b/contrib/libvpx/module.defs @@ -36,8 +36,10 @@ ifeq (linux,$(HOST.system)) endif endif -ifeq (0-darwin,$(HOST.cross)-$(BUILD.system)) - ifeq (x86_64,$(BUILD.machine)) +ifeq (darwin,$(HOST.system)) + ifeq (arm64,$(HOST.machine)) + LIBVPX.CONFIGURE.extra += --target=arm64-darwin-gcc + else ifeq (x86_64,$(HOST.machine)) LIBVPX.CONFIGURE.extra += --target=x86_64-darwin14-gcc endif endif diff --git a/contrib/x264/P00-darwin-applesi.patch b/contrib/x264/P00-darwin-applesi.patch new file mode 100644 index 000000000..e5cb47bc1 --- /dev/null +++ b/contrib/x264/P00-darwin-applesi.patch @@ -0,0 +1,75 @@ +From ff750fd9797ee200daf5915c84c88dce5074498e Mon Sep 17 00:00:00 2001 +Date: Mon, 1 Jun 2020 09:36:04 -0700 +Subject: [PATCH] arm64-config + +--- + config.sub | 4 ++-- + configure | 24 ++++++++++++------------ + 2 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/config.sub b/config.sub +index 8df5511..72e9265 100755 +--- a/config.sub ++++ b/config.sub +@@ -255,7 +255,7 @@ case $basic_machine in + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ +- | aarch64 | aarch64_be \ ++ | aarch64 | aarch64_be | arm64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +@@ -369,7 +369,7 @@ case $basic_machine in + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ +- | aarch64-* | aarch64_be-* \ ++ | aarch64-* | aarch64_be-* | arm64*-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ +diff --git a/configure b/configure +index 07ba449..d47de9a 100755 +--- a/configure ++++ b/configure +@@ -788,6 +788,18 @@ case $host_cpu in + AS="${AS-${CC}}" + AS_EXT=".c" + ;; ++ aarch64|arm64*) ++ ARCH="AARCH64" ++ stack_alignment=16 ++ if [ "$SYS" = MACOSX ] ; then ++ AS="${AS-${CC}}" ++ ASFLAGS="$ASFLAGS -DPREFIX -DPIC" ++ elif [ "$SYS" = WINDOWS ] && [ "$compiler" = CL ] ; then ++ AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch aarch64 -as-type armasm -- armasm64 -nologo}" ++ else ++ AS="${AS-${CC}}" ++ fi ++ ;; + arm*) + ARCH="ARM" + if [ "$SYS" = MACOSX ] ; then +@@ -806,18 +818,6 @@ case $host_cpu in + AS="${AS-${CC}}" + fi + ;; +- aarch64) +- ARCH="AARCH64" +- stack_alignment=16 +- if [ "$SYS" = MACOSX ] ; then +- AS="${AS-${CC}}" +- ASFLAGS="$ASFLAGS -DPREFIX -DPIC" +- elif [ "$SYS" = WINDOWS ] && [ "$compiler" = CL ] ; then +- AS="${AS-${SRCPATH}/tools/gas-preprocessor.pl -arch aarch64 -as-type armasm -- armasm64 -nologo}" +- else +- AS="${AS-${CC}}" +- fi +- ;; + s390|s390x) + ARCH="S390" + ;; +-- +2.24.2 (Apple Git-127) diff --git a/contrib/x264/module.defs b/contrib/x264/module.defs index f9bd448ae..f5d8b9e1a 100644 --- a/contrib/x264/module.defs +++ b/contrib/x264/module.defs @@ -19,6 +19,10 @@ ifeq (1,$(HOST.cross)) X264.CONFIGURE.env.LDFLAGS = LDFLAGS="-L$(call fn.ABSOLUTE,$(CONTRIB.build/)lib) $(call fn.ARGS,X264.GCC,*archs *sysroot *minver)" endif +ifeq (arm64-darwin,$(HOST.machine)-$(HOST.system)) + X264.CONFIGURE.extra += --host=arm64-apple-darwin +endif + ifeq (1,$(FEATURE.flatpak)) X264.CONFIGURE.extra += --enable-pic endif |