[edk2-devel] [edk2-platforms][PATCH] Readme.md: Update cross compiling section

Vin Xue posted 1 patch 3 years, 9 months ago
Failed in applying to current master (apply log)
Readme.md | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
[edk2-devel] [edk2-platforms][PATCH] Readme.md: Update cross compiling section
Posted by Vin Xue 3 years, 9 months ago
1. Update invalid URL link of Linaro GCC toolchains.
2. Add build command example for cross compiling.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Vin Xue <vinxue@outlook.com>
---
 Readme.md | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Readme.md b/Readme.md
index ea9492240a..2e30f672cc 100644
--- a/Readme.md
+++ b/Readme.md
@@ -57,10 +57,13 @@ X64                 | x86_64-linux-gnu-
 

 ### GCC

 Linaro provides GCC toolchains for

-[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/)

-and [arm-linux-gnueabihf](https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/)

-compiled to run on x86_64/i686 Linux and i686 Windows. Some Linux distributions

-provide their own packaged cross-toolchains.

+[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/)

+and [arm-linux-gnueabihf](https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/)

+compiled to run on x86_64/i686 Linux and i686 Windows.

+

+Some Linux distributions provide their own packaged cross-toolchains. e.g. Install AArch64 GCC toolchain on Ubuntu (x86_64) with:

+

+`sudo apt install gcc-aarch64-linux-gnu`

 

 ### clang

 Clang does not require separate cross compilers, but it does need a

@@ -160,6 +163,9 @@ variable `{TOOL_CHAIN_TAG}_{TARGET_ARCH}_PREFIX` - in the case above,
 **GCC5_AARCH64_PREFIX**.

 

 So, referring to the cross compiler toolchain table above, we should prepend the `build` command line with `GCC5_AARCH64_PREFIX=aarch64-linux-gnu-`.

+```

+$ GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -n $NUM_CPUS -a AARCH64 -t GCC5 -p Platform/ARM/JunoPkg/ArmJuno.dsc

+```

 

 ## Using uefi-tools helper scripts

 uefi-tools is a completely unofficial set of helper-scripts developed by Linaro.

-- 
2.27.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62597): https://edk2.groups.io/g/devel/message/62597
Mute This Topic: https://groups.io/mt/75516874/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms][PATCH] Readme.md: Update cross compiling section
Posted by Leif Lindholm 3 years, 9 months ago
On Wed, Jul 15, 2020 at 14:05:03 +0800, Vin Xue wrote:
> 1. Update invalid URL link of Linaro GCC toolchains.
> 2. Add build command example for cross compiling.
> 
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Vin Xue <vinxue@outlook.com>
> ---
>  Readme.md | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/Readme.md b/Readme.md
> index ea9492240a..2e30f672cc 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -57,10 +57,13 @@ X64                 | x86_64-linux-gnu-
>  
>  ### GCC
>  Linaro provides GCC toolchains for
> -[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/)
> -and [arm-linux-gnueabihf](https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/)
> -compiled to run on x86_64/i686 Linux and i686 Windows. Some Linux distributions
> -provide their own packaged cross-toolchains.
> +[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/)
> +and [arm-linux-gnueabihf](https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/)
> +compiled to run on x86_64/i686 Linux and i686 Windows.

Yes, we should update the information about the Windows toolchains.
But gcc 7 is ancient. If we go to
https://releases.linaro.org/components/toolchain/binaries/, we see
they have added a gcc-8 "directory". I say "directory" with quotes
because clicking on that redirects you to
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads
This is the location we should now be pointing to - and these
toolchains are now gcc 9.2.

> +
> +Some Linux distributions provide their own packaged cross-toolchains. e.g. Install AArch64 GCC toolchain on Ubuntu (x86_64) with:
> +
> +`sudo apt install gcc-aarch64-linux-gnu`

We can't maintain a list of every possible package name with every
possible package install command (apt, yum, dnf, pacman, ?) for every
distribution (debian, ubuntu, redhat, fedora, centos, suse, arch,
gentoo, ?) out there. We'll also be adding RISC-V support in the near
future.

The abovementioned arm.com link includes prebuilt compilers for
Windows-x86_64, Linux-x86_64, and Linux-AArch64 (for AArch32).
Anyone unable to figure out how to find and install packages provided
with their distro can always grab a toolchain from that download page.

>  
>  ### clang
>  Clang does not require separate cross compilers, but it does need a
> @@ -160,6 +163,9 @@ variable `{TOOL_CHAIN_TAG}_{TARGET_ARCH}_PREFIX` - in the case above,
>  **GCC5_AARCH64_PREFIX**.
>  
>  So, referring to the cross compiler toolchain table above, we should prepend the `build` command line with `GCC5_AARCH64_PREFIX=aarch64-linux-gnu-`.
> +```
> +$ GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -n $NUM_CPUS -a AARCH64 -t GCC5 -p Platform/ARM/JunoPkg/ArmJuno.dsc
> +```

How to build a platform is already described in the section
immediately preceding this one. This paragraph tells you how to inform
the build system to apply a prefix for the compiler if cross compiling.

Seprate note (to self, really): we don't need the -n thing anymore,
the 'build' command has been updated to figure this out for itself.

/
    Leif

>  
>  ## Using uefi-tools helper scripts
>  uefi-tools is a completely unofficial set of helper-scripts developed by Linaro.
> -- 
> 2.27.0.windows.1
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62598): https://edk2.groups.io/g/devel/message/62598
Mute This Topic: https://groups.io/mt/75516874/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms][PATCH] Readme.md: Update cross compiling section
Posted by Vin Xue 3 years, 9 months ago
Hi Lindholm,

Thanks for your comments.
Usually, I am working on Windows PC for BIOS development.
Today I tried to build edk2-platform AAarch64 code, and found it's not
easy to follow readme document. So, I submitted the patch.

Please drop the patch if there is a better update in the near future.

________________________________
From: Leif Lindholm <leif@nuviainc.com>
Sent: Wednesday, July 15, 2020 5:26 PM
To: Vin Xue <vinxue@outlook.com>
Cc: devel@edk2.groups.io <devel@edk2.groups.io>; Michael D Kinney <michael.d.kinney@intel.com>
Subject: Re: [edk2-platforms][PATCH] Readme.md: Update cross compiling section

