diff mbox

[v3,01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol

Message ID 20160703134750.7516-2-s.martin49@gmail.com
State Accepted
Headers show

Commit Message

Samuel Martin July 3, 2016, 1:47 p.m. UTC
This hidden symbol allow to know when libquadmath can be built and installed.

Also, declaring this symbol in toolchain-common.in allows to use it in
both external and buildroot toolchain backend.

This will be needed for adding/improving the fortran support.

Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v2->v3:
- new patch
---
 toolchain/toolchain-common.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Arnout Vandecappelle July 4, 2016, 9:16 a.m. UTC | #1
On 03-07-16 15:47, Samuel Martin wrote:
> This hidden symbol allow to know when libquadmath can be built and installed.
> 
> Also, declaring this symbol in toolchain-common.in allows to use it in
> both external and buildroot toolchain backend.
> 
> This will be needed for adding/improving the fortran support.
> 
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> 
> ---
> changes v2->v3:
> - new patch
> ---
>  toolchain/toolchain-common.in | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
> index 847c905..96ce3d1 100644
> --- a/toolchain/toolchain-common.in
> +++ b/toolchain/toolchain-common.in
> @@ -419,3 +419,13 @@ config BR2_TOOLCHAIN_HAS_ATOMIC
>  	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
>  	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
>  	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
> +
> +# - libquadmath is not needed/available on all architectures (but gcc
> +#   correctly handles this already).
> +# - At least, libquadmath is available on:
> +#   - i*86
> +#   - x86_64
> +# - When available, libquadmath requires wchar support.
> +config BR2_TOOLCHAIN_HAS_LIBQUADMATH
> +	bool
> +	default y if BR2_i386 || BR2_x86_64

 Wouldn't it make more sense to add here:

	depends on BR2_USE_WCHAR

(and remove it from the .mk file)?

 Regards,
 Arnout
>
Thomas Petazzoni July 4, 2016, 2:22 p.m. UTC | #2
Hello,

On Mon, 4 Jul 2016 11:16:08 +0200, Arnout Vandecappelle wrote:

> > +# - libquadmath is not needed/available on all architectures (but gcc
> > +#   correctly handles this already).
> > +# - At least, libquadmath is available on:
> > +#   - i*86
> > +#   - x86_64
> > +# - When available, libquadmath requires wchar support.
> > +config BR2_TOOLCHAIN_HAS_LIBQUADMATH
> > +	bool
> > +	default y if BR2_i386 || BR2_x86_64  
> 
>  Wouldn't it make more sense to add here:
> 
> 	depends on BR2_USE_WCHAR
> 
> (and remove it from the .mk file)?

We thought about this, and discussed it with Samuel, but we had a good
reason not to do it. It was yesterday so I already forgot why.

Ah, there it is. Look at this option:

 config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
        bool "Enable Fortran support"
+       # on architecture building libquadmath, wchar is required
+       depends on !BR2_TOOLCHAIN_HAS_LIBQUADMATH || \
+               (BR2_TOOLCHAIN_HAS_LIBQUADMATH && BR2_USE_WCHAR)

How would express the dependency of Fortran is
BR2_TOOLCHAIN_HAS_LIBQUADMATH handles the BR2_USE_WCHAR dependency?
libquadmath is only available on i386 and x86_64, and in *this* case
wchar is needed for Fortran support.

So, we want to show the Fortran option if:

 * We are on an architecture that does not need libquadmath

or

 * We are on an architecture that does need libquadmath, in which case
   we also need wchar.

Do you see a better solution ?

Best regards,

Thomas
diff mbox

Patch

diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 847c905..96ce3d1 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -419,3 +419,13 @@  config BR2_TOOLCHAIN_HAS_ATOMIC
 	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
 	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
 	default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
+
+# - libquadmath is not needed/available on all architectures (but gcc
+#   correctly handles this already).
+# - At least, libquadmath is available on:
+#   - i*86
+#   - x86_64
+# - When available, libquadmath requires wchar support.
+config BR2_TOOLCHAIN_HAS_LIBQUADMATH
+	bool
+	default y if BR2_i386 || BR2_x86_64