Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Oct 1998 20:27:35 -0500
From:      Jacques Vidrine <n@nectar.com>
To:        Alex Zepeda <garbanzo@hooked.net>
Cc:        Peter Wemm <peter@netplex.com.au>, hackers@FreeBSD.ORG
Subject:   Re: ld and -soname 
Message-ID:  <E0zUL9b-00014c-00@spawn.nectar.com>
In-Reply-To: <Pine.BSF.4.00.9810161813560.3177-100000@zippy.dyn.ml.org> 
References:  <Pine.BSF.4.00.9810161813560.3177-100000@zippy.dyn.ml.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----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 <garbanzo@hooked.net> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0zUL9b-00014c-00>