Closed jeffreyc2017 closed 2 years ago
hi @jeffreyc2017 -
building for iOS-armv7 but attempting to link with file built for macOS-x86_64
Did you happen to install the Xcode update and iOS SDKs? It is trying to link in the Apple libz but not finding the arm7 iOS architecture on your local system. This may be an issue with Big Sur. I need to upgrade my intel gear to test. I have Big Sur compiling arm7 targets on Apple Silicon but not on intel yet.
Thanks @jasonacox
Yeah I've updated Xcode to 12.2 and iPhoneOS14.2.sdk exists in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs. My MBP is using Intel Core i7 with macOS Big Sur 11.0.1.
% xcodebuild -version
Xcode 12.2
Build version 12B45b
% system_profiler SPDeveloperToolsDataType
Developer:
Developer Tools:
Version: 12.2 (12B45b)
Location: /Applications/Xcode.app
Applications:
Xcode: 12.2 (17535)
Instruments: 12.2 (64541.11)
SDKs:
iOS:
14.2: (18B79)
iOS Simulator:
14.2: (18B79)
macOS:
11.0: (20A2408)
20.0:
tvOS:
14.2: (18K54)
tvOS Simulator:
14.2: (18K54)
watchOS:
7.1: (18R579)
watchOS Simulator:
7.1: (18R579)
% which make
/usr/bin/make
% make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
Hi @jeffreyc2017 - I'm not able to reproduce your issue with Big Sur. I'm able to get the binaries built and linked without error.
I did notice this line:
ld: warning: ignoring file /usr/local/lib/libz.dylib, building for iOS-armv7 but attempting to link with file built for macOS-x86_64
That (/usr/local path) seems to indicate that you have installed a custom (non-Apple) version of libz.dylib. That would likely conflict with linking to the correct libraries for the different architectures that are located here: /Applications/Xcode.app/Contents/Developer/Platforms/
I recommend you try removing the custom built libz and use the one provided by Xcode to see if that fixes the problem.
Hi @jeffreyc2017 - Let me know if that helped or if you still see the same issue with the latest build script.
Thanks @jasonacox . Yeah I'm still getting the same issue with the latest build script. Still no idea how to fix it.
Ok. I recommend disabling the non-native /usr/local/lib/libz.dylib that you have in your build include path and force xcode to use the Apple library. You can try to temporarily disable it with something like:
sudo mv /usr/local/lib/libz.dylib /usr/local/lib/libz.dylib-disable
# revert it back with sudo mv /usr/local/lib/libz.dylib-disable /usr/local/lib/libz.dylib
Try to run the build again and see if that helps with the errors.
Thanks @jasonacox . I ran the above command, and also tried removing the libz files in /usr/local/lib
to trash bin, still got the error
Building Mac libraries
Building curl-7.74.0 for x86_64 (MacOS 11.2.3)
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 brotli/1.0.9 zstd/1.4.9 libidn2/2.3.0 nghttp2/1.42.0 librtmp/2.3
Release-Date: 2020-12-09
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli HTTP2 HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets zstd
Building curl-7.74.0 for arm64 (MacOS 11.2.3)
** 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
Libraries...
But the log doesn't exist
% cat /tmp/curl-7.74.0-x86_64.log
cat: /tmp/curl-7.74.0-x86_64.log: No such file or directory
Building Mac libraries ... ==> /tmp/curl-7.74.0-arm64.log <== make[2]: [curl] Error 1 make[1]: [all-recursive] Error 1 make: *** [all-recursive] Error 1
I know it is a bit misleading but in your snip above, the failure was on the "arm64" build, the x86_64 build log shows a successful build and even the binary test is successful. The error details would be in /tmp/curl-7.74.0-arm64.log
not in the x86_64 one. That make Error indicates it is unable to build for the ARM processor (Apple Silicon M1).
You could edit the curl/libcurl-build.sh
script and look for this line and add a command below it to display the arm64 logs right after the build to help troubleshoot further:
buildMac "arm64"
# add the following line
cat /tmp/curl-7.74.0-arm64.log
Technically the build script should trap the error and exit immediately but it seems like it is continuing to the next phase which could also be deleting the log files before you have a chance to review them.
When I built this script on mac Big Sur I got following error: