diff mbox

[v2,11/15] toolchain/toolchain-external: add libgfortran and libquadmath to the TOOLCHAIN_EXTERNAL_LIBS list

Message ID 20160701162920.19632-12-s.martin49@gmail.com
State Changes Requested
Headers show

Commit Message

Samuel Martin July 1, 2016, 4:29 p.m. UTC
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>

---
changes v1->v2:
- s/USR_LIB_EXTERNAL_LIBS/TOOLCHAIN_EXTERNAL_LIBS/
- only install libquadmath for x86{,_64} target (not built on other
  arch.)
---
 toolchain/toolchain-external/toolchain-external.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thomas Petazzoni July 1, 2016, 9:22 p.m. UTC | #1
Hello,

On Fri,  1 Jul 2016 18:29:16 +0200, Samuel Martin wrote:

> +ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
> +TOOLCHAIN_EXTERNAL_LIBS += libgfortran.so.*
> +# fortran needs quadmath on x86 and x86_64
> +ifeq ($(BR2_I386)$(BR2_x86_64),y)
> +TOOLCHAIN_EXTERNAL_LIBS += libquadmath.so*
> +endif
> +endif

OK. Then maybe on the internal toolchain backend side, we should keep
things simple for libquadmath:

 1/ Disable it when we know it's not supported (wchar missing)

 2/ Forcefully enable it when Fortran is enabled and we're on
    i386/x86_64

 3/ Copy it only when Fortran is enabled and i386/x86_64

Which is pretty much what you did originally I believe.

This way, only the people who care about Fortran support will have
libquadmath copied to their target. If in the future some other
non-Fortran related package needs libquadmath, we can revisit this at
this time.

Thomas
Arnout Vandecappelle July 2, 2016, 11:22 a.m. UTC | #2
On 01-07-16 23:22, Thomas Petazzoni wrote:
> Hello,
> 
> On Fri,  1 Jul 2016 18:29:16 +0200, Samuel Martin wrote:
> 
>> +ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
>> +TOOLCHAIN_EXTERNAL_LIBS += libgfortran.so.*
>> +# fortran needs quadmath on x86 and x86_64
>> +ifeq ($(BR2_I386)$(BR2_x86_64),y)
>> +TOOLCHAIN_EXTERNAL_LIBS += libquadmath.so*
>> +endif
>> +endif
> 
> OK. Then maybe on the internal toolchain backend side, we should keep
> things simple for libquadmath:
> 
>  1/ Disable it when we know it's not supported (wchar missing)
> 
>  2/ Forcefully enable it when Fortran is enabled and we're on
>     i386/x86_64
> 
>  3/ Copy it only when Fortran is enabled and i386/x86_64
> 
> Which is pretty much what you did originally I believe.
> 
> This way, only the people who care about Fortran support will have
> libquadmath copied to their target. If in the future some other
> non-Fortran related package needs libquadmath, we can revisit this at
> this time.

 fftw you mean? :-)

 At this point, it is perhaps better to introduce a blind
BR2_TOOLCHAIN_HAS_QUADMATH option (or should it be USE?) that is selected
automatically as appropriate. Later we could add a BR2_PACKAGE_GCC_QUADMATH
option to enable it explicitly.

 Regards,
 Arnout
diff mbox

Patch

diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 53a7c7a..9629c46 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -90,6 +90,14 @@  ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
 TOOLCHAIN_EXTERNAL_LIBS += libstdc++.so.*
 endif
 
+ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
+TOOLCHAIN_EXTERNAL_LIBS += libgfortran.so.*
+# fortran needs quadmath on x86 and x86_64
+ifeq ($(BR2_I386)$(BR2_x86_64),y)
+TOOLCHAIN_EXTERNAL_LIBS += libquadmath.so*
+endif
+endif
+
 TOOLCHAIN_EXTERNAL_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS))
 
 # Details about sysroot directory selection.