diff mbox series

[1/1] toolchain: update AArch32/AArch64 toolchain to 8-2-2019.01

Message ID 20190128140206.25948-1-joakim.bech@linaro.org
State Changes Requested
Headers show
Series [1/1] toolchain: update AArch32/AArch64 toolchain to 8-2-2019.01 | expand

Commit Message

Joakim Bech Jan. 28, 2019, 2:02 p.m. UTC
Tested with OP-TEE [1] using GCC 8.2 2019.01 for both AArch32 (QEMU
Armv7-A, gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf [2]) and with
AArch64 (QEMU Armv8-A, gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu [2])
which has gotten TUI mode re-enabled [3].

[1] https://github.com/OP-TEE
[2] https://developer.arm.com/open-source/gnu-toolchain/gnu-a/downloads
[3] https://bugs.linaro.org/show_bug.cgi?id=4130

Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
---
Re-sending the patch, since I wasn't subscribing to the Buildroot
mailinglist.

 package/linux-headers/Config.in.host                         | 4 ++++
 toolchain/Config.in                                          | 5 +++++
 .../toolchain-external-arm-aarch64/Config.in                 | 4 ++--
 .../toolchain-external/toolchain-external-arm-arm/Config.in  | 4 ++--
 .../toolchain-external-custom/Config.in.options              | 4 ++++
 5 files changed, 17 insertions(+), 4 deletions(-)

Comments

Thomas Petazzoni Jan. 28, 2019, 2:08 p.m. UTC | #1
Hello Joakim,

Thanks for your contribution!

On Mon, 28 Jan 2019 15:02:06 +0100
Joakim Bech <joakim.bech@linaro.org> wrote:

>  package/linux-headers/Config.in.host                         | 4 ++++
>  toolchain/Config.in                                          | 5 +++++

Introducing support for 5.0 kernel headers should be part of a separate
patch.

>  .../toolchain-external-arm-aarch64/Config.in                 | 4 ++--
>  .../toolchain-external/toolchain-external-arm-arm/Config.in  | 4 ++--
>  .../toolchain-external-custom/Config.in.options              | 4 ++++
>  5 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/package/linux-headers/Config.in.host b/package/linux-headers/Config.in.host
> index a6055e75b9..fd0cef8b21 100644
> --- a/package/linux-headers/Config.in.host
> +++ b/package/linux-headers/Config.in.host
> @@ -51,6 +51,10 @@ config BR2_KERNEL_HEADERS_4_20
>  	bool "Linux 4.20.x kernel headers"
>  	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
>  
> +config BR2_KERNEL_HEADERS_5_00

Use BR2_KERNEL_HEADERS_5_0 instead.

> +	bool "Linux 5.00.x kernel headers"
> +	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
> +
>  config BR2_KERNEL_HEADERS_VERSION
>  	bool "Manually specified Linux version"
>  	help
> diff --git a/toolchain/Config.in b/toolchain/Config.in
> index baf192c936..fd197f2407 100644
> --- a/toolchain/Config.in
> +++ b/toolchain/Config.in
> @@ -374,10 +374,15 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
>  	bool
>  	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
>  
> +config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
> +	bool
> +	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
> +
>  # This order guarantees that the highest version is set, as kconfig
>  # stops affecting a value on the first matching default.
>  config BR2_TOOLCHAIN_HEADERS_AT_LEAST
>  	string
> +	default "5.00" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
>  	default "4.20" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
>  	default "4.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
>  	default "4.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18

> diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
> index fbb5e025e8..279cb88f31 100644
> --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
> +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
> @@ -1,5 +1,5 @@
>  config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64
> -	bool "Arm AArch64 2018.11"
> +	bool "Arm AArch64 2019.01"

I don't see how this can be sufficient to update the toolchain version.
Surely the .mk and .hash files need to be changed as well.

Thanks,

Thomas
Joakim Bech Jan. 28, 2019, 2:35 p.m. UTC | #2
Hi Thomas,

On Mon, Jan 28, 2019 at 03:08:34PM +0100, Thomas Petazzoni wrote:
> Hello Joakim,
> 
> Thanks for your contribution!
> 
Thanks! This is my first time ever sending a patch to Buildroot and
admittedly I'm not very well versed with all details in Buildroot, so
pardon my ignorance here and I appreciate the guidance I get.

> On Mon, 28 Jan 2019 15:02:06 +0100
> Joakim Bech <joakim.bech@linaro.org> wrote:
> 
> >  package/linux-headers/Config.in.host                         | 4 ++++
> >  toolchain/Config.in                                          | 5 +++++
> 
> Introducing support for 5.0 kernel headers should be part of a separate
> patch.
> 
> >  .../toolchain-external-arm-aarch64/Config.in                 | 4 ++--
> >  .../toolchain-external/toolchain-external-arm-arm/Config.in  | 4 ++--
> >  .../toolchain-external-custom/Config.in.options              | 4 ++++
> >  5 files changed, 17 insertions(+), 4 deletions(-)
> > 
> > diff --git a/package/linux-headers/Config.in.host b/package/linux-headers/Config.in.host
> > index a6055e75b9..fd0cef8b21 100644
> > --- a/package/linux-headers/Config.in.host
> > +++ b/package/linux-headers/Config.in.host
> > @@ -51,6 +51,10 @@ config BR2_KERNEL_HEADERS_4_20
> >  	bool "Linux 4.20.x kernel headers"
> >  	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
> >  
> > +config BR2_KERNEL_HEADERS_5_00
> 
> Use BR2_KERNEL_HEADERS_5_0 instead.
> 
> > +	bool "Linux 5.00.x kernel headers"
> > +	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
> > +
> >  config BR2_KERNEL_HEADERS_VERSION
> >  	bool "Manually specified Linux version"
> >  	help
> > diff --git a/toolchain/Config.in b/toolchain/Config.in
> > index baf192c936..fd197f2407 100644
> > --- a/toolchain/Config.in
> > +++ b/toolchain/Config.in
> > @@ -374,10 +374,15 @@ config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
> >  	bool
> >  	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
> >  
> > +config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
> > +	bool
> > +	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
> > +
> >  # This order guarantees that the highest version is set, as kconfig
> >  # stops affecting a value on the first matching default.
> >  config BR2_TOOLCHAIN_HEADERS_AT_LEAST
> >  	string
> > +	default "5.00" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
> >  	default "4.20" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
> >  	default "4.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
> >  	default "4.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
> 
> > diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
> > index fbb5e025e8..279cb88f31 100644
> > --- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
> > +++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
> > @@ -1,5 +1,5 @@
> >  config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64
> > -	bool "Arm AArch64 2018.11"
> > +	bool "Arm AArch64 2019.01"
> 
> I don't see how this can be sufficient to update the toolchain version.
> Surely the .mk and .hash files need to be changed as well.
> 
Chapter 17.3 and 17.4 is about this in the documentation, right?

For hash files, are you referring to these:

$ find -name "*.hash" | grep gcc
./package/gcc/gcc-initial/gcc-initial.hash
./package/gcc/gcc.hash
./package/gcc/gcc-final/gcc-final.hash

I.e. add a line to each of them stating the source and the hash of the
tarball itself? Only use SHA-512 I suppose? The documentation lists both
SHA1 and SHA-256.

Btw, what is the difference between the three (initial, ..., final)?


Regarding the makefiles, same there?

$ find -name "*.mk" | grep gcc
./package/gcc/gcc.mk
./package/gcc/gcc-initial/gcc-initial.mk
./package/gcc/gcc-final/gcc-final.mk

After looking at those it's not directly clear what I'm supposed to
update there.
Thomas Petazzoni Jan. 28, 2019, 2:59 p.m. UTC | #3
Hello,

On Mon, 28 Jan 2019 15:35:07 +0100
Joakim Bech <joakim.bech@linaro.org> wrote:

> > I don't see how this can be sufficient to update the toolchain version.
> > Surely the .mk and .hash files need to be changed as well.
> >   
> Chapter 17.3 and 17.4 is about this in the documentation, right?
> 
> For hash files, are you referring to these:
> 
> $ find -name "*.hash" | grep gcc
> ./package/gcc/gcc-initial/gcc-initial.hash
> ./package/gcc/gcc.hash
> ./package/gcc/gcc-final/gcc-final.hash

These are all the same files, thanks to symlinks. But anyway, these
files are not relevant, since they are for the "internal toolchain"
backend (i.e when Buildroot builds a toolchain) and not the external
toolchain backend.

In your case, I don't see how the version bump can work if you don't
change:

  toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk
  toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash
  toolchain/toolchain-external/toolchain-external-arm-arm/toolchain-external-arm-arm.mk
  toolchain/toolchain-external/toolchain-external-arm-arm/toolchain-external-arm-arm.hash

Best regards,

Thomas
Joakim Bech Jan. 28, 2019, 4:41 p.m. UTC | #4
Hi,

On Mon, Jan 28, 2019 at 03:59:51PM +0100, Thomas Petazzoni wrote:
> In your case, I don't see how the version bump can work if you don't
> change:
> 
When I'm building for OP-TEE we are pre-downloading the toolchain from the
OP-TEE makefiles and refer to that when configuring Buildroot, which explains
why this was working on my side even before making the changes you're asking
for.

>   toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.mk
>   toolchain/toolchain-external/toolchain-external-arm-aarch64/toolchain-external-arm-aarch64.hash
>   toolchain/toolchain-external/toolchain-external-arm-arm/toolchain-external-arm-arm.mk
>   toolchain/toolchain-external/toolchain-external-arm-arm/toolchain-external-arm-arm.hash
> 
Got it! I've made changes to those files and this time I've also tested
directly in Buildroot (without involving OP-TEE) as follows:

