Skip to contentSkip to conversation

arch: move global and rename variable BR2_PACKAGE_Z3_ARCH_SUPPORTS

PATCH In review Giulio Benetti 4 participants 8 messages Feb 9, 2023 – Sep 30, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch: move global and rename variable BR2_PACKAGE_Z3_ARCH_SUPPORTS

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

---
 arch/Config.in            | 24 ++++++++++++++++++++++++
 package/quickjs/Config.in |  4 ++--
 package/z3/Config.in      | 25 +------------------------
 3 files changed, 27 insertions(+), 26 deletions(-)
arch/Config.in +24 -0
index 1c0c400a98..90846861ca 100644
@@ -253,6 +253,30 @@ config BR2_xtensa
 
 endchoice
 
+# Not all architectures support float rounding. This can be found while
+# checking if fenv.h provides all four macros:
+# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
+# See for example in glibc https://sourceware.org/git/glibc.git
+# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
+config BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
+	bool
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_arceb || BR2_arcle
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_i386
+	default y if BR2_m68k
+	# BR2_microblaze has only FE_TONEAREST
+	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	# BR2_nios2 has only FE_TONEAREST
+	default y if BR2_or1k
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_riscv
+	default y if BR2_s390x
+	# BR2_sh has only FE_{TONEAREST,TOWARDZERO}
+	default y if BR2_sparc || BR2_sparc64
+	default y if BR2_x86_64
+	# BR2_xtensa supports only uclibc which does not have fenv.h
+
 # For some architectures or specific cores, our internal toolchain
 # backend is not suitable (like, missing support in upstream gcc, or
 # no ChipCo fork exists...)
package/quickjs/Config.in +2 -2
index dc466241ba..6f24787333 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_QUICKJS
 	bool "quickjs"
-	depends on !BR2_nios2 # fenv.h lacks FE_{DOWN,UP}WARD on nios2
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING # fenv.h lacks FE_{DOWN,UP}WARD
 	depends on !BR2_STATIC_LIBS
 	# No way to check for fenv support.
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC
@@ -15,7 +15,7 @@ config BR2_PACKAGE_QUICKJS
 	  https://bellard.org/quickjs/
 
 comment "quickjs needs a glibc or musl toolchain w/ gcc >= 4.9, host gcc >= 4.9, dynamic library"
-	depends on !BR2_nios2
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_UCLIBC || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || !BR2_HOST_GCC_AT_LEAST_4_9
package/z3/Config.in +1 -24
index 8cd3128687..5ceca5dbe2 100644
@@ -1,33 +1,10 @@
-# z3 supports arch for which libc fenv.h provides all four macros:
-# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
-# See for example in glibc https://sourceware.org/git/glibc.git
-# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
-config BR2_PACKAGE_Z3_ARCH_SUPPORTS
-	bool
-	default y if BR2_aarch64 || BR2_aarch64_be
-	default y if BR2_arceb || BR2_arcle
-	default y if BR2_arm || BR2_armeb
-	default y if BR2_i386
-	default y if BR2_m68k
-	# BR2_microblaze has only FE_TONEAREST
-	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
-	# BR2_nios2 has only FE_TONEAREST
-	default y if BR2_or1k
-	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
-	default y if BR2_riscv
-	default y if BR2_s390x
-	# BR2_sh has only FE_{TONEAREST,TOWARDZERO}
-	default y if BR2_sparc || BR2_sparc64
-	default y if BR2_x86_64
-	# BR2_xtensa supports only uclibc which does not have fenv.h
-
 config BR2_PACKAGE_Z3
 	bool "z3"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # c++17
 	# z3 needs fenv.h which is not provided by uclibc
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC
-	depends on BR2_PACKAGE_Z3_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
 	help
 	  Z3, also known as the Z3 Theorem Prover, is a cross-platform
 	  satisfiability modulo theories (SMT) solver.
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Pardon, this had to be a RFC, I've forgotten to add it.

Some architecture still lacks some float rounding but is listed. Let me know if it's possible to apply this patch and catch the other architecture failures on Autobuilder rather than check all the architectures' FPU implementation by hand(I can do it anyway if requested).

Best regards

Signature · 2 lines
Giulio Benetti
CEO/CTO@Benetti Engineering sas
Quoted 104 lines · Giulio Benetti

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

---
  arch/Config.in            | 24 ++++++++++++++++++++++++
  package/quickjs/Config.in |  4 ++--
  package/z3/Config.in      | 25 +------------------------
  3 files changed, 27 insertions(+), 26 deletions(-)
arch/Config.in +24 -0
index 1c0c400a98..90846861ca 100644
@@ -253,6 +253,30 @@ config BR2_xtensa
 
  endchoice
 
