[prog] Fortran portability on linux

Jimen Ching jching at flex.com
Mon Jun 7 15:01:24 EST 2004


On Mon, 7 Jun 2004, Shirrell wrote:
>A customer has now reported that the module does not run and that the
>problem seems to be an incompatibility with glibc 2.3 .  With static
>linking that should not happen.

True.  So it's probably some other problem with the module other than
compatibility with glibc2.3.

>3) There is something about gethostbyname and getservbyname that force
>use of some dynamic libraries even if you specify static linking.

In another email, you said that ldd reported no shared libraries.  Thus,
this is probably false.

>The details which we requested have not arrived.  The source that we sent
>had no direct calls to either gethostby name or getservbyname.

Depending on the version of the GNU linker, you don't need a direct call
to a function to cause it to be linked in.  For example, if you had two
function definitions:

void some_func_that_calls_gethostbyname(void);
void some_func_that_does_not_call_gethostbyname(void);

that exists in the same file and your main() calls the function that
doesn't call gethostbyname(), then gethostbyname will be linked in because
of the other function.  GCC 3.4 has a new feature that prevents this.
There's this -funit-at-a-time option, which won't pull in the uncalled
function, and thus, won't pull in gethostbyname.

>Portability has been our middle name for many years and it is distressing
>to think that we will no longer be truly portable to linux environments.

I'm 99.9% sure this is some basic issue that can easily be solved once we
discover what the problem is.  There's simply not enough information to
determine the problem.  When you get more information, and can't figure
out the problem, email us those information and maybe someone on the list
can spot something.

As others have requested, screen output would be useful.

--jc
-- 
Jimen Ching (WH6BRR)      jching at flex.com     wh6brr at uhm.ampr.org


More information about the Programming mailing list