From owner-freebsd-ports Wed Feb 7 16:53:20 2001 Delivered-To: freebsd-ports@freebsd.org Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (Postfix) with ESMTP id F034837B65D; Wed, 7 Feb 2001 16:53:00 -0800 (PST) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.1/8.11.1) with ESMTP id f180r0213517; Wed, 7 Feb 2001 16:53:00 -0800 (PST) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.1/8.11.0) id f180qxH02749; Wed, 7 Feb 2001 16:52:59 -0800 (PST) (envelope-from jdp) Date: Wed, 7 Feb 2001 16:52:59 -0800 (PST) Message-Id: <200102080052.f180qxH02749@vashon.polstra.com> To: ports@freebsd.org From: John Polstra Reply-To: ports@freebsd.org Cc: sobomax@freebsd.org Subject: Re: Strange problems with dynamic linking of libGL.so.1 from XFree86-4.0.2_5 In-Reply-To: <3A8188ED.FC2A6241@FreeBSD.org> References: <3A6C3D19.E1F56291@FreeBSD.org> <3A755D84.266A80E7@FreeBSD.org> <86vgqn7vj4.wl@cheerful.com> <3A8188ED.FC2A6241@FreeBSD.org> Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In article <3A8188ED.FC2A6241@FreeBSD.org>, Maxim Sobolev wrote: > FUJISHIMA Satsuki wrote: > > > As libc_r does not have libc feature now, there's no reason to avoid > > linking -lc_r against shared libraries, I think. > > > > Index: contrib/gcc.295/config/freebsd.h > > =================================================================== > > RCS file: /home/ncvs/src/contrib/gcc.295/config/freebsd.h,v > > retrieving revision 1.31 > > diff -u -r1.31 freebsd.h > > --- contrib/gcc.295/config/freebsd.h 2001/01/25 18:57:13 1.31 > > +++ contrib/gcc.295/config/freebsd.h 2001/02/06 08:54:23 > > @@ -76,10 +76,8 @@ > > (like the default, except no -lg, and no -p). */ > > #undef LIB_SPEC > > #define LIB_SPEC "\ > > - %{!shared: \ > > - %{!pg: %{pthread:-lc_r} -lc} \ > > - %{pg: %{pthread:-lc_r_p} -lc_p} \ > > - }" > > + %{!pg: %{pthread:-lc_r} %{!shared:-lc}} \ > > + %{pg: %{pthread:-lc_r_p} %{!shared:-lc_p}}" > > > > > > /************************[ Target stuff ]***********************************/ > > David, John what do you think about this patch? I think it would be a mistake to implement this. If the patch above were used then the shared library would contain a dependency on a specific version of libc_r -- say libc_r.so.4. But that version of libc_r is intimately tied to a specific version of libc. Now if the application were run on a later version of FreeBSD, it might get a newer libc which would be incompatible with libc_r.so.4. I think we need to view both libc and libc_r as basic low-level system libraries which are to be linked once and only once into the application. Other shared libraries should not have explicit dependencies on them. If an application uses a library that requires threads then the application itself should be linked with -lc_r or -pthread. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message