1) $ make qemu_aarch64_virt_defconfig
   $ make menuconfig ... select external toolchain
   $ make
   ...
   2019-01-28 17:06:00 (1.11 MB/s) - ‘/home/jbech/devel/optee_projects/qemu_v8/buildroot/output/build/.gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz.7NG7Nw/output’ saved [267998260/267998260]

    gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz: OK (md5: ed467a18abc7cf81d53c0cf6014b1867)
    gcc-arm-8.2-2019.01-x86_64-aarch64-linux-gnu.tar.xz: OK (sha256: 6683d51b0dd61a91ab1e8e478a0a8a50ccb34d5590c84aa36697e956b16f14a1) 

2) $ make qemu_arm_vexpress_defconfig
   $ make menuconfig ... select external toolchain
   $ make
   ...
   2019-01-28 17:26:29 (1.11 MB/s) - ‘/home/jbech/devel/optee_projects/qemu_v8/buildroot/output/build/.gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf.tar.xz.XkMAPN/output’ saved [252108596/252108596]                                                     
   gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf.tar.xz: OK (md5: 123887bdaa27b362f0f428dc36af5693)
   gcc-arm-8.2-2019.01-x86_64-arm-linux-gnueabihf.tar.xz: OK (sha256: 6b73016fa4773a7450bac9bd80b2ca056b5d582dd966b509a17b305fc89506a9)

Which I believe looks good and what we would expect (the builds also ended
successfully). I will send v2-patch soon, thanks for the guidance!
diff mbox series

Patch

diff --git a/package/linux-headers/Config.in.host b/package/linux-headers/Config.in.host
index a6055e75b9..fd0cef8b21 100644
--- a/package/linux-headers/Config.in.host
+++ b/package/linux-headers/Config.in.host
@@ -51,6 +51,10 @@  config BR2_KERNEL_HEADERS_4_20
 	bool "Linux 4.20.x kernel headers"
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
 
+config BR2_KERNEL_HEADERS_5_00
+	bool "Linux 5.00.x kernel headers"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
+
 config BR2_KERNEL_HEADERS_VERSION
 	bool "Manually specified Linux version"
 	help
diff --git a/toolchain/Config.in b/toolchain/Config.in
index baf192c936..fd197f2407 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -374,10 +374,15 @@  config BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
 	bool
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
 
+config BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
+	bool
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
+
 # This order guarantees that the highest version is set, as kconfig
 # stops affecting a value on the first matching default.
 config BR2_TOOLCHAIN_HEADERS_AT_LEAST
 	string
+	default "5.00" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
 	default "4.20" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
 	default "4.19" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_19
 	default "4.18" if BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_18
diff --git a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
index fbb5e025e8..279cb88f31 100644
--- a/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
+++ b/toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in
@@ -1,5 +1,5 @@ 
 config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64
-	bool "Arm AArch64 2018.11"
+	bool "Arm AArch64 2019.01"
 	depends on BR2_aarch64
 	depends on BR2_HOSTARCH = "x86_64"
 	depends on !BR2_STATIC_LIBS
@@ -7,7 +7,7 @@  config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64
 	select BR2_TOOLCHAIN_HAS_SSP
 	select BR2_INSTALL_LIBSTDCPP
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
-	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
 	select BR2_TOOLCHAIN_HAS_FORTRAN
 	help
diff --git a/toolchain/toolchain-external/toolchain-external-arm-arm/Config.in b/toolchain/toolchain-external/toolchain-external-arm-arm/Config.in
index 0449737889..69c2f7425e 100644
--- a/toolchain/toolchain-external/toolchain-external-arm-arm/Config.in
+++ b/toolchain/toolchain-external/toolchain-external-arm-arm/Config.in
@@ -4,7 +4,7 @@  comment "Arm toolchains available for Cortex-A + EABIhf"
 	depends on !BR2_STATIC_LIBS
 
 config BR2_TOOLCHAIN_EXTERNAL_ARM_ARM
-	bool "Arm ARM 2018.11"
+	bool "Arm ARM 2019.01"
 	depends on BR2_arm
 	depends on BR2_ARM_CPU_ARMV7A || BR2_ARM_CPU_ARMV8A
 	depends on BR2_HOSTARCH = "x86_64"
@@ -14,7 +14,7 @@  config BR2_TOOLCHAIN_EXTERNAL_ARM_ARM
 	select BR2_TOOLCHAIN_HAS_SSP
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
-	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_8
 	select BR2_TOOLCHAIN_HAS_FORTRAN
 	help
diff --git a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
index 08a79ee4d9..48eb1ea080 100644
--- a/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
+++ b/toolchain/toolchain-external/toolchain-external-custom/Config.in.options
@@ -123,6 +123,10 @@  choice
 	    m = ( LINUX_VERSION_CODE >> 8  ) & 0xFF
 	    p = ( LINUX_VERSION_CODE >> 0  ) & 0xFF
 
+config BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_00
+	bool "5.00.x"
+	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_00
+
 config BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_20
 	bool "4.20.x"
 	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20