Skip to contentSkip to conversation

gcc: Allow fortran to build successfully in 4.8

PATCH New Richard Purdie 1 participant 1 message Dec 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc: Allow fortran to build successfully in 4.8

gcc 4.8 fortran presents some challenges:

* libquadmath headers need to be in the libexec include dir. It turns out to be easiest just to manually do this.
* libgfortran configure needs libquadmath to be compiled. This means a separate recipe is needed (the alternative is gross hacks)
* the libtool uses to link libgfortran doesn't have our improved rpath handling and puts bogus RPATHS into the libraries. We can avoid this by tweaking libtool with sed.

This patch resolves those issues. Any user of fortran does need to DEPEND on libgfortran in order to trigger it to build but this shouldn't be a major issue.

---

meta/recipes-devtools/gcc/gcc-cross.inc +5 -0
index 25a3142..5c4319f 100644
@@ -165,6 +165,11 @@ do_install () {
 		rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
 	done
 
+	# libquadmath headers need to  be available in the gcc libexec dir
+	install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+	cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+	cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
 	# We use libiberty from binutils
 	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
 	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
meta/recipes-devtools/gcc/gcc-runtime.inc +1 -1
index 2599760..d3b11a7 100644
@@ -16,7 +16,7 @@ RUNTIMETARGET = "libssp libstdc++-v3 libgomp"
 #  ?
 # libiberty
 # libmudflap
-# libgfortran
+# libgfortran needs separate recipe due to libquadmath dependency
 
 do_configure () {
 	export CXX="${CXX} -nostdinc++ -nostdlib++"
meta/recipes-devtools/gcc/libgfortran.inc new file +75 -0

75 lines not on this page · raw message

meta/recipes-devtools/gcc/libgfortran_4.8.bb new file +3 -0
new file mode 100644
index 0000000..71dd8b4
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+