+# Not all architectures support float rounding. This can be found while
+# checking if fenv.h provides all four macros:
+# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
+# See for example in glibc https://sourceware.org/git/glibc.git
+# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
+config BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
+	bool
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_arceb || BR2_arcle
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_i386
+	default y if BR2_m68k
+	# BR2_microblaze has only FE_TONEAREST
+	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	# BR2_nios2 has only FE_TONEAREST
+	default y if BR2_or1k
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_riscv
+	default y if BR2_s390x
+	# BR2_sh has only FE_{TONEAREST,TOWARDZERO}
+	default y if BR2_sparc || BR2_sparc64
+	default y if BR2_x86_64
+	# BR2_xtensa supports only uclibc which does not have fenv.h
+
  # For some architectures or specific cores, our internal toolchain
  # backend is not suitable (like, missing support in upstream gcc, or
  # no ChipCo fork exists...)
package/quickjs/Config.in +2 -2
index dc466241ba..6f24787333 100644
@@ -1,6 +1,6 @@
  config BR2_PACKAGE_QUICKJS
  	bool "quickjs"
-	depends on !BR2_nios2 # fenv.h lacks FE_{DOWN,UP}WARD on nios2
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING # fenv.h lacks FE_{DOWN,UP}WARD
  	depends on !BR2_STATIC_LIBS
  	# No way to check for fenv support.
  	depends on !BR2_TOOLCHAIN_USES_UCLIBC
@@ -15,7 +15,7 @@ config BR2_PACKAGE_QUICKJS
  	  https://bellard.org/quickjs/
 
  comment "quickjs needs a glibc or musl toolchain w/ gcc >= 4.9, host gcc >= 4.9, dynamic library"
-	depends on !BR2_nios2
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
  	depends on BR2_USE_MMU
  	depends on BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_UCLIBC || \
  		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || !BR2_HOST_GCC_AT_LEAST_4_9
package/z3/Config.in +0 -23
index 8cd3128687..5ceca5dbe2 100644
@@ -1,33 +1,10 @@
-# z3 supports arch for which libc fenv.h provides all four macros:
-# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
-# See for example in glibc https://sourceware.org/git/glibc.git
-# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
-config BR2_PACKAGE_Z3_ARCH_SUPPORTS
-	bool
-	default y if BR2_aarch64 || BR2_aarch64_be
-	default y if BR2_arceb || BR2_arcle
-	default y if BR2_arm || BR2_armeb
-	default y if BR2_i386
-	default y if BR2_m68k
-	# BR2_microblaze has only FE_TONEAREST
-	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
-	# BR2_nios2 has only FE_TONEAREST
-	default y if BR2_or1k
-	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
-	default y if BR2_riscv
-	default y if BR2_s390x
-	# BR2_sh has only FE_{TONEAREST,TOWARDZERO}
-	default y if BR2_sparc || BR2_sparc64
-	default y if BR2_x86_64
-	# BR2_xtensa supports only uclibc which does not have fenv.h
-
  config BR2_PACKAGE_Z3

package/z3/Config.in line 10

Quoted 10 lines
package/z3/Config.in +1 -1
  	bool "z3"
  	depends on BR2_INSTALL_LIBSTDCPP
  	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # c++17
  	# z3 needs fenv.h which is not provided by uclibc
  	depends on !BR2_TOOLCHAIN_USES_UCLIBC
-	depends on BR2_PACKAGE_Z3_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
  	help
  	  Z3, also known as the Z3 Theorem Prover, is a cross-platform
  	  satisfiability modulo theories (SMT) solver.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Giulio Benetti
Quoted 6 lines · On Thu, 9 Feb 2023 01:48:23 +0100 Giulio Benetti…

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Quoted 7 lines

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

Apparently
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
would also need the same thing.

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw
Quoted 28 lines · Thomas Petazzoni via buildroot

Subject:
Re: [Buildroot] [PATCH] arch: move global and rename variable BR2_PACKAGE_Z3_ARCH_SUPPORTS From:
Thomas Petazzoni via buildroot <[email protected]>
Date:
09/02/23, 08:54

To:
Giulio Benetti <[email protected]> CC:
Julien Olivain <[email protected]>, [email protected]

Quoted 12 lines · On Thu, 9 Feb 2023 01:48:23 +0100 Giulio…

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

Quoted 4 lines
Quoted 1 line

Apparently
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
would also need the same thing.

Yes, it requires it too once it is applied. I can modify my patch if you apply the swipl one before. No problem.

Best regards

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Giulio Benetti

Hi Giulio,

Quoted 6 lines · Giulio Benetti

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Quoted 7 lines

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

To comment a bit on that, the complete condition is a bit more tricky:
- the CPU arch FPU HW must have all 4 rounding modes,
- the libc must expose a fenv.h header,
- the libc must also expose all 4 rouding modes.

glibc generally exposes all the HW supported rounding modes. I initially excluded uclibc-ng, because in its Buildroot default configuration, fenv.h is not enabled [1]. I believe it's possible to have some uclibc-ng configuration that are enable and exposing those rounding modes. See [2].

So this proposal is correct but possibly discard the case in which libc is uclibc-ng and its (custom) configuration exposes all FE rounding modes.

I am not sure if it's really an issue, as packages with such requirements are mostly tested with glibc anyway...

Best regards,

Julien.

[1] https://git.busybox.net/buildroot/tree/package/uclibc/uClibc-ng.config
[2] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/extra/Configs/Config.in.arch?h=v1.0.42#n180
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Hi Julien,

Quoted 16 lines · Julien Olivain

  Hi Giulio,

Quoted 12 lines · Giulio Benetti

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

Quoted 6 lines
Quoted 1 line

To comment a bit on that, the complete condition is a bit more tricky:
- the CPU arch FPU HW must have all 4 rounding modes,
- the libc must expose a fenv.h header,
- the libc must also expose all 4 rouding modes.

thank you for the more precise explanation, everything is more clear now

Quoted 8 lines

glibc generally exposes all the HW supported rounding modes.  I initially excluded uclibc-ng, because in its Buildroot default configuration, fenv.h is not enabled [1]. I believe it's possible to have some uclibc-ng configuration that are enable and exposing those rounding modes. See [2].

So this proposal is correct but possibly discard the case in which libc is uclibc-ng and its (custom) configuration exposes all FE rounding modes.

Maybe we can enable UCLIBC_HAS_FENV on uclibc-ng by default, so all
architectures that UCLIBC_HAS_FLOAT they have it. Otherwise that UCLIBC_HAS_FENV gets discarded if I'm correct.

Quoted 2 lines

I am not sure if it's really an issue, as packages with such requirements are mostly tested with glibc anyway...

Same here for the architecture.

So we'd need a valid condition that is true for the 3 points you've listed above exactly in the order you've listed them if I'm correct.

Maybe we can do an intermediate step with this patch and later deal with this matrix validity check

Best regards

Signature · 2 lines
Giulio Benetti
Benetti Engineering sas
Quoted 6 lines

Best regards,

Julien.

[1] https://git.busybox.net/buildroot/tree/package/uclibc/uClibc-ng.config
[2] https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/extra/Configs/Config.in.arch?h=v1.0.42#n180

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

Hi Giulio,

Le 09/02/2023 à 21:54, Giulio Benetti a écrit :

Quoted 44 lines

Hi Julien,

Quoted 16 lines · Julien Olivain

   Hi Giulio,

Quoted 12 lines · Giulio Benetti

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

Quoted 6 lines
Quoted 1 line

To comment a bit on that, the complete condition is a bit more tricky:
- the CPU arch FPU HW must have all 4 rounding modes,
- the libc must expose a fenv.h header,
- the libc must also expose all 4 rouding modes.

thank you for the more precise explanation, everything is more clear now

Quoted 8 lines

glibc generally exposes all the HW supported rounding modes.  I initially excluded uclibc-ng, because in its Buildroot default configuration, fenv.h is not enabled [1]. I believe it's possible to have some uclibc-ng configuration that are enable and exposing those rounding modes. See [2].

So this proposal is correct but possibly discard the case in which libc is uclibc-ng and its (custom) configuration exposes all FE rounding modes.

Maybe we can enable UCLIBC_HAS_FENV on uclibc-ng by default, so all architectures that UCLIBC_HAS_FLOAT they have it. Otherwise that UCLIBC_HAS_FENV gets discarded if I'm correct.

Quoted 2 lines

I am not sure if it's really an issue, as packages with such requirements are mostly tested with glibc anyway...

Quoted 7 lines

Same here for the architecture.

So we'd need a valid condition that is true for the 3 points you've listed above exactly in the order you've listed them if I'm correct.

Maybe we can do an intermediate step with this patch and later deal with this matrix validity check

As discussed on IRC, I marked this patch as changes requested.

Best regards,
Romain

Quoted 2 lines

Best regards

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw
In reply to Giulio Benetti

Hello Giulio,

Le 09/02/2023 à 01:48, Giulio Benetti a écrit :

Quoted 59 lines

Package quickjs fails to build on architectures that don't support full float rounding. To support all kind of float rounding FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD must be defined in fenv.h. Since package z3 locally implements this check let's make it global, rename it to be generic and use it for both package quickjs and z3.

