ios - Unknown cpu type when compiling OpenSSL FIPS Capable libraries for arm64 or arm7s -
i can (at least without warnings , resulting .a files) compile arm7, x86_64, , i386.
when compile arm64, unknown cpu type 100000c, no adjustments made
. when compile arm7s, unknown cpu type 100000c, no adjustments made
. script 2 architectures, modified , uses environment scripts https://github.com/noloader/openssl-1.0.1i-ios below including arm7, works , arm7s , arm64, followed log tail arm64. scripts build non-fips libraries before modification. incore_macho , fips canisters pre-generated , referenced script. created fips canisters modifying instructions openssl fips 2.0 user guide ios appendix, incredibly dated , not work on own. how can 1 compile fips capable library these 2 platforms?
edit:
i see libssl.a , libcrypto.a have been created , have correct architectures, incore_macho returns identical unknown cpu type
error.
update:
using copy of incore_macho updated armv7 @jww @ https://github.com/noloader/incore_macho, compiles without error arm7s, i'm under assumption core_macho may need updated arm64. can done?
sed -i "" 's|\"iphoneos-cross\"\,\"llvm-gcc\:-o3|\"iphoneos-cross\"\,\"clang\:-os|g' configure sed -i "" 's/cc= cc/cc= clang/g' makefile.org sed -i "" 's/cflag= -o/cflag= -os/g' makefile.org sed -i "" 's/makedepprog=makedepend/makedepprog=$(cc) -m/g' makefile.org export lang=$old_lang export cc=clang export ios_installdir="/usr/local/ssl/ios" unset openssldir ################################################################ # third, build armv7 echo "****************************************" this_arch=armv7 unset cross_arch . ./setenv-ios-$this_arch.sh export hostcc=/usr/bin/cc export hostcflags="-arch i386" export fips_sig="/tmp/incore_macho" ./config fips -no-ssl2 -no-ssl3 -no-asm -no-shared -no-hw -no-engine --with-fipsdir="/tmp/openssl fips-2.0.1-ios-${this_arch}" --openssldir=$ios_installdir sed -ie "s!^cflag=!cflag=-isysroot ${cross_top}/sdks/${cross_sdk} -miphoneos-version-min=7.1 !" "makefile" make clean 2>&1>/dev/null && make mkdir $this_arch \cp ./libcrypto.a $this_arch/libcrypto.a \cp ./libssl.a $this_arch/libssl.a ################################################################ # fourth, build armv7s echo "****************************************" this_arch=armv7s unset cross_arch . ./setenv-ios-$this_arch.sh export hostcc=/usr/bin/cc export hostcflags="-arch i386" export fips_sig="/tmp/incore_macho" ./config fips -no-ssl2 -no-ssl3 -no-asm -no-shared -no-hw -no-engine --with-fipsdir="/tmp/openssl-fips-2.0.1-ios-${this_arch}" --openssldir=$ios_installdir sed -ie "s!^cflag=!cflag=-isysroot ${cross_top}/sdks/${cross_sdk} -miphoneos-version-min=7.1 !" "makefile" make clean 2>&1>/dev/null && make mkdir $this_arch \cp ./libcrypto.a $this_arch/libcrypto.a \cp ./libssl.a $this_arch/libssl.a ################################################################ # fifth, build arm64 #echo "****************************************" this_arch=arm64 unset cross_arch . ./setenv-ios-$this_arch.sh export hostcc=/usr/bin/cc export hostcflags="-arch i386" export fips_sig="/tmp/incore_macho" ./config fips -no-ssl2 -no-ssl3 -no-asm -no-shared -no-hw -no-engine --with-fipsdir="/tmp/openssl-fips-2.0.1-ios-${this_arch}" --openssldir=$ios_installdir sed -ie "s!^cflag=!cflag=-isysroot ${cross_top}/sdks/${cross_sdk} -miphoneos-version-min=7.1 !" "makefile" make clean 2>&1>/dev/null && make mkdir $this_arch \cp ./libcrypto.a $this_arch/libcrypto.a \cp ./libssl.a $this_arch/libssl.a
tail of output arm64:
shlib_target=; if [ -n "" ]; \ shlib_target="darwin-shared"; \ elif [ -n "libcrypto" ]; \ fipsld_cc="/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang"; cc=/tmp/openssl-fips-2.0.1-ios-arm64/bin/fipsld; export cc fipsld_cc; \ fi; \ libraries="-l.. -lssl -l.. -lcrypto" ; \ make -f ../makefile.shared -e \ appname=openssl objects="openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o" \ libdeps="-wl,-search_paths_first $libraries " \ link_app.${shlib_target} ( :; libdeps="${libdeps:--wl,-search_paths_first -l.. -lssl -l.. -lcrypto }"; ldcmd="${ldcmd:-/tmp/openssl-fips-2.0.1-ios-arm64/bin/fipsld}"; ldflags="${ldflags:--isysroot /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos7.1.sdk -miphoneos-version-min=7.1 -dopenssl_threads -d_reentrant -ddso_dlfcn -dhave_dlfcn_h -arch arm64 -os -isysroot /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos7.1.sdk -fomit-frame-pointer -fno-common -i/tmp/openssl-fips-2.0.1-ios-arm64/include}"; libpath=`for x in $libdeps; echo $x; done | sed -e 's/^ *-l//;t' -e d | uniq`; libpath=`echo $libpath | sed -e 's/ /:/g'`; ld_library_path=$libpath:$ld_library_path ${ldcmd} ${ldflags} -o ${appname:=openssl} openssl.o verify.o asn1pars.o req.o dgst.o dh.o dhparam.o enc.o passwd.o gendh.o errstr.o ca.o pkcs7.o crl2p7.o crl.o rsa.o rsautl.o dsa.o dsaparam.o ec.o ecparam.o x509.o genrsa.o gendsa.o genpkey.o s_server.o s_client.o speed.o s_time.o apps.o s_cb.o s_socket.o app_rand.o version.o sess_id.o ciphers.o nseq.o pkcs12.o pkcs8.o pkey.o pkeyparam.o pkeyutl.o spkac.o smime.o cms.o rand.o engine.o ocsp.o prime.o ts.o srp.o ${libdeps} ) unknown cpu type 100000c, no adjustments made
it work if add cpu_adjustment[]
cpu_type_arm64, cpu_subtype_arm64_all, 12, 12 ,
for reference:
#define cpu_arch_abi64 0x01000000 /* 64 bit abi */ #define cpu_type_arm64 (cpu_type_arm | cpu_arch_abi64) /* * arm64 subtypes */ #define cpu_subtype_arm64_all ((cpu_subtype_t) 0)
finding adjustment fun. ;-)
Comments
Post a Comment