On Fri, 30 Jul 2004, Tim Jenness wrote:
> Okay, the problem is clearly that libtool isn't even generating a link
> line to run. Nothing happens. It just makes softlinks to a file that was
> never even attempted to build. ie you get a shared library if CC is the
> linker and you don't get a shared library if FC is the linker.
>
Looking at this further now a new day has dawned:
0. Linking shared libraries using gcc (ie changing the libxxx.la
creation line to use $LINK rather than $FCLINK. Workss like a charm,
presumably because
- unresolved references (to the fortran runtime) are suppressed
- they will all be resolved when the library is linked to an
actual executable
1. Libtool does not attempt to link anything because archive_cmds in the
F77 section is not defined. If I simply copy in the definition from
the top section a command is issued using g77 as the linker. It looks
like a simple oversight in the port of libtool to f77. Is that
something that was done by us? Of course, why does this work
on linux? Does libtool inherit settings from the default configuration
if the tag sets the value to the empty string? [or is it meant to?]
F77 defines a .a section explicitly.
Unfortunately, using the g77 as the linker generates an error
because of the link to libg2c.a (which is static and furthermore
will be linked to by the executable later):
/usr/bin/libtool: internal link edit command failed
ld: common symbols not allowed with MH_DYLIB output format with the
-multi_module option
/sw/lib/gcc/powerpc-apple-darwin7.4.0/3.4.0/../../../libg2c.a(err.o)
definition of common _f__cblank (size 4)
/sw/lib/gcc/powerpc-apple-darwin7.4.0/3.4.0/../../../libg2c.a(fmt.o)
definition of common _f__cnt (size 40)
/sw/lib/gcc/powerpc-apple-darwin7.4.0/3.4.0/../../../libg2c.a(fmt.o)
definition of common _f(char, *) (size 4)
<snip>
Forcing a -Wl,-single_module to libtool does fix things but I have no real
idea what effect that will have downstream when I try to link two shared
libraries that are both statically including a single_module libg2c.a.
I'm going to proceed with caution on this, hard-coding the use of gcc as
the linker and see how I get on. I'll report on this later. Comments from
Norman appreciated :-)
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|