All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE
@ 2022-10-26 18:34 Thomas Petazzoni via buildroot
  2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-26 18:34 UTC (permalink / raw)
  To: Buildroot List
  Cc: Thomas De Schampheleire, Giulio Benetti, Romain Naour,
	Yann E. MORIN, Thomas Petazzoni

In the internal toolchain backend, we have a choice..endchoice block
to allow the user to select the C library, between glibc, uClibc and
musl.

However, there are situations were no C library at all is
supported. In this case, the choice does not appear, and does not
allow to see the Config.in comments that are within the
choice..endchoice block and that may explain why no C library is
available.

For example, on RISC-V 32-bit, the only C library supported is glibc,
and the minimum kernel header version required by glibc on this
architecture is 5.4.0. In a future commit, we are going to add this
dependency on glibc (to fix build issues on configurations that have
headers < 5.4.0). But since glibc is the only supported C library on
RISC-V 32-bit, it means that the choice..endchoice for the C library
contains no entry, preventing from seeing the Config.in comment.

To address this issue, this commit adds a "dummy"
BR2_TOOLCHAIN_BUILDROOT_NONE option that shows up in the
choice..endchoice only when no C library is available. Thanks to this,
the choice..endchoice is never empty, and the Config.in comments can
be seen.

If the user keeps BR2_TOOLCHAIN_BUILDROOT_NONE selected, then the
build will anyway abort early because package/Makefile.in has a check
to verify that a C library is selected, and aborts the build if not.

Some could say that the problem should be resolved by instead
preventing the selection of headers < 5.4.0 on RISC-V 32-bit, but that
is difficult to do as the user can choose a custom header version, or
simply specific that (s)he wants to use the headers of the kernel
being built. In those situations, it's difficult to prevent selecting
headers < 5.4.0.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 toolchain/toolchain-buildroot/Config.in | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index 6d55f87435..26d731d976 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -80,6 +80,18 @@ config BR2_TOOLCHAIN_BUILDROOT_MUSL
 
 	  https://www.musl-libc.org/
 
+config BR2_TOOLCHAIN_BUILDROOT_NONE
+	bool "none"
+	depends on !BR2_PACKAGE_UCLIBC_SUPPORTS && \
+		!BR2_PACKAGE_GLIBC_SUPPORTS && \
+		!BR2_PACKAGE_MUSL_SUPPORTS
+	help
+	  This option is visible if no C library is available for the
+	  currently selected configuration. If you select this option,
+	  the build will refuse to start as Buildroot needs a C
+	  library to build a toolchain. Change your configuration
+	  settings to make sure one of the C libraries is selected.
+
 endchoice
 
 config BR2_TOOLCHAIN_BUILDROOT_LIBC
