From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] fortran support
Date: Thu, 5 Mar 2015 22:40:49 +0100 [thread overview]
Message-ID: <20150305224049.3c577eb9@free-electrons.com> (raw)
In-Reply-To: <54F8CA2A.7050002@utexas.edu>
Dear David Kessler,
On Thu, 05 Mar 2015 15:27:06 -0600, David Kessler wrote:
> How can I go about adding the Fortran compiler to my cross compile
> toolchain? I'm currently using the Buildroot toolchain but Fortran has
> been deprecated for some time now. Is there a way that I can add the
> arm Fortran compiler to the toolchain built by Buildroot, perhaps as a
> package or something?
This shouldn't be too difficult I believe. You need to adjust the gcc
package to enable the fortran language, and make sure the fortran
runtime library is copied to the target.
Here is a completely untested (not even compile tested) attempt at
adding some basic Fortran support to the gcc package:
diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index e07d881..3609588 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -108,6 +108,13 @@ config BR2_TOOLCHAIN_BUILDROOT_CXX
C++ language and you want C++ libraries to be installed on
your target system.
+config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
+ bool "Enable Fortran support"
+ help
+ Enable this option if you want your toolchain to support the
+ Fortran language and you want Fortran libraries to be
+ installed on your target system.
+
config BR2_GCC_ENABLE_TLS
bool "Enable compiler tls support" if BR2_TOOLCHAIN_BUILDROOT_UCLIBC
default y
diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index c014bc5..087bdec 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -44,6 +44,7 @@ endef
# Languages supported by the cross-compiler
GCC_FINAL_CROSS_LANGUAGES-y = c
GCC_FINAL_CROSS_LANGUAGES-$(BR2_INSTALL_LIBSTDCPP) += c++
+GCC_FINAL_CROSS_LANGUAGES-$(BR2_TOOLCHAIN_BUILDROOT_FORTRAN) += fortran
GCC_FINAL_CROSS_LANGUAGES = $(subst $(space),$(comma),$(GCC_FINAL_CROSS_LANGUAGES-y))
HOST_GCC_FINAL_CONF_OPTS = \
@@ -126,6 +127,10 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
HOST_GCC_FINAL_USR_LIBS += libstdc++
endif
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT_FORTRAN),y)
+HOST_GCC_FINAL_USR_LIBS += libfortran
+endif
+
ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
HOST_GCC_FINAL_USR_LIBS += libgomp
endif
Let me know if this somewhat works, and please submit a patch once/if
you get this working!
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
prev parent reply other threads:[~2015-03-05 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 21:27 [Buildroot] fortran support David Kessler
2015-03-05 21:40 ` Thomas Petazzoni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150305224049.3c577eb9@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox