How to build amd64v3 packages locally (e.g. in resolute container)?

Hi!

Multiple people asked in Introducing architecture variants: amd64v3 now available in Ubuntu 25.10 how to build for this new architecture variant amd64v3 (e.g. @satadru, @eriksremess) but there wasn’t a proper answer, so I decided to start now a new thread.

How does one tell dpkg-buildpackage to build a amd64v3 variant?

I have been testing in s resolute container on a amd64 host, with echo 'APT::Architecture-Variants "amd64v3";' >> /etc/apt/apt.conf.d/99enable-amd64v3 && apt update && apt upgrade -y done to ensure there are 250+ packages on the system of the amd64v3 variant, including the build toolchain:

# dpkg --status | grep-dctrl -nsPackage -FArchitecture-Variant amd64v3 | grep -P "build|dpkg"
build-essential
dpkg

When I start the build it will just build for amd64 as usual:

# dpkg-buildpackage -b
dpkg-buildpackage: info: source package usql
dpkg-buildpackage: info: source version 0.19.19-0ubuntu1
dpkg-buildpackage: info: source distribution resolute
dpkg-buildpackage: info: source changed by Otto Kekäläinen <otto@debian.org>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
...

The resulting binaries are all _amd64.deb and I don’t see any Architecture-variant: fields in the .dsc or .changes files.

I also tested passing these flags:

export DEB_CFLAGS_APPEND=-march=x86-64-v3
export DEB_CXXFLAGS_APPEND=-march=x86-64-v3

They work to the degree that the build flags do get populated with this march, but the resulting packages are all still _amd64.deb.

What is the magic piece of information I am missing?

I skimmed through the dpkg patch in Ubuntu but I don’t spot anything on how to build.

Also, once I think I have amd64v3 builds running, is there some objdump trick to see what instructions the binary has and validate that it really is built for amd64v3?

2 Likes

dpkg-buildpackage --host-arch-variant=amd64v3 works or export DEB_HOST_ARCH_VARIANT=amd64v3

Thanks! I connfirm using DEB_HOST_ARCH_VARIANT=amd64v3 works and the packages are named _amd64v3.deb and I also see -march=x86-64-v3 in the build log as compilation flag. For Go pacakges however Go continues to run with GOAMD64='v1', seems one needs to manually include export GOAMD64=v3 to have Go compiler to do v3 binaries.

I also found out that I can do this to have the setting permanent:

echo 'host-arch-variant = amd64v3' >> /etc/dpkg/buildpackage.conf