From owner-freebsd-current Thu Oct 17 07:32:04 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA03706 for current-outgoing; Thu, 17 Oct 1996 07:32:04 -0700 (PDT) Received: from unix.guru.org (kmitch@unix.guru.org [198.82.200.65]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA03677 for ; Thu, 17 Oct 1996 07:31:59 -0700 (PDT) Received: (from kmitch@localhost) by unix.guru.org (8.7.6/8.7.3) id KAA10456; Thu, 17 Oct 1996 10:31:50 -0400 (EDT) From: Keith Mitchell Message-Id: <199610171431.KAA10456@unix.guru.org> Subject: Re: Weirdness in current In-Reply-To: <199610171359.HAA17511@rocky.mt.sri.com> from Nate Williams at "Oct 17, 96 07:59:08 am" To: nate@mt.sri.com (Nate Williams) Date: Thu, 17 Oct 1996 10:31:50 -0400 (EDT) Cc: current@freebsd.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > 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