to be auto-detectable from just the current toolchain being used.
So you are saying to configure a build environment for, say, x86-64-v3 you would configure gcc with --with-arch64=x86-64-v3 and then dpkg-architecture would parse the output of gcc -Q --help=target to set DEB_HOST_ARCH_VARIANT appropriately? (modulo mistakes in details) Or do you mean something else entirely?
Some of the above problems could perhaps be avoided if we introduced
a concept of architecture aliases/ISAs (similar to what rpm has), which would side-step the pool sharing issue, the binary package renaming,
etc. One big issue with this is that it requires for dpkg to have an exhaustive table of all such aliases, and if there's ever a new alias added, old dpkg versions need to be updated or they will not understand what they match with. So this does not seem ideal either. So I guess this is a variation over your proposal, but perhaps this could still be used
in specific contexts, say only at build-time (but not for dependency relationships), for repo management (say binary-arm64v9/Packages.xz),
or binary package names where the field would specify the actual name
for the filename, say:
Architecture: arm64
ArchitectureIsa: arm64v9
or maybe better:
Architecture: arm64
ArchitectureIsa: v9
resulting in dpkg-deb generating:
binpkg_1.0-1_arm64v9.deb
but targeting arm64.
I'm not sure but I think you have talked yourself into suggesting something very similar to my proposal here?
On Fri, 2023-09-01 at 08:43:55 +1200, Michael Hudson-Doyle wrote:
Is there a better way of doing this?
I think starting from 5, the rest are probably just details to hammer
out, but not insurmountable things.
Great. The things I see as a bit vague at a base level currently are:
* Should the ISA influence the toolchain via toolchain defaults or dpkg-buildflags?
* How is the default ISA for a buildd chroot selected?
There is also the question of whether partial coverage of an ISA is handled by the package publisher or client side in apt but that's at least one
level higher.
which dpkg-buildpackage could also setup internally via a new option,
say --arch-isa=amd64v3 or similar
--host-arch-isa would be more coherent I think.
I guess one could add support for --target-host-arch-isa to build a
toolchain that defaults to a particular ISA. But well.
So to summarise, here are the generic changes that I think need to be made
to src:dpkg to support variant ISAs as a thing:
* add get_host_arch_isa() to Dpkg::Arch
* dpkg-gencontrol records DEB_HOST_ARCH_ISA into DEBIAN/control as ArchitectureIsa
* dpkg-architecture emits DEB_HOST_ARCH_ISA and grows --host-arch-isa flag
* dpkg-buildpackage passes --host-arch-isa to dpkg-architecture
* dpkg-genchanges should record the ISA in the changes file somehow I
guess?
* dpkg-deb records the ISA in the file name
Have I missed anything?
(Hmm does anything need to reject unknown values
found in DEB_HOST_ARCH_ISA / --host-arch-isa? Probably...)
Conceptually slightly separately, it might make sense to add a build "feature" to Dpkg::Vendor::Debian to allow setting -march (and -mtune?)
Then when we want to add support to an ISA, we add a little thing to set_build_features (in either Vendor::Debian or Vendor::Ubuntu or wherever) that maps get_host_arch_isa() to values for the march-influencing feature.
one the next time we want to build a special variant of an architecture
with special optimizations for a special customer or whatnot.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 169:30:49 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,552 |