[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Deb
From: |
Ard Biesheuvel |
Subject: |
Re: [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian |
Date: |
Thu, 5 Dec 2019 18:17:28 +0000 |
On Thu, 5 Dec 2019 at 18:09, Philippe Mathieu-Daudé <address@hidden> wrote:
>
> The Debian (based) distributions historically provides 2 ARM
> toolchains, documented as [1]:
>
> * The ARM EABI (armel) port targets a range of older 32-bit ARM
> devices, particularly those used in NAS hardware and a variety
> of *plug computers.
> * The newer ARM hard-float (armhf) port supports newer, more
> powerful 32-bit devices using version 7 of the ARM architecture
> specification.
>
> The EDK2 documentation suggests to use the hard-float toolchain.
>
We should probably fix that. tools_def.template mentions
arm-linux-gnueabi, and while it does not really matter in most cases,
if you are using Clang, you actually need the armel binutils (see
41203b9ab5d48e029f24e17e9a865e54b7e1643d for details)
> Force the armhf cross toolchain prefix on Debian distributions.
>
> [1] https://www.debian.org/ports/arm/#status
> [2]
> https://github.com/tianocore/edk2-platforms/blob/master/Readme.md#if-cross-compiling
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> roms/edk2-funcs.sh | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/roms/edk2-funcs.sh b/roms/edk2-funcs.sh
> index 3f4485b201..a546aa1d11 100644
> --- a/roms/edk2-funcs.sh
> +++ b/roms/edk2-funcs.sh
> @@ -112,6 +112,9 @@ qemu_edk2_get_cross_prefix()
> ( [ "$gcc_arch" == i686 ] && [ "$host_arch" == x86_64 ] ); then
> # no cross-compiler needed
> :
> + elif ( [ -e /etc/debian_version ] && [ "$gcc_arch" == arm ] ); then
> + # force hard-float cross-compiler on Debian
> + printf 'arm-linux-gnueabihf-'
> else
> printf '%s-linux-gnu-\n' "$gcc_arch"
> fi
> --
> 2.21.0
>