On Wed, Jul 15, 2020 at 14:05:03 +0800, Vin Xue wrote:
> 1. Update invalid URL link of Linaro GCC toolchains.
> 2. Add build command example for cross compiling.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Vin Xue <vinxue@outlook.com>
> ---
>  Readme.md | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/Readme.md b/Readme.md
> index ea9492240a..2e30f672cc 100644
> --- a/Readme.md
> +++ b/Readme.md
> @@ -57,10 +57,13 @@ X64                 | x86_64-linux-gnu-
>
>  ### GCC
>  Linaro provides GCC toolchains for
> -[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/)
> -and [arm-linux-gnueabihf](https://releases.linaro.org/components/toolchain/binaries/latest/arm-linux-gnueabihf/)
> -compiled to run on x86_64/i686 Linux and i686 Windows. Some Linux distributions
> -provide their own packaged cross-toolchains.
> +[aarch64-linux-gnu](https://releases.linaro.org/components/toolchain/binaries/latest-7/aarch64-linux-gnu/)
> +and [arm-linux-gnueabihf](https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/)
> +compiled to run on x86_64/i686 Linux and i686 Windows.

Yes, we should update the information about the Windows toolchains.
But gcc 7 is ancient. If we go to
https://releases.linaro.org/components/toolchain/binaries/, we see
they have added a gcc-8 "directory". I say "directory" with quotes
because clicking on that redirects you to
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads
This is the location we should now be pointing to - and these
toolchains are now gcc 9.2.

> +
> +Some Linux distributions provide their own packaged cross-toolchains. e.g. Install AArch64 GCC toolchain on Ubuntu (x86_64) with:
> +
> +`sudo apt install gcc-aarch64-linux-gnu`

We can't maintain a list of every possible package name with every
possible package install command (apt, yum, dnf, pacman, ?) for every
distribution (debian, ubuntu, redhat, fedora, centos, suse, arch,
gentoo, ?) out there. We'll also be adding RISC-V support in the near
future.

The abovementioned arm.com link includes prebuilt compilers for
Windows-x86_64, Linux-x86_64, and Linux-AArch64 (for AArch32).
Anyone unable to figure out how to find and install packages provided
with their distro can always grab a toolchain from that download page.

>
>  ### clang
>  Clang does not require separate cross compilers, but it does need a
> @@ -160,6 +163,9 @@ variable `{TOOL_CHAIN_TAG}_{TARGET_ARCH}_PREFIX` - in the case above,
>  **GCC5_AARCH64_PREFIX**.
>
>  So, referring to the cross compiler toolchain table above, we should prepend the `build` command line with `GCC5_AARCH64_PREFIX=aarch64-linux-gnu-`.
> +```
> +$ GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -n $NUM_CPUS -a AARCH64 -t GCC5 -p Platform/ARM/JunoPkg/ArmJuno.dsc
> +```

How to build a platform is already described in the section
immediately preceding this one. This paragraph tells you how to inform
the build system to apply a prefix for the compiler if cross compiling.

Seprate note (to self, really): we don't need the -n thing anymore,
the 'build' command has been updated to figure this out for itself.

/
    Leif

>
>  ## Using uefi-tools helper scripts
>  uefi-tools is a completely unofficial set of helper-scripts developed by Linaro.
> --
> 2.27.0.windows.1
>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62602): https://edk2.groups.io/g/devel/message/62602
Mute This Topic: https://groups.io/mt/75516874/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms][PATCH] Readme.md: Update cross compiling section
Posted by Leif Lindholm 3 years, 9 months ago
Hi Vin Xue,

If the documentation can be improved, it should.

I will propose an update to the cross-compilation section, thank you
for reporting that the link had stopped working.

On Wed, Jul 15, 2020 at 10:31:23 +0000, Vin Xue wrote:
> Hi Lindholm,
> 
> Thanks for your comments.
> Usually, I am working on Windows PC for BIOS development.
> Today I tried to build edk2-platform AAarch64 code, and found it's not
> easy to follow readme document. So, I submitted the patch.
> 
> Please drop the patch if there is a better update in the near future.
> 
> >  ### clang
> >  Clang does not require separate cross compilers, but it does need a
> > @@ -160,6 +163,9 @@ variable `{TOOL_CHAIN_TAG}_{TARGET_ARCH}_PREFIX` - in the case above,
> >  **GCC5_AARCH64_PREFIX**.
> >
> >  So, referring to the cross compiler toolchain table above, we should prepend the `build` command line with `GCC5_AARCH64_PREFIX=aarch64-linux-gnu-`.
> > +```
> > +$ GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -n $NUM_CPUS -a AARCH64 -t GCC5 -p Platform/ARM/JunoPkg/ArmJuno.dsc
> > +```

Actually, I misread this hunk since the context line before the
addition is too long, wrapping unfortuinately in my email client; I
read it as *replacing* the variable setting with the full usage
example. Apologies for this.
I have no objection to the addition of the full usage example. I will
drop the other bits of this patch and send out a minor set of readme
updates including the remainder of this patch.

/
    Leif

> 
> How to build a platform is already described in the section
> immediately preceding this one. This paragraph tells you how to inform
> the build system to apply a prefix for the compiler if cross compiling.
> 
> Seprate note (to self, really): we don't need the -n thing anymore,
> the 'build' command has been updated to figure this out for itself.
> 
> /
>     Leif
> 
> >
> >  ## Using uefi-tools helper scripts
> >  uefi-tools is a completely unofficial set of helper-scripts developed by Linaro.
> > --
> > 2.27.0.windows.1
> >

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#62601): https://edk2.groups.io/g/devel/message/62601
Mute This Topic: https://groups.io/mt/75516874/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-