[Cbe-oss-dev] libgfortran build failure targeting spu-elf

Ulrich Weigand uweigand at de.ibm.com
Wed Nov 12 05:30:01 EST 2008


Matthias Klose wrote:

> libgfortran fails to build on the trunk when building a cross compiler
> targeting spu-elf. Fixing the first two build failures and seeing more.
> 
> This is a regression compared to 4.3, but I'm wondering if this is
> already fixed on some branch, and was forgotten to check in on the
> trunk?

> +   # We assume newlib.  This lets us hard-code the functions we know
> +   # we'll have.
> +   # FIXME ... define for every function in newlib
> +   #AC_DEFINE(HAVE_XXX, 1, [Define if you have xxx.])

I haven't looked into this in detail yet, but it would be better if we
didn't need to do that (libstdc++ has something along those lines, and
this has repeatedly been a source of problems due to those hard-coded
defines being wrong or outdated ...)

> +   # We are being configured with a cross compiler.  AC_REPLACE_FUNCS
> +   # may not work correctly, because the compiler may not be able to
> +   # link executables.
  
This seems to be the real problem: there is no reason why the compiler
shouldn't be able to link executables.  This is most probably some issue
related to using the correct library path directories.

In fact, I've seen problems in the past related to this, because the
compiler when accessing system libraries in /usr/spu/lib uses a complex
path based on the GCC install directory, something along the lines of:
  -L/usr/lib/gcc/spu/4.3.2/../../../../spu/lib

When building mainline, this would be become
  -L/usr/lib/gcc/spu/4.4.0/../../../../spu/lib
and this fails because that intermediate directory does not (yet) exist.
That would explain why you can build a 4.3 compiler, but not mainline.
I've worked around this in the past by just installing the latest compiler
once to make sure the directory is there, but this should probably be
handled by having the compiler driver "normalize" those paths.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand at de.ibm.com



More information about the cbe-oss-dev mailing list