Build arm64 on macOS with Xcode 12.2#2179
Conversation
Signed-off-by: Raul Metsma <raul@metsma.ee>
|
ideally, the xcode version check should also catch all versions starting with xcode 12... Are the pure xcode projects built with arm support as well i.e. Are the cflags/ldflags propagated to the CTK module opensctoken? |
|
related to #2163 |
|
Arm64 support can used only with Xcode 12.2 and forward. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
A bit more patience, please. I forgot to trigger a newer version of XCode... |
|
Unfortunately, this didn't go through as expected. I've stumbled across three independent problems... Locally, I'm experiencing the following problem when building OpenSCToken (this directory needs to be checked out in the OpenSC directory so that it is built): Note that
diff --git a/MacOSX/build-package.in b/MacOSX/build-package.in
index bea6d0046..d5d57f207 100755
--- a/MacOSX/build-package.in
+++ b/MacOSX/build-package.in
@@ -85,7 +85,7 @@ if ! test -e ${BUILDPATH}/target/$PREFIX/lib/pkgconfig; then
--enable-static \
--enable-strict \
--disable-assert \
- --enable-sm # TODO: remove this (must be sensible default in master)
+ --enable-sm --disable-pcsc --enable-cryptotokenkit # TODO: remove this (must be sensible default in master)
# always make clean
make cleanI'm not sure how to fix this problem. In Travis CI, the build already fails when compiling OpenSSL for arm64: Last, but not least, there's a corner case when building on M1 (arm64). In this case, no fat (universal) binary is created for OpenSC. Instead, it is built twice for arm64... |
|
| Last, but not least, there's a corner case when building on M1 (arm64). In this case, no fat (universal) binary is created for OpenSC. Instead, it is built twice for arm64... can you please explain more? |
This comment has been minimized.
This comment has been minimized.
Sorry, I missed your response. Actually, I meant OpenSSL, not OpenSC. If built on M1, the first build of OpenSSL produces native libraries (arm, I assume): OpenSC/MacOSX/build-package.in Line 34 in 4de52f3 Next, the config script is fed with MACHINE=arm64, which builds arm libraries, again:OpenSC/MacOSX/build-package.in Line 40 in 4de52f3 |
Signed-off-by: Raul Metsma <raul@metsma.ee>
|
forced first build to be always x86_64 |
|
I've added some minor commits on top to build the CI binaries. Does anyone want to test? |
|
@alsoszaa @jcaminamartin, would you mind testing the new binaries on your m1 computer? |
Okay. after running through your instructions you posted here 6 days ago (minus the last part to recreate the image without arm64), I have tested with the same exact ssh keygen command that gave me the error message I posted in this thread. It works! no message about incompatible arch! If you give me a day, I can test my other requirements and get back to you on this same thread. |
|
Okay, so after testing, I am able to do all my necessary work and the PKCS11 issues I had before, don't exist anymore! Great job on getting it to work on the newer Mac M1 (ARM64 architecture). |
|
Great, thanks for your feedback! |
|
merged with 85c5610 and the CI integration on top |
Signed-off-by: Raul Metsma raul@metsma.ee
Checklist