Fixes:
http://autobuild.buildroot.net/results/0b6/0b67381e3643c134c92cbcd1c5dc258fd760cd7e/
http://autobuild.buildroot.net/results/cf2/cf249a82c83d3c8503205f4c3c5859dd9d52afdf/
http://autobuild.buildroot.net/results/9b3/9b37c6c55a5b468657af26ef9b57d4fe24d8fde2/
http://autobuild.buildroot.net/results/4f1/4f13cf7d353260c6b8934dbdcf267bea884b356b/

---
 arch/Config.in            | 24 ++++++++++++++++++++++++
 package/quickjs/Config.in |  4 ++--
 package/z3/Config.in      | 25 +------------------------
 3 files changed, 27 insertions(+), 26 deletions(-)
arch/Config.in +24 -0
index 1c0c400a98..90846861ca 100644
@@ -253,6 +253,30 @@ config BR2_xtensa
 
 endchoice
 
+# Not all architectures support float rounding. This can be found while
+# checking if fenv.h provides all four macros:
+# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
+# See for example in glibc https://sourceware.org/git/glibc.git
+# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
+config BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
+	bool
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_arceb || BR2_arcle
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_i386
+	default y if BR2_m68k
+	# BR2_microblaze has only FE_TONEAREST
+	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+	# BR2_nios2 has only FE_TONEAREST
+	default y if BR2_or1k
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_riscv
+	default y if BR2_s390x
+	# BR2_sh has only FE_{TONEAREST,TOWARDZERO}
+	default y if BR2_sparc || BR2_sparc64
+	default y if BR2_x86_64
+	# BR2_xtensa supports only uclibc which does not have fenv.h
+
 # For some architectures or specific cores, our internal toolchain
 # backend is not suitable (like, missing support in upstream gcc, or
 # no ChipCo fork exists...)
package/quickjs/Config.in +0 -0
index dc466241ba..6f24787333 100644

package/quickjs/Config.in line 3

Quoted 4 lines
package/quickjs/Config.in +1 -1
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_QUICKJS
 	bool "quickjs"
-	depends on !BR2_nios2 # fenv.h lacks FE_{DOWN,UP}WARD on nios2
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING # fenv.h lacks FE_{DOWN,UP}WARD

I would suggest to split into two separate patches:
- Move and rename BR2_PACKAGE_Z3_ARCH_SUPPORTS -> BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
- Fix quickjs dependencies with BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING

While at it, you can improve the commit log with Julien's comments:
http://lists.busybox.net/pipermail/buildroot/2023-February/661768.html

Best regards,
Romain

Quoted 41 lines
package/quickjs/Config.in +1 -1
 	depends on !BR2_STATIC_LIBS
 	# No way to check for fenv support.
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC
@@ -15,7 +15,7 @@ config BR2_PACKAGE_QUICKJS
 	  https://bellard.org/quickjs/
 
 comment "quickjs needs a glibc or musl toolchain w/ gcc >= 4.9, host gcc >= 4.9, dynamic library"
-	depends on !BR2_nios2
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
 	depends on BR2_USE_MMU
 	depends on BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_UCLIBC || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || !BR2_HOST_GCC_AT_LEAST_4_9
package/z3/Config.in +0 -23
index 8cd3128687..5ceca5dbe2 100644
@@ -1,33 +1,10 @@
-# z3 supports arch for which libc fenv.h provides all four macros:
-# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
-# See for example in glibc https://sourceware.org/git/glibc.git
-# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
-config BR2_PACKAGE_Z3_ARCH_SUPPORTS
-	bool
-	default y if BR2_aarch64 || BR2_aarch64_be
-	default y if BR2_arceb || BR2_arcle
-	default y if BR2_arm || BR2_armeb
-	default y if BR2_i386
-	default y if BR2_m68k
-	# BR2_microblaze has only FE_TONEAREST
-	default y if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
-	# BR2_nios2 has only FE_TONEAREST
-	default y if BR2_or1k
-	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
-	default y if BR2_riscv
-	default y if BR2_s390x
-	# BR2_sh has only FE_{TONEAREST,TOWARDZERO}
-	default y if BR2_sparc || BR2_sparc64
-	default y if BR2_x86_64
-	# BR2_xtensa supports only uclibc which does not have fenv.h
-
 config BR2_PACKAGE_Z3

package/z3/Config.in line 10

Quoted 10 lines
package/z3/Config.in +1 -1
 	bool "z3"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7 # c++17
 	# z3 needs fenv.h which is not provided by uclibc
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC
-	depends on BR2_PACKAGE_Z3_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_ARCH_HAS_ALL_FLOAT_ROUNDING
 	help
 	  Z3, also known as the Z3 Theorem Prover, is a cross-platform
 	  satisfiability modulo theories (SMT) solver.

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot