-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gmp] Fix building for linux x86 #31339
Conversation
@microsoft-github-policy-service agree company="Easyflex" |
elseif(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") | ||
set(ccas "${VCPKG_DETECTED_CMAKE_C_COMPILER}") | ||
vcpkg_list(APPEND OPTIONS "ABI=32") | ||
string(APPEND asmflags " -m32") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have recently seen/used the same x86 pattern in another port but for Android.
- Do we really need
ABI=32
in addition to-m32
? - Which other x86 toolchains/triplets will understand
-m32
? - Can we get
-m32
from the cmake toolchain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ABI=32
is required, fixes:
configure: error: Oops, mp_limb_t is 32 bits, but the assembler code
in this configuration expects 64 bits.
You appear to have set $CFLAGS, perhaps you also need to tell GMP the
intended ABI, see "ABI and ISA" in the manual.
The -m32
is also necessary, without it, compile of asm fails:
tmp-add_n.s: Assembler messages:
tmp-add_n.s:202: Error: operand type mismatch for `jmp'
make[2]: *** [add_n.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
tmp-sub_n.s: Assembler messages:
tmp-sub_n.s:202: Error: operand type mismatch for `jmp'
make[2]: *** [sub_n.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you need asm flags you might want to actually request it from vcpkg_get_cmake_vars
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, vcpkg_cmake_get_vars
isn't taking parameters such as LANGUAGES
ATM. (And maybe it should be handled gracefully if ASM can't be enabled.)
./vcpkg x-add-version --all
and committing the result.