I'm trying to build a debian package for an ARM64 platform on my AMD64 Ubuntu OS. I execute the command
debuild -us -uc --host-arch arm64
but get the warning
dpkg-architecture: warning: specified GNU system type aarch64-linux-gnu does not match CC system type x86_64-linux-gnu, try setting a correct CC environment variable
and so would like to know how to set the CC environment variable, as the warning advises. For my target OS I would typically use
/opt/l4t-gcc-toolchain-64-bit-32.1/install/bin/aarch64-linux-gnu-gcc
Thanks.
I'm not sure about what is missing on the long run, as OP didn't mention any info about it target package and anyway to check solution my side. Happy to hear your feedback about similar case.
The message is about C Compiler (CC) environment variable is not convenient for the requested target architecture. Try
dpkg-cross
which may help you set all ENV variables for you.debuild
is a helper that usesdpkg-buildpackage
Install
dpkg-cross
packageSet the cross-compile config variables and helping flags before building
Try build it again
If it doesn't work, try passing through
debuild
the cross-compile options ofdpkg-buildpackage
. All steps documented in Debian Wiki: Building with dpkg-buildpackage.Note:
If you are build you own package, good to read how to make your package Debian cross-compile friendly: Guidelines for cross-build friendly packages