From owner-cvs-all Sun Sep 20 08:48:34 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA11285 for cvs-all-outgoing; Sun, 20 Sep 1998 08:48:34 -0700 (PDT) (envelope-from owner-cvs-all) Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA11184; Sun, 20 Sep 1998 08:48:11 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from spinner.netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (8.8.8/8.8.8/Spinner) with ESMTP id XAA25840; Sun, 20 Sep 1998 23:47:10 +0800 (WST) (envelope-from peter@spinner.netplex.com.au) Message-Id: <199809201547.XAA25840@spinner.netplex.com.au> X-Mailer: exmh version 2.0.2 2/24/98 To: asami@FreeBSD.ORG (Satoshi Asami) cc: mark@grondar.za, markm@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, jdp@polstra.com Subject: Re: cvs commit: ports/graphics/jpeg Makefile ports/graphics/jpeg/pkg PLIST In-reply-to: Your message of "Tue, 15 Sep 1998 00:03:57 MST." <199809150703.AAA26650@silvia.hip.berkeley.edu> Date: Sun, 20 Sep 1998 23:47:08 +0800 From: Peter Wemm Sender: owner-cvs-all@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Satoshi Asami wrote: > * It is not conditional on PORTOBJFORMAT. > * > * GNU Configure makes the decisions: > > Oh, I see. > > * > If it does, does it add the flags "-Wl,-soname,jpeg.so.9" to the cc > * > -shared command line if PORTOBJFORMAT=elf? Hey guys, did you know about -h and -R instead of all this -Wl crap? :-) peter@beast[11:33pm]/tmp/foo-275> cc -fpic -c foo.c peter@beast[11:33pm]/tmp/foo-276> cc -shared -h libfoo.so.1 -R /tmp/foo -o libfoo.so.1.0 foo.o ^^^^^^^^^^^^^^^^^^^^^^^^^^^ peter@beast[11:33pm]/tmp/foo-277> objdump --all-headers libfoo.so.1.0 | more libfoo.so.1.0: file format elf32-i386 libfoo.so.1.0 architecture: i386, flags 0x00000150: HAS_SYMS, DYNAMIC, D_PAGED start address 0x000001dc [...] Dynamic Section: SONAME libfoo.so.1 <<<<<< RPATH /tmp/foo <<<<< INIT 0x1d4 FINI 0x26c [...] And that reminds me.. The RPATH of the libraries is not being correctly incorporated into the headers of the calling executable. Given a libfoo.so like the one above with RPATH "/tmp/foo" encoded in it, a "cc -o x x.c -L. -lfoo" should (IMHO) result in the new binary ("x") having a reference to /tmp/foo in it's own RPATH automatically.. This means you should never need an elf $LD_LIBRARY_PATH or ldconfig -elf as all your binaries have hints (from the libraries themselves) where to look, even if the libraries are in wierd places like the modula-3 runtime libs are (for cvsup). Cheers, -Peter