* [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian
@ 2019-12-05 18:09 Philippe Mathieu-Daudé
2019-12-05 18:17 ` Ard Biesheuvel
0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-05 18:09 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Laszlo Ersek, Ard Biesheuvel
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.
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é <philmd@redhat.com>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian
2019-12-05 18:09 [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian Philippe Mathieu-Daudé
@ 2019-12-05 18:17 ` Ard Biesheuvel
2019-12-05 19:56 ` Laszlo Ersek
0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2019-12-05 18:17 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: Laszlo Ersek, QEMU Developers
On Thu, 5 Dec 2019 at 18:09, Philippe Mathieu-Daudé <philmd@redhat.com> 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é <philmd@redhat.com>
> ---
> 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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian
2019-12-05 18:17 ` Ard Biesheuvel
@ 2019-12-05 19:56 ` Laszlo Ersek
2019-12-06 5:10 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 4+ messages in thread
From: Laszlo Ersek @ 2019-12-05 19:56 UTC (permalink / raw)
To: Ard Biesheuvel, Philippe Mathieu-Daudé; +Cc: QEMU Developers
On 12/05/19 19:17, Ard Biesheuvel wrote:
> On Thu, 5 Dec 2019 at 18:09, Philippe Mathieu-Daudé <philmd@redhat.com> 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.
OK, I'm confused. What case are we talking about?
(1) Without this patch, "roms/edk2-funcs.sh" fails to select *any* cross
compiler on Debian, and the build just croaks.
--> insist on armhf in this script?
--> insist on armel in this script?
--> pick whichever is available, because either works?
(2) Without this patch, "roms/edk2-funcs.sh" selects the "armel" flavor,
and it fails to build edk2.
--> insist on armhf in this script?
(3) Without this patch, "roms/edk2-funcs.sh" selects the "armel" flavor,
and it builds edk2 just fine -- but that's not the flavor that the edk2
documentation suggests.
--> drop this patch, and fix the edk2 docs?
Thanks,
Laszlo
> 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é <philmd@redhat.com>
>> ---
>> 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
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian
2019-12-05 19:56 ` Laszlo Ersek
@ 2019-12-06 5:10 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-12-06 5:10 UTC (permalink / raw)
To: Laszlo Ersek, Ard Biesheuvel
Cc: Debian QEMU Team, Serge Hallyn, Dann Frazier, QEMU Developers,
Steve Langasek
On 12/5/19 8:56 PM, Laszlo Ersek wrote:
> On 12/05/19 19:17, Ard Biesheuvel wrote:
>> On Thu, 5 Dec 2019 at 18:09, Philippe Mathieu-Daudé <philmd@redhat.com> 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.
>
> OK, I'm confused. What case are we talking about?
You answered to your questions after reviewing my v2 (see
https://lists.gnu.org/archive/html/qemu-devel/2019-12/msg01118.html),
still I'll reply inline for other reviewers.
> (1) Without this patch, "roms/edk2-funcs.sh" fails to select *any* cross
> compiler on Debian, and the build just croaks.
This is the correct description.
>
> --> insist on armhf in this script?
This is what the EDK2 doc suggests in [2], but Ard says Clang default to
armel, so we should use the GCC armel version.
> --> insist on armel in this script?
Yes, this is v2 approach:
https://lists.gnu.org/archive/html/qemu-devel/2019-12/msg01088.html
> --> pick whichever is available, because either works?
I thought about it, because Debian edk2 is packaged with
gcc-arm-linux-gnueabihf so this is convenient to install all the
prerequisites with 'apt build-dep edk2'. See:
https://salsa.debian.org/qemu-team/edk2/blob/debian/debian/control#L9
>
> (2) Without this patch, "roms/edk2-funcs.sh" selects the "armel" flavor,
> and it fails to build edk2.
>
> --> insist on armhf in this script?
>
> (3) Without this patch, "roms/edk2-funcs.sh" selects the "armel" flavor,
> and it builds edk2 just fine -- but that's not the flavor that the edk2
> documentation suggests.
>
> --> drop this patch, and fix the edk2 docs?
Regardless 1/2/3 we should fix the edk2 doc :)
>
> Thanks,
> Laszlo
>
>> 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é <philmd@redhat.com>
>>> ---
>>> 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
>>>
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-12-06 5:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 18:09 [PATCH-for-5.0] roms/edk2-funcs: Force armhf toolchain prefix on Debian Philippe Mathieu-Daudé
2019-12-05 18:17 ` Ard Biesheuvel
2019-12-05 19:56 ` Laszlo Ersek
2019-12-06 5:10 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).