http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58276
Bug ID: 58276
Summary: "make install-host" gfortran is not functional
Product: gcc
Version: 4.7.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: baker at usgs dot gov
Background
I am using the Open Embedded/Yocto Project "bitbake" machinery to build an
embedded system. I actually use a derivative, called ELDK, from DENX. The git
download and a sample build procedure are at
http://www.denx.de/wiki/view/ELDK-5/EldkBuilding.
The build procedure creates both a cross toolchain on the development host and
a custom rootfs image for the target device. By default, GNU 4.7.2 C and C++
cross compilers are created and used to create the rootfs image. I also need
Fortran for my application, so I enable the bitbake GCC build recipe to include
"fortran" in the --enable-languages= configure option.
Problem
The build procedure produces all three cross compilers I need: gcc, g++, and
gfortran. gcc and g++ are functional. However, gfortran fails in the link
step with the error:
arm-linux-gnueabi-gfortran: error: libgfortran.spec: No such file or directory.
This is true; there is no libgfortran.spec in the cross compilers directory
tree.
Diagnosis
When I have built my own gfortran ARM cross compilers, I do not have this
problem. And, there are many libgfortran.* files in the gfortran cross
compiler directory in addition to libgfortran.spec. I use "make install" as
the last step when I made my own gfortran. However, I found the bitbake GCC
build recipe uses "make install-host". The difference is, the bitbake GCC
build recipe leaves off the "make install-target" step.
I experimented with various "make install" commands using my own gfortran ARM
cross compiler build. I verified that libgfortran.spec is not created by "make
install-host", but is created by "make install-target". (See
http://lists.denx.de/pipermail/eldk/2013-August/002356.html for a detailed
explanation of of my diagnosis.)
I Think This Is a Bug
I am not sure what my expectation should be after a "make install-host". I
cannot find any documentation of the differences between "make install", "make
install-host", and "make install-target". Given that the bitbake GCC build
recipes use "make install-host", I assume "make install-host" is intended to
install functional cross compilers on a development host. That is my
expectation. Indeed, as I mentioned, the gcc and g++ cross compilers work
fine. If that is true, then "make install-gcc" is broken when it leaves out
libgfortran.spec, and any other libgfortran.* files that are required for cross
compilations, as part of the gfortran install step. At a minimum, I would
think an empty libgfortran.spec should be created (assuming the compiler will
accept that), which should then be replaced by the proper libgfortran.spec when
a "make install-libgfortran" is executed.
Thank you.
Larry Baker
US Geological Survey