* [Buildroot] [PATCH v2 1/1] toolchain-buildroot: only allow BR2_STATIC_LIBS on supported archs
@ 2022-05-16 0:06 James Hilliard
2022-05-16 10:18 ` Thomas Petazzoni via buildroot
0 siblings, 1 reply; 2+ messages in thread
From: James Hilliard @ 2022-05-16 0:06 UTC (permalink / raw)
To: buildroot
Cc: James Hilliard, Thomas Petazzoni, Romain Naour, Giulio Benetti,
Thomas De Schampheleire
It is currently possible to select BR2_STATIC_LIBS while
BR2_TOOLCHAIN_BUILDROOT is selected even when there are no buildroot
toolchains that support BR2_STATIC_LIBS for the selected architecture.
Add BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS so that we can
disable the selection of BR2_STATIC_LIBS when using an unsupported
architecture.
Fixes:
- http://autobuild.buildroot.net/results/4da/4da59af8193376ec893321c4c2aaf1d25598502d
- http://autobuild.buildroot.net/results/195/1950348218a4f097f078d158977c13f8b0a97d6e
- http://autobuild.buildroot.net/results/2f0/2f03f2be32ad9898a990f6f0264d8c8d51991eb1
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v1 -> v2:
- move supports config variables into toolchain configs
---
Config.in | 2 ++
package/glibc/Config.in | 38 +++++++++++++++++++++++
package/musl/Config.in | 28 +++++++++++++++++
package/uclibc/Config.in | 28 +++++++++++++++++
toolchain/toolchain-buildroot/Config.in | 41 +++++--------------------
5 files changed, 104 insertions(+), 33 deletions(-)
diff --git a/Config.in b/Config.in
index f0cd6f48ed..52c3c4b4c8 100644
--- a/Config.in
+++ b/Config.in
@@ -601,6 +601,8 @@ choice
config BR2_STATIC_LIBS
bool "static only"
+ depends on !BR2_TOOLCHAIN_BUILDROOT || \
+ BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS
help
Build and use only static libraries. No shared libraries will
be installed on the target. This potentially increases your
diff --git a/package/glibc/Config.in b/package/glibc/Config.in
index 8e9ddac7d9..6405bff6a0 100644
--- a/package/glibc/Config.in
+++ b/package/glibc/Config.in
@@ -1,3 +1,41 @@
+config BR2_TOOLCHAIN_BUILDROOT_GLIBC_ARCH_SUPPORTS
+ bool
+ default y if BR2_arm
+ default y if BR2_armeb
+ default y if BR2_aarch64
+ default y if BR2_aarch64_be
+ default y if BR2_i386
+ default y if BR2_mips
+ default y if BR2_mipsel
+ default y if BR2_mips64
+ default y if BR2_mips64el
+ default y if BR2_or1k
+ default y if BR2_powerpc
+ default y if BR2_powerpc64
+ default y if BR2_powerpc64le
+ default y if BR2_riscv
+ default y if BR2_s390x
+ default y if BR2_sh
+ default y if BR2_sparc64
+ default y if BR2_x86_64
+ default y if BR2_microblaze
+ default y if BR2_nios2
+ default y if BR2_arc && BR2_ARC_ATOMIC_EXT
+ default y if BR2_csky
+ depends on !BR2_powerpc_SPE
+ depends on BR2_RISCV_ISA_RVA || !BR2_riscv
+
+config BR2_TOOLCHAIN_BUILDROOT_GLIBC_SUPPORTS
+ bool
+ default y if BR2_TOOLCHAIN_BUILDROOT_GLIBC_ARCH_SUPPORTS
+ depends on BR2_USE_MMU
+ depends on !BR2_STATIC_LIBS
+ 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_0 || !BR2_RISCV_64
+ depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
+
if BR2_TOOLCHAIN_BUILDROOT_GLIBC
comment "Glibc Options"
diff --git a/package/musl/Config.in b/package/musl/Config.in
index 69da615b63..f038acfb46 100644
--- a/package/musl/Config.in
+++ b/package/musl/Config.in
@@ -1,3 +1,31 @@
+config BR2_TOOLCHAIN_BUILDROOT_MUSL_ARCH_SUPPORTS
+ bool
+ default y if BR2_aarch64
+ default y if BR2_arm
+ default y if BR2_armeb
+ default y if BR2_i386
+ default y if BR2_microblaze
+ default y if BR2_mips
+ default y if BR2_mipsel
+ default y if BR2_mips64
+ default y if BR2_mips64el
+ default y if BR2_or1k
+ default y if BR2_powerpc
+ default y if BR2_powerpc64
+ default y if BR2_powerpc64le
+ default y if BR2_RISCV_64
+ default y if BR2_sh
+ default y if BR2_x86_64
+ depends on !BR2_powerpc_SPE # not supported, build breaks
+ depends on !(BR2_powerpc64 || BR2_powerpc64le) || BR2_POWERPC_CPU_HAS_ALTIVEC
+
+config BR2_TOOLCHAIN_BUILDROOT_MUSL_SUPPORTS
+ bool
+ default y if BR2_TOOLCHAIN_BUILDROOT_MUSL_ARCH_SUPPORTS
+ # sh2 nommu is supported by musl, but we don't have support
+ # for it in Buildroot.
+ depends on BR2_USE_MMU
+
config BR2_PACKAGE_MUSL
bool
default y
diff --git a/package/uclibc/Config.in b/package/uclibc/Config.in
index 310414bebc..cf682b30c7 100644
--- a/package/uclibc/Config.in
+++ b/package/uclibc/Config.in
@@ -1,3 +1,31 @@
+config BR2_TOOLCHAIN_BUILDROOT_UCLIBC_ARCH_SUPPORTS
+ bool
+ default y if BR2_aarch64
+ default y if BR2_aarch64_be
+ default y if BR2_arcle
+ default y if BR2_arceb
+ default y if BR2_arm
+ default y if BR2_armeb
+ default y if BR2_i386
+ default y if BR2_m68k
+ default y if BR2_microblaze
+ default y if BR2_mips
+ default y if BR2_mipsel
+ default y if BR2_mips64
+ default y if BR2_mips64el
+ default y if BR2_or1k
+ default y if BR2_powerpc
+ default y if BR2_RISCV_64
+ default y if BR2_sh4
+ default y if BR2_sh4eb
+ default y if BR2_sparc
+ default y if BR2_xtensa
+ default y if BR2_x86_64
+
+config BR2_TOOLCHAIN_BUILDROOT_UCLIBC_SUPPORTS
+ bool
+ default y if BR2_TOOLCHAIN_BUILDROOT_UCLIBC_ARCH_SUPPORTS
+
if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
comment "uClibc Options"
diff --git a/toolchain/toolchain-buildroot/Config.in b/toolchain/toolchain-buildroot/Config.in
index 8d9cf4cc68..f614c333e7 100644
--- a/toolchain/toolchain-buildroot/Config.in
+++ b/toolchain/toolchain-buildroot/Config.in
@@ -20,6 +20,11 @@ config BR2_TOOLCHAIN_BUILDROOT_VENDOR
If you're not sure, just leave the default "buildroot" value.
+config BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS
+ bool
+ default y if BR2_TOOLCHAIN_BUILDROOT_UCLIBC_SUPPORTS
+ default y if BR2_TOOLCHAIN_BUILDROOT_MUSL_SUPPORTS
+
choice
prompt "C library"
default BR2_TOOLCHAIN_BUILDROOT_UCLIBC
@@ -27,13 +32,7 @@ choice
config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
bool "uClibc-ng"
- depends on BR2_aarch64 || BR2_aarch64_be || BR2_arcle || BR2_arceb || \
- BR2_arm || BR2_armeb || \
- BR2_i386 || BR2_m68k || BR2_microblaze || \
- BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el || \
- BR2_or1k || BR2_powerpc || BR2_RISCV_64 || \
- BR2_sh4 || BR2_sh4eb || BR2_sparc || BR2_xtensa || \
- BR2_x86_64
+ depends on BR2_TOOLCHAIN_BUILDROOT_UCLIBC_ARCH_SUPPORTS
select BR2_TOOLCHAIN_USES_UCLIBC
help
This option selects uClibc-ng as the C library for the
@@ -43,23 +42,7 @@ config BR2_TOOLCHAIN_BUILDROOT_UCLIBC
config BR2_TOOLCHAIN_BUILDROOT_GLIBC
bool "glibc"
- depends on BR2_arm || BR2_armeb || BR2_aarch64 || \
- BR2_aarch64_be || BR2_i386 || BR2_mips || \
- BR2_mipsel || BR2_mips64 || BR2_mips64el|| \
- BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le || \
- BR2_riscv || BR2_s390x || BR2_sh || \
- BR2_sparc64 || BR2_x86_64 || BR2_microblaze || \
- BR2_nios2 || (BR2_arc && BR2_ARC_ATOMIC_EXT) || \
- BR2_csky || BR2_or1k
- depends on BR2_USE_MMU
- depends on !BR2_STATIC_LIBS
- 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_0 || !BR2_RISCV_64
- depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_1 || !BR2_arc
- depends on !BR2_powerpc_SPE
- depends on BR2_RISCV_ISA_RVA || !BR2_riscv
+ depends on BR2_TOOLCHAIN_BUILDROOT_GLIBC_SUPPORTS
select BR2_TOOLCHAIN_USES_GLIBC
help
This option selects glibc as the C library for the
@@ -83,15 +66,7 @@ comment "glibc on MIPS w/ NAN2008 needs a toolchain w/ headers >= 4.5"
config BR2_TOOLCHAIN_BUILDROOT_MUSL
bool "musl"
- depends on BR2_aarch64 || BR2_arm || BR2_armeb || BR2_i386 || \
- BR2_microblaze || BR2_mips || BR2_mipsel || BR2_mips64 || \
- BR2_mips64el || BR2_or1k || BR2_powerpc || BR2_powerpc64 || \
- BR2_powerpc64le || BR2_RISCV_64 || BR2_sh || BR2_x86_64
- depends on !BR2_powerpc_SPE # not supported, build breaks
- depends on !(BR2_powerpc64 || BR2_powerpc64le) || BR2_POWERPC_CPU_HAS_ALTIVEC
- # sh2 nommu is supported by musl, but we don't have support
- # for it in Buildroot.
- depends on BR2_USE_MMU
+ depends on BR2_TOOLCHAIN_BUILDROOT_MUSL_ARCH_SUPPORTS
select BR2_TOOLCHAIN_USES_MUSL
help
This option selects musl as the C library for the
--
2.25.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH v2 1/1] toolchain-buildroot: only allow BR2_STATIC_LIBS on supported archs
2022-05-16 0:06 [Buildroot] [PATCH v2 1/1] toolchain-buildroot: only allow BR2_STATIC_LIBS on supported archs James Hilliard
@ 2022-05-16 10:18 ` Thomas Petazzoni via buildroot
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-05-16 10:18 UTC (permalink / raw)
To: James Hilliard
Cc: Romain Naour, Giulio Benetti, Thomas De Schampheleire, buildroot
On Sun, 15 May 2022 18:06:18 -0600
James Hilliard <james.hilliard1@gmail.com> wrote:
> It is currently possible to select BR2_STATIC_LIBS while
> BR2_TOOLCHAIN_BUILDROOT is selected even when there are no buildroot
> toolchains that support BR2_STATIC_LIBS for the selected architecture.
>
> Add BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS so that we can
> disable the selection of BR2_STATIC_LIBS when using an unsupported
> architecture.
>
> Fixes:
> - http://autobuild.buildroot.net/results/4da/4da59af8193376ec893321c4c2aaf1d25598502d
> - http://autobuild.buildroot.net/results/195/1950348218a4f097f078d158977c13f8b0a97d6e
> - http://autobuild.buildroot.net/results/2f0/2f03f2be32ad9898a990f6f0264d8c8d51991eb1
>
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
> Changes v1 -> v2:
> - move supports config variables into toolchain configs
> ---
> Config.in | 2 ++
> package/glibc/Config.in | 38 +++++++++++++++++++++++
> package/musl/Config.in | 28 +++++++++++++++++
> package/uclibc/Config.in | 28 +++++++++++++++++
> toolchain/toolchain-buildroot/Config.in | 41 +++++--------------------
> 5 files changed, 104 insertions(+), 33 deletions(-)
>
> diff --git a/Config.in b/Config.in
> index f0cd6f48ed..52c3c4b4c8 100644
> --- a/Config.in
> +++ b/Config.in
> @@ -601,6 +601,8 @@ choice
>
> config BR2_STATIC_LIBS
> bool "static only"
> + depends on !BR2_TOOLCHAIN_BUILDROOT || \
> + BR2_TOOLCHAIN_BUILDROOT_STATIC_LIBS_SUPPORTS
> help
> Build and use only static libraries. No shared libraries will
> be installed on the target. This potentially increases your
> diff --git a/package/glibc/Config.in b/package/glibc/Config.in
> index 8e9ddac7d9..6405bff6a0 100644
> --- a/package/glibc/Config.in
> +++ b/package/glibc/Config.in
> @@ -1,3 +1,41 @@
> +config BR2_TOOLCHAIN_BUILDROOT_GLIBC_ARCH_SUPPORTS
Should be BR2_PACKAGE_GLIBC_ARCH_SUPPORTS I believe to be consistent
with other packages.
Ditto for uclibc and musl, of course.
(I didn't review in detail the patch, only noticed this)
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-16 10:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16 0:06 [Buildroot] [PATCH v2 1/1] toolchain-buildroot: only allow BR2_STATIC_LIBS on supported archs James Hilliard
2022-05-16 10:18 ` Thomas Petazzoni via buildroot
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.