This is what worked for me, to build x86_32, x86_64, ARM and ARM64 UEFI drivers from a single Ubuntu 20.04 platform (which is actually an AppVeyor build environment):
Note that this is a real-life scenario, where some developers actually need to produce UEFI executables, for all supported UEFI archs, in one go. As such, it would really be a lot nicer if a 'gcc-multilib gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi' configuration was supported without having to resort to applying workarounds.
This is what worked for me, to build x86_32, x86_64, ARM and ARM64 UEFI drivers from a single Ubuntu 20.04 platform (which is actually an AppVeyor build environment):
sudo update-alternatives --remove-all gcc linux-gnu gcc-9-arm- linux-gnueabi x86_64- linux-gnu/ asm/ /usr/local/ include/ asm aarch64- linux-gnu- gcc-9 /usr/bin/ aarch64- linux-gnu- gcc aarch64- linux-gnu- gcc-ar- 9 /usr/bin/ aarch64- linux-gnu- gcc-ar arm-linux- gnueabi- gcc-9 /usr/bin/ arm-linux- gnueabi- gcc arm-linux- gnueabi- gcc-ar- 9 /usr/bin/ arm-linux- gnueabi- gcc-ar
sudo update-alternatives --remove-all g++
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo -E apt-get install -y gcc-9-multilib gcc-9-aarch64-
sudo ln -s /usr/include/
sudo ln -s /usr/bin/
sudo ln -s /usr/bin/
sudo ln -s /usr/bin/
sudo ln -s /usr/bin/
If you are interested, you can find the AppVeyor build log, that demonstrates how all 4 versions of gcc were properly invoked, at https:/ /ci.appveyor. com/project/ pbatard/ ntfs-3g/ builds/ 38316398? fullLog= true
Note that this is a real-life scenario, where some developers actually need to produce UEFI executables, for all supported UEFI archs, in one go. As such, it would really be a lot nicer if a 'gcc-multilib gcc-aarch64- linux-gnu gcc-arm- linux-gnueabi' configuration was supported without having to resort to applying workarounds.