Hardware acceleration on IOS armv8
I'm trying to cross-compile gnutls 3.5.18
on macOS High Sierra
for IOS
platform. armv7
and armv7s
architectures both build successfully with hardware-acceleration enabled, but armv8
architecture build fails. Do you have any instructions for IOS armv8
cross-compilation?
I was successful at building armv8
on Android
. So I guess this issue is related with IOS/macOS
. I tried both Apple's GAS and libav/gas-preprocessor. I also tried gnutls 3.6.2
, but it failed with the same errors.
Flags
export CFLAGS="-arch arm64 -target aarch64-apple-darwin -march=armv8-a+crypto -std=c99 -Wno-unused-function -fstrict-aliasing -fembed-bitcode -DIOS -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -Os -Wno-ignored-optimization-argument -miphoneos-version-min=7.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/usr/include -I/tmp/prebuilt/ios-aarch64-apple-darwin/libiconv/include -I/tmp/prebuilt/ios-aarch64-apple-darwin/gmp/include"
export CXXFLAGS="-std=c++11 -fno-rtti -fembed-bitcode"
export LDFLAGS="-arch arm64 -march=armv8-a+crypto -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/usr/lib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/tmp/prebuilt/ios-aarch64-apple-darwin/libiconv/lib -L/tmp/prebuilt/ios-aarch64-apple-darwin/gmp/lib"
export CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
export CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
export AS="/tmp/.tmp/gas-preprocessor.pl -arch aarch64 -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -target aarch64-apple-darwin -march=armv8-a+crypto -std=c99 -Wno-unused-function -fstrict-aliasing -fembed-bitcode -DIOS -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -Os -Wno-ignored-optimization-argument -miphoneos-version-min=7.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk/usr/include"
Configure
--prefix=/tmp/new-build
--with-pic
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk
--with-included-unistring
--enable-hardware-acceleration
--enable-static
--disable-shared
--host=aarch64-apple-darwin
make
make -j4
...
...
Making all in aarch64
CC aarch64-common.lo
CC sha-aarch64.lo
CC hmac-sha-aarch64.lo
CC aes-cbc-aarch64.lo
CC aes-gcm-aarch64.lo
CC aes-ccm-aarch64.lo
CCAS elf/sha1-armv8.lo
CCAS elf/sha256-armv8.lo
<stdin>:1186:1: error: unknown directive
.inst 0x5e280803
^
<stdin>:1187:1: error: unknown directive
.inst 0x5e140020
^
<stdin>:1189:1: error: unknown directive
.inst 0x5e0630a4
^
<stdin>:1190:1: error: unknown directive
.inst 0x5e280802
^
<stdin>:1191:1: error: unknown directive
.inst 0x5e150060
^
...
<stdin>:1223:1: error: unknown directive
.inst 0x5e115041
^
make[5]: *** [elf/sha256-armv8.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1