[ELDK] Fix libtool-cross do_qa_configure error

Larry Baker baker at usgs.gov
Tue Aug 27 07:16:18 CEST 2013


I enabled the build of gfortran in the gcc-cross recipe using a gcc-cross_4.7.bbappend:

> # Build a gfortran cross-compiler
> FORTRAN = ",fortran"

The bitbake build fails in the libtool-cross do_qa_configure step.  See, for example, the same error reported at http://www.mail-archive.com/yocto@yoctoproject.org/msg13845.html:

> configure: WARNING: unrecognized options: --disable-silent-rules, --with-
> sysroot 
> DEBUG: Shell function do_configure finished 
> DEBUG: Executing python function do_qa_configure 
> NOTE: Checking autotools environment for common misconfiguration 
> ERROR: This autoconf log indicates errors, it looked at host include and/or 
> library paths while determining system capabilities. 
> Rerun configure task after fixing this. The path was 
> '/home/appusr/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-
> gnueabi/libtool-cross-2.4.2-r5.1/libtool-2.4.2' 
> DEBUG: Python function do_qa_configure finished 
> ERROR: Function failed: do_qa_configure

This is due to the incomplete support for gfortran in the Yocto bitbake recipes.  It looks like they were written for F77=g77 and have not been updated to support FC=gfortran: the FC variable is not defined properly for cross-compiling -- it is missing the --with-sysroot=.  The result is a misconfiguration reported by --enable-poison-system-directories and discovered by insane.bbclass in do_qa_configure.

These patches define the FC variables and update the default FORTRAN from f77 to fortran:

--- original/eldk/meta/classes/native.bbclass
+++ patched/eldk/meta/classes/native.bbclass
@@ -61,2 +61,3 @@
 export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}"
+export FC = "${CCACHE}${HOST_PREFIX}gfortran ${HOST_CC_ARCH}"
 export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}"
--- original/eldk/meta/conf/bitbake.conf
+++ patched/eldk/meta/conf/bitbake.conf
@@ -448,2 +448,3 @@
 export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export FC = "${CCACHE}${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 export F77 = "${CCACHE}${HOST_PREFIX}g77 ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
@@ -463,2 +464,3 @@
 export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}"
+export BUILD_FC = "${CCACHE}${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
 export BUILD_F77 = "${CCACHE}${BUILD_PREFIX}g77 ${BUILD_CC_ARCH}"
--- original/eldk/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ patched/eldk/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -13,3 +13,3 @@
 # gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
-FORTRAN ?= ",f77"
+FORTRAN ?= ",fortran"
 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"

I know DENX is working on an update for the ELDK-5.4.  I hope there is time to include these patches.

Should I also forward these patches to the Yocto Project?  To the Open Embedded Project?  I don't know exactly who your upstream provider is.

Unfortunately, while these patches enable the creation of a gfortran cross compiler, gfortran cross compiles fail due to a missing libgfortran.spec file.  In fact, there are no libgfortran files at all.  I don't know why.  When I built my own gfortran cross compiler previously from the latest GCC 4.7 Code Sourcery sources, it made all the necessary pieces. I did not have to build any other tools, such as libtool or libgfortran.  I will try to replicate my build using the gcc source downloaded during the Yocto/ELDK build.  Also, I will compare the configure options I used and the ones that Yocto/ELDK uses.  Maybe there are more bitbake files that have to be updated for gfortran cross compiler builds.

Larry Baker
US Geological Survey
650-329-5608
baker at usgs.gov






More information about the eldk mailing list