-- 
2.37.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit
  2022-10-26 18:34 [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Thomas Petazzoni via buildroot
@ 2022-10-26 18:34 ` Thomas Petazzoni via buildroot
  2022-10-26 21:03   ` Alistair Francis
                     ` (2 more replies)
  2022-10-30 11:45 ` [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Yann E. MORIN
  2022-11-13 14:17 ` Peter Korsgaard
  2 siblings, 3 replies; 7+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-10-26 18:34 UTC (permalink / raw)
  To: Buildroot List
  Cc: Thomas De Schampheleire, Giulio Benetti, Romain Naour,
	Yann E. MORIN, Thomas Petazzoni

Since glibc 2.33 (upstream commit
7a55dd3fb6d2c307a002a16776be84310b9c8989), headers >= 5.4.0 are needed
to build glibc for RISC-V 32-bit. Indeed
sysdeps/unix/sysv/linux/riscv/configure.ac contains:

if test $libc_cv_riscv_int_abi = ilp32; then
  arch_minimum_kernel=5.4.0
fi

In order to take into account this dependency, we add the appropriate
logic in package/glibc/Config.in and
toolchain/toolchain-buildroot/Config.in.

This change means that if headers < 5.4.0 are selected, then no C
library at all will be available for RISC-V 32-bit, as glibc is the
only C library supporting RISC-V 32-bit currently. However, thanks to
the recent addition of BR2_TOOLCHAIN_BUILDROOT_NONE, the
choice...endchoice for the C library selection will not be empty,
allowing the user to see the Config.in comment explaining why glibc
can't be selected.

Therefore, technically this commit does prevent from creating a
configuration with RISC-V 32-bit and headers < 5.4.0, but it will have
BR2_TOOLCHAIN_BUILDROOT_NONE=y, which is catched by
package/Makefile.in, which aborts the build early on pointing out that
the configuration is invalid.

Fixes:

  http://autobuild.buildroot.net/results/5ca49b2732f68eccb5276e7112f7f496dcc514ee/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/glibc/Config.in                 | 1 +
 toolchain/toolchain-buildroot/Config.in | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/package/glibc/Config.in b/package/glibc/Config.in
index b63f99b0b4..71c50504ac 100644
--- a/package/glibc/Config.in
+++ b/package/glibc/Config.in
@@ -34,6 +34,7 @@ config BR2_PACKAGE_GLIBC_SUPPORTS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5 || !BR2_MIPS_NAN_2008
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4 || !BR2_RISCV_32
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0 || !BR2_RISCV_64
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4 || !BR2_or1k
diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index 26d731d976..64f7892f98 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -62,6 +62,10 @@ comment "glibc on RISC-V 64-bit needs a toolchain w/ headers >= 5.0"
 	depends on BR2_RISCV_64
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
 
+comment "glibc on RISC-V 32-bit needs a toolchain w/ headers >= 5.4"
+	depends on BR2_RISCV_32
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
+
 comment "glibc on ARC needs a toolchain w/ headers >= 5.1"
 	depends on BR2_arc
 	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
-- 
2.37.3

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit
  2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
@ 2022-10-26 21:03   ` Alistair Francis
  2022-10-30 11:45   ` Yann E. MORIN
  2022-11-13 14:18   ` Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Alistair Francis @ 2022-10-26 21:03 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Yann E. MORIN, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire, Buildroot List

On Thu, Oct 27, 2022 at 4:35 AM Thomas Petazzoni via buildroot
<buildroot@buildroot.org> wrote:
>
> Since glibc 2.33 (upstream commit
> 7a55dd3fb6d2c307a002a16776be84310b9c8989), headers >= 5.4.0 are needed
> to build glibc for RISC-V 32-bit. Indeed
> sysdeps/unix/sysv/linux/riscv/configure.ac contains:
>
> if test $libc_cv_riscv_int_abi = ilp32; then
>   arch_minimum_kernel=5.4.0
> fi
>
> In order to take into account this dependency, we add the appropriate
> logic in package/glibc/Config.in and
> toolchain/toolchain-buildroot/Config.in.
>
> This change means that if headers < 5.4.0 are selected, then no C
> library at all will be available for RISC-V 32-bit, as glibc is the
> only C library supporting RISC-V 32-bit currently. However, thanks to
> the recent addition of BR2_TOOLCHAIN_BUILDROOT_NONE, the
> choice...endchoice for the C library selection will not be empty,
> allowing the user to see the Config.in comment explaining why glibc
> can't be selected.
>
> Therefore, technically this commit does prevent from creating a
> configuration with RISC-V 32-bit and headers < 5.4.0, but it will have
> BR2_TOOLCHAIN_BUILDROOT_NONE=y, which is catched by
> package/Makefile.in, which aborts the build early on pointing out that
> the configuration is invalid.
>
> Fixes:
>
>   http://autobuild.buildroot.net/results/5ca49b2732f68eccb5276e7112f7f496dcc514ee/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  package/glibc/Config.in                 | 1 +
>  toolchain/toolchain-buildroot/Config.in | 4 ++++
>  2 files changed, 5 insertions(+)
>
> diff --git a/package/glibc/Config.in b/package/glibc/Config.in
> index b63f99b0b4..71c50504ac 100644
> --- a/package/glibc/Config.in
> +++ b/package/glibc/Config.in
> @@ -34,6 +34,7 @@ config BR2_PACKAGE_GLIBC_SUPPORTS
>         depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
>         depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
>         depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5 || !BR2_MIPS_NAN_2008
> +       depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4 || !BR2_RISCV_32
>         depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0 || !BR2_RISCV_64
>         depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
>         depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4 || !BR2_or1k
> diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
> index 26d731d976..64f7892f98 100644
> --- a/toolchain/toolchain-buildroot/Config.in
> +++ b/toolchain/toolchain-buildroot/Config.in
> @@ -62,6 +62,10 @@ comment "glibc on RISC-V 64-bit needs a toolchain w/ headers >= 5.0"
>         depends on BR2_RISCV_64
>         depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
>
> +comment "glibc on RISC-V 32-bit needs a toolchain w/ headers >= 5.4"
> +       depends on BR2_RISCV_32
> +       depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
> +
>  comment "glibc on ARC needs a toolchain w/ headers >= 5.1"
>         depends on BR2_arc
>         depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
> --
> 2.37.3
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE
  2022-10-26 18:34 [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Thomas Petazzoni via buildroot
  2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
@ 2022-10-30 11:45 ` Yann E. MORIN
  2022-11-13 14:17 ` Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2022-10-30 11:45 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Giulio Benetti, Romain Naour, Thomas De Schampheleire, Buildroot List

Thomas, All,

On 2022-10-26 20:34 +0200, Thomas Petazzoni via buildroot spake thusly:
> In the internal toolchain backend, we have a choice..endchoice block
> to allow the user to select the C library, between glibc, uClibc and
> musl.
> 
> However, there are situations were no C library at all is
> supported. In this case, the choice does not appear, and does not
> allow to see the Config.in comments that are within the
> choice..endchoice block and that may explain why no C library is
> available.
> 
> For example, on RISC-V 32-bit, the only C library supported is glibc,
> and the minimum kernel header version required by glibc on this
> architecture is 5.4.0. In a future commit, we are going to add this
> dependency on glibc (to fix build issues on configurations that have
> headers < 5.4.0). But since glibc is the only supported C library on
> RISC-V 32-bit, it means that the choice..endchoice for the C library
> contains no entry, preventing from seeing the Config.in comment.
> 
> To address this issue, this commit adds a "dummy"
> BR2_TOOLCHAIN_BUILDROOT_NONE option that shows up in the
> choice..endchoice only when no C library is available. Thanks to this,
> the choice..endchoice is never empty, and the Config.in comments can
> be seen.
> 
> If the user keeps BR2_TOOLCHAIN_BUILDROOT_NONE selected, then the
> build will anyway abort early because package/Makefile.in has a check
> to verify that a C library is selected, and aborts the build if not.
> 
> Some could say that the problem should be resolved by instead
> preventing the selection of headers < 5.4.0 on RISC-V 32-bit, but that
> is difficult to do as the user can choose a custom header version, or
> simply specific that (s)he wants to use the headers of the kernel
> being built. In those situations, it's difficult to prevent selecting
> headers < 5.4.0.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

As discussed on IRC, I added an exclusiong in genrandconfig.

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  toolchain/toolchain-buildroot/Config.in | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
> index 6d55f87435..26d731d976 100644
> --- a/toolchain/toolchain-buildroot/Config.in
> +++ b/toolchain/toolchain-buildroot/Config.in
> @@ -80,6 +80,18 @@ config BR2_TOOLCHAIN_BUILDROOT_MUSL
>  
>  	  https://www.musl-libc.org/
>  
> +config BR2_TOOLCHAIN_BUILDROOT_NONE
> +	bool "none"
> +	depends on !BR2_PACKAGE_UCLIBC_SUPPORTS && \
> +		!BR2_PACKAGE_GLIBC_SUPPORTS && \
> +		!BR2_PACKAGE_MUSL_SUPPORTS
> +	help
> +	  This option is visible if no C library is available for the
> +	  currently selected configuration. If you select this option,
> +	  the build will refuse to start as Buildroot needs a C
> +	  library to build a toolchain. Change your configuration
> +	  settings to make sure one of the C libraries is selected.
> +
>  endchoice
>  
>  config BR2_TOOLCHAIN_BUILDROOT_LIBC
> -- 
> 2.37.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit
  2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
  2022-10-26 21:03   ` Alistair Francis
@ 2022-10-30 11:45   ` Yann E. MORIN
  2022-11-13 14:18   ` Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Yann E. MORIN @ 2022-10-30 11:45 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Giulio Benetti, Romain Naour, Thomas De Schampheleire, Buildroot List

Thomas, All,

On 2022-10-26 20:34 +0200, Thomas Petazzoni via buildroot spake thusly:
> Since glibc 2.33 (upstream commit
> 7a55dd3fb6d2c307a002a16776be84310b9c8989), headers >= 5.4.0 are needed
> to build glibc for RISC-V 32-bit. Indeed
> sysdeps/unix/sysv/linux/riscv/configure.ac contains:
> 
> if test $libc_cv_riscv_int_abi = ilp32; then
>   arch_minimum_kernel=5.4.0
> fi
> 
> In order to take into account this dependency, we add the appropriate
> logic in package/glibc/Config.in and
> toolchain/toolchain-buildroot/Config.in.
> 
> This change means that if headers < 5.4.0 are selected, then no C
> library at all will be available for RISC-V 32-bit, as glibc is the
> only C library supporting RISC-V 32-bit currently. However, thanks to
> the recent addition of BR2_TOOLCHAIN_BUILDROOT_NONE, the
> choice...endchoice for the C library selection will not be empty,
> allowing the user to see the Config.in comment explaining why glibc
> can't be selected.
> 
> Therefore, technically this commit does prevent from creating a
> configuration with RISC-V 32-bit and headers < 5.4.0, but it will have
> BR2_TOOLCHAIN_BUILDROOT_NONE=y, which is catched by
> package/Makefile.in, which aborts the build early on pointing out that
> the configuration is invalid.
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/5ca49b2732f68eccb5276e7112f7f496dcc514ee/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/glibc/Config.in                 | 1 +
>  toolchain/toolchain-buildroot/Config.in | 4 ++++
>  2 files changed, 5 insertions(+)
> 
> diff --git a/package/glibc/Config.in b/package/glibc/Config.in
> index b63f99b0b4..71c50504ac 100644
> --- a/package/glibc/Config.in
> +++ b/package/glibc/Config.in
> @@ -34,6 +34,7 @@ config BR2_PACKAGE_GLIBC_SUPPORTS
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_2
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 || !BR2_powerpc64le
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_5 || !BR2_MIPS_NAN_2008
> +	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4 || !BR2_RISCV_32
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0 || !BR2_RISCV_64
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
>  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4 || !BR2_or1k
> diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
> index 26d731d976..64f7892f98 100644
> --- a/toolchain/toolchain-buildroot/Config.in
> +++ b/toolchain/toolchain-buildroot/Config.in
> @@ -62,6 +62,10 @@ comment "glibc on RISC-V 64-bit needs a toolchain w/ headers >= 5.0"
>  	depends on BR2_RISCV_64
>  	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_0
>  
> +comment "glibc on RISC-V 32-bit needs a toolchain w/ headers >= 5.4"
> +	depends on BR2_RISCV_32
> +	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_4
> +
>  comment "glibc on ARC needs a toolchain w/ headers >= 5.1"
>  	depends on BR2_arc
>  	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1
> -- 
> 2.37.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE
  2022-10-26 18:34 [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Thomas Petazzoni via buildroot
  2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
  2022-10-30 11:45 ` [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Yann E. MORIN
@ 2022-11-13 14:17 ` Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2022-11-13 14:17 UTC (permalink / raw)
  To: Thomas Petazzoni via buildroot
  Cc: Romain Naour, Giulio Benetti, Thomas De Schampheleire,
	Thomas Petazzoni, Yann E. MORIN

>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:

 > In the internal toolchain backend, we have a choice..endchoice block
 > to allow the user to select the C library, between glibc, uClibc and
 > musl.

 > However, there are situations were no C library at all is
 > supported. In this case, the choice does not appear, and does not
 > allow to see the Config.in comments that are within the
 > choice..endchoice block and that may explain why no C library is
 > available.

 > For example, on RISC-V 32-bit, the only C library supported is glibc,
 > and the minimum kernel header version required by glibc on this
 > architecture is 5.4.0. In a future commit, we are going to add this
 > dependency on glibc (to fix build issues on configurations that have
 > headers < 5.4.0). But since glibc is the only supported C library on
 > RISC-V 32-bit, it means that the choice..endchoice for the C library
 > contains no entry, preventing from seeing the Config.in comment.

 > To address this issue, this commit adds a "dummy"
 > BR2_TOOLCHAIN_BUILDROOT_NONE option that shows up in the
 > choice..endchoice only when no C library is available. Thanks to this,
 > the choice..endchoice is never empty, and the Config.in comments can
 > be seen.

 > If the user keeps BR2_TOOLCHAIN_BUILDROOT_NONE selected, then the
 > build will anyway abort early because package/Makefile.in has a check
 > to verify that a C library is selected, and aborts the build if not.

 > Some could say that the problem should be resolved by instead
 > preventing the selection of headers < 5.4.0 on RISC-V 32-bit, but that
 > is difficult to do as the user can choose a custom header version, or
 > simply specific that (s)he wants to use the headers of the kernel
 > being built. In those situations, it's difficult to prevent selecting
 > headers < 5.4.0.

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2022.08.x, thanks.

2022.02.x does have the BR2_PACKAGE_<foo>_SUPPORTS, so I didn't add it
there.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit
  2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
  2022-10-26 21:03   ` Alistair Francis
  2022-10-30 11:45   ` Yann E. MORIN
@ 2022-11-13 14:18   ` Peter Korsgaard
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Korsgaard @ 2022-11-13 14:18 UTC (permalink / raw)
  To: Thomas Petazzoni via buildroot
  Cc: Romain Naour, Giulio Benetti, Thomas De Schampheleire,
	Thomas Petazzoni, Yann E. MORIN

>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:

 > Since glibc 2.33 (upstream commit
 > 7a55dd3fb6d2c307a002a16776be84310b9c8989), headers >= 5.4.0 are needed
 > to build glibc for RISC-V 32-bit. Indeed
 > sysdeps/unix/sysv/linux/riscv/configure.ac contains:

 > if test $libc_cv_riscv_int_abi = ilp32; then
 >   arch_minimum_kernel=5.4.0
 > fi

 > In order to take into account this dependency, we add the appropriate
 > logic in package/glibc/Config.in and
 > toolchain/toolchain-buildroot/Config.in.

 > This change means that if headers < 5.4.0 are selected, then no C
 > library at all will be available for RISC-V 32-bit, as glibc is the
 > only C library supporting RISC-V 32-bit currently. However, thanks to
 > the recent addition of BR2_TOOLCHAIN_BUILDROOT_NONE, the
 > choice...endchoice for the C library selection will not be empty,
 > allowing the user to see the Config.in comment explaining why glibc
 > can't be selected.

 > Therefore, technically this commit does prevent from creating a
 > configuration with RISC-V 32-bit and headers < 5.4.0, but it will have
 > BR2_TOOLCHAIN_BUILDROOT_NONE=y, which is catched by
 > package/Makefile.in, which aborts the build early on pointing out that
 > the configuration is invalid.

 > Fixes:

 >   http://autobuild.buildroot.net/results/5ca49b2732f68eccb5276e7112f7f496dcc514ee/

 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Committed to 2022.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-11-13 14:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 18:34 [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Thomas Petazzoni via buildroot
2022-10-26 18:34 ` [Buildroot] [PATCH 2/2] package/glibc: headers >= 5.4 needed on RISC-V 32-bit Thomas Petazzoni via buildroot
2022-10-26 21:03   ` Alistair Francis
2022-10-30 11:45   ` Yann E. MORIN
2022-11-13 14:18   ` Peter Korsgaard
2022-10-30 11:45 ` [Buildroot] [PATCH 1/2] toolchain/toolchain-buildroot: introduce BR2_TOOLCHAIN_BUILDROOT_NONE Yann E. MORIN
2022-11-13 14:17 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.