Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 1996 10:31:50 -0400 (EDT)
From:      Keith Mitchell <kmitch@unix.guru.org>
To:        nate@mt.sri.com (Nate Williams)
Cc:        current@freebsd.org
Subject:   Re: Weirdness in current
Message-ID:  <199610171431.KAA10456@unix.guru.org>
In-Reply-To: <199610171359.HAA17511@rocky.mt.sri.com> from Nate Williams at "Oct 17, 96 07:59:08 am"

next in thread | previous in thread | raw e-mail | index | archive | help
> > Ok.  Here's an update.  I just did a make world from a 10-16 current.
> > The dynamic linking now appears to work correctly using the math library
> > by default.
> 
> Are you saying the math library is brought in even if you don't
> explicitly ask for it?

Yes.  It did that in 2.10R, 2.15R, -stable, and now again in -current.  I
have no idea why though.  The program doesn't use any of the functions in
the math library directly.  And, without the math library the program 
core dumps (but ONLY on output redirection ;-<>).  With the math library
compiled in it works fine.

> > Anyone know why this is even necessary?  It still fails when
> > linking the program statically through the -Xlinker -Bstatic option.
> 
> Note, there are known oustanding bugs (that will probably never get
> fixed with the current a.out toolchain) w/regards to different behavior
> in the linker when doing static/dynamic linking.  I'm not sure if this
> is what you are seeing, but it does exist and is known about.
> 
> The linker does *NOT* link the program the preference of the command
> line when mixing static/shared libraries, but instead 'preferes' shared
> libraries over their static counter-parts.

Well, what I think is happening is that the static linking is not bringing
in the math library like the dynamic one now does (see above).  An ldd shows
that the program is entirely static, but the program core dumps on output
redirection, so I am inclined to believe it is not getting the math library.
I wasn't trying to mix libraries either.  I wanted to make it entirely static.

NOTE: -current as of 10/9 did not bring in the math library by default.
-current as of 09/01 behaved the same way (gcc 2.6.3).  Also, If I make
a "hello world" program and compile it with cc I get just the c library.  If
I compile it with c++, I get the c, math, and the stdc++ libraries.  (This is
as of 10/16 anyways).

Thanks



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610171431.KAA10456>