package/gcc: fix fortran support
authorSamuel Martin <s.martin49@gmail.com>
Sun, 3 Jul 2016 13:47:39 +0000 (15:47 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 3 Jul 2016 14:58:11 +0000 (16:58 +0200)
Fortran depends on libquadmath when available, make the buildroot
toolchain option depends on this new hidden symbol,

[Vincent: only do "HOST_GCC_FINAL_USR_LIBS += libquadmath" for i386 and
x86_64, otherwise it will fail saying "libquadmath.a: file not found"]

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/gcc/Config.in.host
package/gcc/gcc-final/gcc-final.mk

index 44a72f10cb7901aa5946a9e7596bacb2218345b9..7d09b515d0cfb5d5024c52addb94715d7be713d0 100644 (file)
@@ -118,8 +118,15 @@ config BR2_TOOLCHAIN_BUILDROOT_CXX
          C++ language and you want C++ libraries to be installed on
          your target system.
 
+comment "Fortran support needs a toolchain w/ wchar"
+       depends on BR2_TOOLCHAIN_HAS_LIBQUADMATH
+       depends on !BR2_USE_WCHAR # libquadmath
+
 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)
        help
          Enable this option if you want your toolchain to support the
          Fortran language and you want Fortran libraries to be
index 78ceebad056733076a837f627dd905a5f45295f9..284d34cb1ea5e82f3631ccabbc6818bc4a6fe2e8 100644 (file)
@@ -163,6 +163,10 @@ endif
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_FORTRAN),y)
 HOST_GCC_FINAL_USR_LIBS += libgfortran
+# fortran needs quadmath on x86 and x86_64
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBQUADMATH),y)
+HOST_GCC_FINAL_USR_LIBS += libquadmath
+endif
 endif
 
 ifeq ($(BR2_GCC_ENABLE_OPENMP),y)