Skip to content

Conversation

@omus
Copy link
Member

@omus omus commented Feb 18, 2021

This PR fixes these two problem when building GMP from source on Apple silicon:

checking build system type... Invalid configuration `arm64-apple-darwin20.2.0': machine `arm64-apple' not recognized
configure: error: /bin/sh /Users/omus/Development/Julia/arm64/latest-src/deps/srccache/gmp-6.2.0/config.sub arm64-apple-darwin20.2.0 failed
 clang -mmacosx-version-min=10.9 -mcpu=apple-a12 -integrated-as -c -DHAVE_CONFIG_H -I. -I/Users/omus/Development/Julia/arm64/latest-src/deps/srccache/gmp-6.2.0/mpn -I.. -D__GMP_WITHIN_GMP -I/Users/omus/Development/Julia/arm64/latest-src/deps/srccache/gmp-6.2.0 -DOPERATION_bdiv_q_1 -O2 -pedantic -march=armv8-a tmp-bdiv_q_1.s -fno-common -DPIC -o .libs/bdiv_q_1.o
tmp-bdiv_q_1.s:75:2: error: ADR/ADRP relocations must be GOT relative
 adrp x7, :got:__gmp_binvert_limb_table
 ^
tmp-bdiv_q_1.s:75:2: error: unknown AArch64 fixup kind!
 adrp x7, :got:__gmp_binvert_limb_table
 ^
tmp-bdiv_q_1.s:77:2: error: unknown AArch64 fixup kind!
 ldr x7, [x7, #:got_lo12:__gmp_binvert_limb_table]
 ^
make[3]: *** [Makefile:768: bdiv_q_1.lo] Error 1

Unfortunately, there yet another problem:

tmp-bdiv_q_1.s:74:12: error: expected ')' in parentheses expression
 LEA_HI( x7, ___gmp_binvert_limb_table)
           ^
tmp-bdiv_q_1.s:74:8: error: invalid operand
 LEA_HI( x7, ___gmp_binvert_limb_table)
       ^
tmp-bdiv_q_1.s:76:12: error: expected ')' in parentheses expression
 LEA_LO( x7, ___gmp_binvert_limb_table)
           ^
tmp-bdiv_q_1.s:76:8: error: invalid operand
 LEA_LO( x7, ___gmp_binvert_limb_table)
       ^
make[3]: *** [Makefile:768: bdiv_q_1.lo] Error 1

My best guess is that gmp-apple-arm64.patch introduced in #36616 needs to be revised.

@omus omus added building Build system, or building Julia or its dependencies system:mac Affects only macOS system:arm ARMv7 and AArch64 labels Feb 18, 2021
@omus omus requested a review from Keno February 18, 2021 19:47
@Keno
Copy link
Member

Keno commented Feb 18, 2021

Can you try bumping GMP to 6.2.1 and removing the patch? Their release notes for 6.2.1 specifically call out Apple Silicon support.

@omus
Copy link
Member Author

omus commented Feb 19, 2021

Looks like GMP 6.2.1 is the answer. I'll close this and open a new PR

@omus omus closed this Feb 19, 2021
@omus omus deleted the cv/apple-silicon-gmp-fix branch February 19, 2021 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

building Build system, or building Julia or its dependencies system:arm ARMv7 and AArch64 system:mac Affects only macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants