curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Building cURL for Apple Silicon

From: Christian Schmitz via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 12 Nov 2020 17:07:32 +0100

> Am 12.11.2020 um 16:48 schrieb Taw via curl-library <curl-library_at_cool.haxx.se>:
>
> Hi,
> This is my first mail in a mailing-list so I hope I do this properly.
>
> I am trying to build cURL for Apple Silicon ARM (cross-compilation) using a macOS Intel host.
> How is done with other libraries (zlib, cjson, etc): just add "-target arm64-apple-macos11" to CFLAGS and that's it.

I've built it like this:



PATH=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin



export CC="clang"
export CXX="clang"
export CFLAGS=" -O2 -fembed-bitcode-marker -mmacosx-version-min=11.0 -arch arm64 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk "
export LDFLAGS=" -I.. -I/Users/cs/Development/Libs/zlib/zlib "
export CPPFLAGS=" -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk "
export MACOSX_DEPLOYMENT_TARGET="11.0"

make -j4 clean
./configure --enable-optimize --enable-static --enable-http --enable-ftp --enable-file --enable-ldap --enable-ldaps --enable-rtsp --enable-proxy --enable-dict --enable-telnet --enable-tftp --enable-pop3 --enable-imap --enable-smtp --enable-gopher --disable-manual --enable-libcurl-option --enable-ipv6 --enable-crypto-auth --enable-cookies --with-zlib --with-darwinssl --without-ca-bundle --without-ca-path --disable-openssl-auto-load-config --host=arm-apple-darwin12.4.0



So I use Xcode-beta and need to use the compiler with custom path.
The I use SDK root path and cross compile it.

Maybe this helps you?

Sincerely
Christian

-- 
Read our blog about news on our plugins:
http://www.mbsplugins.de/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2020-11-12