From owner-freebsd-hackers Fri Oct 16 18:29:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA05455 for freebsd-hackers-outgoing; Fri, 16 Oct 1998 18:29:07 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from spawn.nectar.com (spawn.nectar.com [204.27.67.86]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA05447 for ; Fri, 16 Oct 1998 18:29:05 -0700 (PDT) (envelope-from nectar@spawn.nectar.com) Received: from localhost.nectar.com ([127.0.0.1] helo=spawn.nectar.com) by spawn.nectar.com with esmtp (Exim 1.92 #1) id 0zUL9b-00014c-00; Fri, 16 Oct 1998 20:27:35 -0500 X-Mailer: exmh version 2.0.2 2/24/98 X-Exmh-Isig-CompType: repl X-Exmh-Isig-Folder: lists/freebsd X-PGP-RSAfprint: 00 F9 E6 A2 C5 4D 0A 76 26 8B 8B 57 73 D0 DE EE X-PGP-RSAkey: http://www.nectar.com/nectar-pgp262.txt From: Jacques Vidrine In-reply-to: References: Subject: Re: ld and -soname To: Alex Zepeda cc: Peter Wemm , hackers@FreeBSD.ORG Date: Fri, 16 Oct 1998 20:27:35 -0500 Message-Id: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- I didn't make my point well, I see. Let me try again. Assume you have an application you are porting to a FreeBSD ELF system, which contains something such as: - -- Makefile excerpt -- libfoo.so.${FOO_VERSION}: ${FOO_OBJS} ${LD} ${LDFLAGS} -o libfoo.so.${FOO_VERSION} ${FOO_OBJS} libbar.so.${BAR_VERSION}: ${BAR_OBJS} ${LD} ${LDFLAGS} -o libbar.so.${BAR_VERSION} ${BAR_OBJS} - -- Makefile excerpt -- Now, again, I cannot define LDFLAGS to have "-soname libfoo.so.${FOO_VERSION}" nor "-soname libbar.so.${BAR_VERSION}", now can I? I must change the Makefile rules instead, i.e. s/-o libbar.so.${BAR_VERSION}/-soname libbar.so.${BAR_VERSION} -o libbar.so.${BAR_VERSION}/ and s/-o libfoo.so.${FOO_VERSION}/-soname libfoo.so.${FOO_VERSION} -o libfoo.so.${FOO_VERSION}/ Now, back to my original point... I think that it would be handy to have a flag for ld (let's say ``--implied-soname'' for laughs) that would cause DT_SONAME to be set to the filename supplied with the ``-o'' option. Then I can port the above application by simply changing the definition of LDFLAGS to include ``--implied-soname''. Jacques Vidrine / n@nectar.com / nectar@FreeBSD.org On 16 October 1998 at 18:14, Alex Zepeda wrote: > On Fri, 16 Oct 1998, Jacques Vidrine wrote: > > MM, that won't solve the problem which I'm trying to solve. > > I want an ``easy fix'' for the Makefiles in the world that > > have something like > > > > libfoobar.so.${VERSION}: ${OBJS} > > ${LD} ${LDFLAGS} -o libfoobar.so.${VERSION} ${OBJS} > > > > I can't very well put -soname in LDFLAGS. > > Yes you can. When you use gcc -Wl,-soname -Wl,libfoo.so.1 you tell gcc to > pass -soname libfoo.so.1 to ld. With FreeBSD's gcc, you can use gcc > -soname, but this is rather unportable. > > - alex -----BEGIN PGP SIGNATURE----- Version: 2.6.2 iQCVAwUBNifyhzeRhT8JRySpAQFuBwP/YBS37bqi6NhvPudiQTquEATZ2tZQG3Kk JkS26/+oRkYe3qgGI0LsbCJtcsDuv2fjPvzdI3XY5jJd1PW+7WilfdCjt52FeAo4 S8SBpu9V63v8jC/XDObK+fD5t8zGLoUS9XrU5WszyU11PoQpGTqOFsoooCF5SPdW wTNJbKVWKA4= =9WHk -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message