Skip to content

Conversation

@cheister
Copy link
Contributor

When running make binary -j8 on an Apple Silicon M1 it looks like the DESTCPU is not set correctly in the Makefile so you get the following error when building openssl

> make binary -j8 ... /opt/homebrew/opt/[email protected]/bin/python3.9 ./configure \ --prefix=/ \ --dest-cpu=arm \ --tag= \ --release-urlbase= \ --download=all --with-intl=full-icu ... cc -o /Users/cheister/Development/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/bn/bn_add.o ../deps/openssl/openssl/crypto/bn/bn_add.c '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_HW' '-DNDEBUG' '-DOPENSSL_USE_NODELETE' '-DL_ENDIAN' '-DOPENSSL_PIC' '-DOPENSSL_CPUID_OBJ' '-DOPENSSL_IA32_SSE2' '-DOPENSSL_BN_ASM_MONT' '-DOPENSSL_BN_ASM_MONT5' '-DOPENSSL_BN_ASM_GF2m' '-DSHA1_ASM' '-DSHA256_ASM' '-DSHA512_ASM' '-DKECCAK1600_ASM' '-DRC4_ASM' '-DMD5_ASM' '-DAESNI_ASM' '-DVPAES_ASM' '-DGHASH_ASM' '-DECP_NISTZ256_ASM' '-DX25519_ASM' '-DPOLY1305_ASM' '-DOPENSSLDIR="/System/Library/OpenSSL/"' '-DENGINESDIR="/dev/null"' -I../deps/openssl/openssl -I../deps/openssl/openssl/include -I../deps/openssl/openssl/crypto -I../deps/openssl/openssl/crypto/include -I../deps/openssl/openssl/crypto/modes -I../deps/openssl/openssl/crypto/ec/curve448 -I../deps/openssl/openssl/crypto/ec/curve448/arch_32 -I../deps/openssl/config -I../deps/openssl/config/archs/linux-x86_64/asm_avx2 -I../deps/openssl/config/archs/linux-x86_64/asm_avx2/include -I../deps/openssl/config/archs/linux-x86_64/asm_avx2/crypto -I../deps/openssl/config/archs/linux-x86_64/asm_avx2/crypto/include/internal -O3 -gdwarf-2 -mmacosx-version-min=10.13 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-missing-field-initializers -fno-strict-aliasing -MMD -MF /Users/cheister/Development/node/out/Release/.deps//Users/cheister/Development/node/out/Release/obj.target/openssl/deps/openssl/openssl/crypto/bn/bn_add.o.d.raw -c ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:120:9: error: invalid output constraint '=a' in asm mul_add(rp[0], ap[0], w, c1); ^ ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:78:19: note: expanded from macro 'mul_add' : "=a"(low),"=d"(high) \ ^ ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:120:9: error: invalid output constraint '+d' in asm ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:82:31: note: expanded from macro 'mul_add' : "+r"(carry),"+d"(high)\ ^ ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:120:9: error: invalid output constraint '+d' in asm ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:86:27: note: expanded from macro 'mul_add' : "+m"(r),"+d"(high) \ ^ ../deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c:121:9: error: invalid output constraint '=a' in asm mul_add(rp[1], ap[1], w, c1); 

On the M1 I get arm64 for uname -m . This PR sets the DESTCPU to arm64 and everything builds fine after that.

@nodejs-github-botnodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. labels Sep 18, 2021
@cheistercheisterforce-pushed the apple-silicon-build-binary branch from 8dd0e91 to 03306d9CompareSeptember 18, 2021 23:49
@cheistercheister changed the title Set DESTCPU correctly on Apple Silicon so 'make binary' buildsbuild: set DESTCPU correctly for 'make binary' on Apple SiliconSep 18, 2021
Copy link
Member

@mhdawsonmhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@targostargos added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Sep 26, 2021
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 26, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlaurichardlau added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 29, 2021
@github-actionsgithub-actionsbot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 29, 2021
@github-actions
Copy link
Contributor

Landed in 88b497a...5607de8

nodejs-github-bot pushed a commit that referenced this pull request Sep 29, 2021
PR-URL: #40147 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]>
targos pushed a commit that referenced this pull request Oct 4, 2021
PR-URL: #40147 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]>
evanlucas pushed a commit to evanlucas/node that referenced this pull request Feb 5, 2022
PR-URL: nodejs#40147 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]>
evanlucas pushed a commit to evanlucas/node that referenced this pull request Feb 5, 2022
PR-URL: nodejs#40147 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]> Backport-PR-URL: nodejs#41855
evanlucas pushed a commit to evanlucas/node that referenced this pull request Apr 15, 2022
PR-URL: nodejs#40147 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]> Backport-PR-URL: nodejs#41855
juanarbol pushed a commit that referenced this pull request May 1, 2022
PR-URL: #40147 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]> Backport-PR-URL: #41855
@juanarboljuanarbol mentioned this pull request May 1, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.buildIssues and PRs related to build files or the CI.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@cheister@nodejs-github-bot@jasnell@lpinca@targos@richardlau@mhdawson@evanlucas