jasonacox / Build-OpenSSL-cURL

Scripts to build OpenSSL, HTTP/2 (nghttp2) and cURL (libcurl) for MacOS, iOS and tvOS devices (x86_64, armv7, armv7s, arm64, arm64e). Now Supporting Apple Silicon, OpenSSL 3.0.x with TLS 1.3 and Mac Catalyst builds.
MIT License
419 stars 125 forks source link

Got error while build for tvOS Simulator #72

Open kvzn opened 1 month ago

kvzn commented 1 month ago

Got error while build for tvOS-Simulator

./build.sh -s 11.0 -m -e
ar qc test/libtestutil.a apps/lib/libtestutil-lib-opt.o test/testutil/libtestutil-lib-apps_shims.o test/testutil/libtestutil-lib-basic_output.o test/testutil/libtestutil-lib-cb.o test/testutil/libtestutil-lib-driver.o test/testutil/libtestutil-lib-fake_random.o test/testutil/libtestutil-lib-format_output.o test/testutil/libtestutil-lib-load.o test/testutil/libtestutil-lib-main.o test/testutil/libtestutil-lib-options.o test/testutil/libtestutil-lib-output.o test/testutil/libtestutil-lib-provider.o test/testutil/libtestutil-lib-random.o test/testutil/libtestutil-lib-stanza.o test/testutil/libtestutil-lib-test_cleanup.o test/testutil/libtestutil-lib-test_options.o test/testutil/libtestutil-lib-tests.o test/testutil/libtestutil-lib-testutil_init.o
/opt/homebrew/Cellar/perl/5.38.2_1/bin/perl apps/progs.pl "-H" "apps/openssl" > apps/progs.h
ranlib -c libssl.a || echo Never mind.
ranlib -c providers/liblegacy.a || echo Never mind.
/Applications/Xcode-14.3.1.app/Contents/Developer/usr/bin/gcc -arch arm64  -Iinclude  -arch arm64 -isysroot /Applications/Xcode-14.3.1.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator16.4.sdk -mtvos-version-min=9.0  -Os -arch arm64 -target arm64-apple-tvos9.0-simulator  -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -I.. -isysroot /Applications/Xcode-14.3.1.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator16.4.sdk -MMD -MF test/buildtest_c_aes-bin-buildtest_aes.d.tmp -MT test/buildtest_c_aes-bin-buildtest_aes.o -c -o test/buildtest_c_aes-bin-buildtest_aes.o test/buildtest_aes.c
ranlib -c test/libtestutil.a || echo Never mind.
ld: building for tvOS Simulator, but linking in .tbd built for macOS/Mac Catalyst, file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture arm64
/Applications/Xcode-14.3.1.app/Contents/Developer/usr/bin/gcc -arch arm64  -Iinclude  -arch arm64 -isysroot /Applications/Xcode-14.3.1.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator16.4.sdk -mtvos-version-min=9.0  -Os -arch arm64 -target arm64-apple-tvos9.0-simulator  -D_REENTRANT -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -I.. -isysroot /Applications/Xcode-14.3.1.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator16.4.sdk -MMD -MF test/buildtest_c_async-bin-buildtest_async.d.tmp -MT test/buildtest_c_async-bin-buildtest_async.o -c -o test/buildtest_c_async-bin-buildtest_async.o test/buildtest_async.c
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:12654: test/p_minimal.dylib] Error 1
make[1]: *** Waiting for unfinished jobs....
ld: building for tvOS Simulator, but linking in .tbd built for macOS/Mac Catalyst, file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:12667: test/p_test.dylib] Error 1
make[1]: Leaving directory '/Users/Elon/Build-OpenSSL-cURL/openssl/openssl-3.0.13'
make: *** [Makefile:2559: build_sw] Error 2
jasonacox commented 1 month ago

Hi @kvzn - It should have failed earlier with the -s 11.0 setting:

Building iOS libraries
Building openssl-3.0.13 for iPhoneOS  armv7 (iOS 11.0)
** ERROR with Build - Check /tmp/openssl*.log
clang: error: invalid iOS deployment version '-miphoneos-version-min=11.0', iOS 10 is the maximum deployment target for 32-bit targets [-Winvalid-ios-deployment-target]
make[1]: *** [apps/lib/libapps-lib-app_rand.o] Error 1
make: *** [build_sw] Error 2

I was able to get a successful compile with:

OPENSSL="3.0.13"        # https://www.openssl.org/source/ 
LIBCURL="8.7.1"         # https://curl.haxx.se/download.html
NGHTTP2="1.60.0"        # https://nghttp2.org/

./build.sh -m -e   

Did you remove the arm7 targets?

kvzn commented 1 month ago

Hi @kvzn - It should have failed earlier with the -s 11.0 setting:

Building iOS libraries
Building openssl-3.0.13 for iPhoneOS  armv7 (iOS 11.0)
** ERROR with Build - Check /tmp/openssl*.log
clang: error: invalid iOS deployment version '-miphoneos-version-min=11.0', iOS 10 is the maximum deployment target for 32-bit targets [-Winvalid-ios-deployment-target]
make[1]: *** [apps/lib/libapps-lib-app_rand.o] Error 1
make: *** [build_sw] Error 2

I was able to get a successful compile with:

OPENSSL="3.0.13"        # https://www.openssl.org/source/ 
LIBCURL="8.7.1"         # https://curl.haxx.se/download.html
NGHTTP2="1.60.0"        # https://nghttp2.org/

./build.sh -m -e   

Did you remove the arm7 targets?

Got the same error even I do like this:

OPENSSL="3.0.13"        # https://www.openssl.org/source/ 
LIBCURL="8.7.1"         # https://curl.haxx.se/download.html
NGHTTP2="1.60.0"        # https://nghttp2.org/

./build.sh -m -e   

I didn't remove arm7 cause I don't know where to.

jasonacox commented 1 month ago

Hi @kvzn - I noticed this:

/Applications/Xcode-14.3.1.app

I'm running this version on all my Macs:

$ xcodebuild -version
Xcode 15.3
Build version 15E204a

I'll try to download that version to test. Are you able to upgrade to 15.3?