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
432 stars 132 forks source link

MacOS/ARM build of libcurl is failing #55

Open hurlybird opened 3 years ago

hurlybird commented 3 years ago

I'm getting the following build errors from libcurl for arm64 on MacOS. After digging, I suspect the output regarding VS projects is misleading since the x86_64 build seems to complete properly. A big problem is that the log files mentioned aren't getting generated--or are getting deleted before I can check them. Any suggestions?

Building Mac libraries
Building curl-7.74.0 for x86_64 (MacOS 11.1)
Testing binary for x86_64:
curl 7.74.0 (x86_64-apple-darwin) libcurl/7.74.0 OpenSSL/1.1.1i zlib/1.2.11
Release-Date: 2020-12-09
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
Building curl-7.74.0 for arm64 (MacOS 11.1)
** ERROR with Build - Check /tmp/curl*.log
==> /tmp/curl-7.74.0-arm64.log <==
make[2]: *** [curl] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

==> /tmp/curl-7.74.0-x86_64.log <==
test -z "projects/Windows/VC6/lib/libcurl.dsp.dist projects/Windows/VC6/src/curl.dsp.dist projects/Windows/VC7/lib/libcurl.vcproj.dist projects/Windows/VC7/src/curl.vcproj.dist projects/Windows/VC7.1/lib/libcurl.vcproj.dist projects/Windows/VC7.1/src/curl.vcproj.dist projects/Windows/VC8/lib/libcurl.vcproj.dist projects/Windows/VC8/src/curl.vcproj.dist projects/Windows/VC9/lib/libcurl.vcproj.dist projects/Windows/VC9/src/curl.vcproj.dist projects/Windows/VC10/lib/libcurl.vcxproj.dist projects/Windows/VC10/src/curl.vcxproj.dist projects/Windows/VC11/lib/libcurl.vcxproj.dist projects/Windows/VC11/src/curl.vcxproj.dist projects/Windows/VC12/lib/libcurl.vcxproj.dist projects/Windows/VC12/src/curl.vcxproj.dist projects/Windows/VC14/lib/libcurl.vcxproj.dist projects/Windows/VC14/src/curl.vcxproj.dist projects/Windows/VC15/lib/libcurl.vcxproj.dist projects/Windows/VC15/src/curl.vcxproj.dist" || rm -f projects/Windows/VC6/lib/libcurl.dsp.dist projects/Windows/VC6/src/curl.dsp.dist projects/Windows/VC7/lib/libcurl.vcproj.dist projects/Windows/VC7/src/curl.vcproj.dist projects/Windows/VC7.1/lib/libcurl.vcproj.dist projects/Windows/VC7.1/src/curl.vcproj.dist projects/Windows/VC8/lib/libcurl.vcproj.dist projects/Windows/VC8/src/curl.vcproj.dist projects/Windows/VC9/lib/libcurl.vcproj.dist projects/Windows/VC9/src/curl.vcproj.dist projects/Windows/VC10/lib/libcurl.vcxproj.dist projects/Windows/VC10/src/curl.vcxproj.dist projects/Windows/VC11/lib/libcurl.vcxproj.dist projects/Windows/VC11/src/curl.vcxproj.dist projects/Windows/VC12/lib/libcurl.vcxproj.dist projects/Windows/VC12/src/curl.vcxproj.dist projects/Windows/VC14/lib/libcurl.vcxproj.dist projects/Windows/VC14/src/curl.vcxproj.dist projects/Windows/VC15/lib/libcurl.vcxproj.dist projects/Windows/VC15/src/curl.vcxproj.dist
rm -rf .libs _libs
rm -f *.lo
jasonacox commented 3 years ago

On any error the build script lists all of the *.log files from the builds. They are not in any particular order which is probably something I should look to improve. In your example, the build is failing building the arm64 MacOS (M1) binary:

Building curl-7.74.0 for arm64 (MacOS 11.1)
==> /tmp/curl-7.74.0-arm64.log <==
make[2]: *** [curl] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

It doesn't show enough for us to see the reason for the build error. Try cat /tmp/curl-7.74.0-arm64.log to see what else may be above the make failure.

The second build log is actually a successful one (you can disregard the Windows reference as that is part of the curl make process and doesn't result in any errors).

hurlybird commented 3 years ago

Yeah, I figured as much after looking at it more closely. Unfortunately the log files either aren't getting created or are being deleted. I can see some of the logs for the openssl build while the build is still ongoing, but even those get deleted at some point.

I only need the iOS build so I hacked up the script to only build the pieces I need as a workaround. I'll probably dig through it more if/when I need the MacOS version.

fallending commented 3 years ago

In my case: MacOS x86_64

CC curl-tool_strdup.o CC curl-tool_setopt.o CC curl-tool_sleep.o CC curl-tool_urlglob.o CC curl-tool_util.o CC curl-tool_vms.o CC curl-tool_writeout.o CC curl-tool_writeout_json.o CC curl-tool_xattr.o CC ../lib/curl-strtoofft.o CC ../lib/curl-nonblock.o CC ../lib/curl-warnless.o CC ../lib/curl-curl_ctype.o CC ../lib/curl-curl_multibyte.o CC ../lib/curl-version_win32.o CC ../lib/curl-dynbuf.o CCLD curl ld: warning: ignoring file ../lib/.libs/libcurl.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 ) Undefined symbols for architecture x86_64: "_curl_easy_cleanup", referenced from: _tool_list_engines in curl-tool_help.o _post_per_transfer in curl-tool_operate.o _create_transfer in curl-tool_operate.o _single_transfer in curl-tool_operate.o _add_file_name_to_url in curl-tool_operhlp.o "_curl_easy_escape", referenced from: _getparameter in curl-tool_getparam.o _add_file_name_to_url in curl-tool_operhlp.o "_curl_easy_getinfo", referenced from: _tool_header_cb in curl-tool_cb_hdr.o _tool_list_engines in curl-tool_help.o _operate in curl-tool_operate.o _post_per_transfer in curl-tool_operate.o _create_transfer in curl-tool_operate.o _ourWriteOut in curl-tool_writeout.o _ourWriteOutJSON in curl-tool_writeout_json.o ... "_curl_easy_init", referenced from: _tool_list_engines in curl-tool_help.o _create_transfer in curl-tool_operate.o _single_transfer in curl-tool_operate.o _add_file_name_to_url in curl-tool_operhlp.o "_curl_easy_pause", referenced from: _tool_progress_cb in curl-tool_cb_prg.o _tool_readbusy_cb in curl-tool_cb_rea.o _tool_write_cb in curl-tool_cb_wrt.o _xferinfo_cb in curl-tool_progress.o

any advices? thx!!!!

fallending commented 3 years ago

Code formatting ugly in last msg, So i copied here:

ld: warning: ignoring file ../lib/.libs/libcurl.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )