Bug#869691: gmp: please add support for arm64ilp32
Wookey
wookey at debian.org
Tue Jul 25 17:37:08 UTC 2017
Source: gmp
Version: 6.1.2+dfsg-1
Severity: wishlist
Tags: upstream patch
Attached is a patched providing very basic initial suport for
arm64ilp32, using the generic C support. To some degreee it is a
placeholder until a less hacky patch is developed, although it does
work and builds the packages.
ILP32 is a new ABI for arm64(aarch64) exactly equivalent to x32 on x86
(32-bit ints, longs and pointers in the ABI, but a 64-bit instruction set).
https://wiki.linaro.org/Platform/arm64-ilp32
The patching of configure.ac is crude and almost certainly wrong, as
I'm really not sure exacltly how it all fits together, but I hope it
makes fairly clear the sort of thing that is needed. It might actually
make sense to restructure the arm/arm64 support a little as it
currently seems to list a lot of possibilities then exclude some of
them.
aarch64 can support ILP32, and it should use the arm64 dirs, but I
couldn't get that to work. Because the ABI is 32-bit, the
epilogues/prologues of this code probably need munging to deal with
32-bit paramaters. That is a little bit beyond my area of expertise,
so I stuck with the generic code for now, especially as a compiler
person tells me it's quite likely to be faster anyway.
The triplet is aarch64-linux-gnu_ilp32 (much like x32), which should
default to that ABI (which is the active bit of code in the current
patch, and should work without the -mabi=ilp32 option - that is only
needed on a native arm64 system (aarch64-linux-gnu) aka 'LP64' ABI,
building for the non-default ILP32 ABI.
I'd be very happy to work with someone who understands the details to
make a proper non-hacky patch for this. Perhaps I should just talk to
upstream?
A dh_autoreconf is needed to get the configure.ac changes into the
configure that gets run. This gives some warnings, so some more work
there might be a good idea, although it seems to work OK. I just
realised that this patch doesn't include a build-dep for that
(dh-autoreconf). That needs fixing.
There are also a set of symbols changes for libgmp10. Most match with
the arm64 exceptions, but 3 are extra. I'm not sure if this is due to
using 'generic' rather than 'arm64' functions?
So apologies for this being a bit rough, but I thought it best to file
before I forgot what I did.
-- System Information:
Debian Release: 8.9
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.16.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmp-6.1.2-arm64ilp32-generic-fix.patch
Type: text/x-diff
Size: 10734 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-science-maintainers/attachments/20170725/fbbc5da5/attachment.patch>
More information about the debian-science-maintainers
mailing list