cURL / Mailing Lists / curl-library / Single Mail

curl-library

Build for iOS Simulator fails on macOS Sierra

From: Peter White (jawhite2) <jawhite2_at_cisco.com>
Date: Tue, 20 Sep 2016 15:48:49 +0000

Hi there,

While trying to build libcurl 7.50.3 for iOS Simulator on macOS Sierra, I'm getting to the point where it checks whether it's cross-compiling, but when it tries to run "./conftest" after the check, the build fails with the following error below.

OS: macOS Sierra (v10.12). Darwin kernel version 16.0.0
Libcurl version build: v7.50.3
Building libcurl for iOS Simulator 10 with Xcode 8 GM seed.

Configure command used:

  $ ./configure --enable-ipv6 --enable-http --enable-tftp --enable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual --enable-file --without-zlib --without-ca-bundle --without-ca-path --with-ssl=/Volumes/local/trunk/dependencies/openssl --enable-optimize --enable-shared=no --build=i386-apple-darwin16.0.0
....

configure:4469: checking whether we are cross compiling

configure:4477: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o conftest -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/ -miphoneos-version-min=9.0 -arch i386 -g -Os -DNDEBUG -I/Volumes/local/trunk/dependencies/openssl/include -Werror=partial-availability conftest.c >&5

configure:4481: $? = 0
configure:4488: ./conftest
dyld: mach-o, but built for simulator (not macOS)
./configure: line 4490: 71522 Abort trap: 6 ./conftest$ac_cv_exeext
configure:4492: $? = 134
configure:4499: error: in `/Volumes/local/trunk':
configure:4501: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.

However I'm not trying to cross-compile as iOS Simulator is run on the same architecture as the host machine.

The same compile command is used on OSX10.11 with the exception of the --build arg (see below) and runs without error.

Other build:
OS: OSX10.11. Darwin kernel version 15.6.0
Libcurl version build: v7.50.3
Building libcurl for iOS Simulator 10 with Xcode 8 GM seed.

$ ./configure --enable-ipv6 --enable-http --enable-tftp --enable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-telnet --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual --enable-file --without-zlib --without-ca-bundle --without-ca-path --with-ssl=/Users/peter/libcurl/trunk/dependencies/openssl --enable-optimize --enable-shared=no --build=i386-apple-darwin15.6.0
....
configure:4469: checking whether we are cross compiling
configure:4477: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -o conftest -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/ -miphoneos-version-min=9.0 -arch i386 -g -Os -DNDEBUG -I/Users/peter/libcurl/trunk/dependencies/openssl/include -Werror=partial-availability conftest.c >&5
configure:4481: $? = 0
configure:4488: ./conftest
configure:4492: $? = 0
configure:4507: result: no

I've checked for differences in each of the config.log files prior to the error but aside from OS differences (kernel version etc), I can't tell any difference as to why macOS Sierra fails when running the conftest files before the failure actually occurs.

Thanks,
Peter

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-09-20