Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Sep 1998 23:47:08 +0800
From:      Peter Wemm <peter@netplex.com.au>
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 
Message-ID:  <199809201547.XAA25840@spinner.netplex.com.au>
In-Reply-To: Your message of "Tue, 15 Sep 1998 00:03:57 MST." <199809150703.AAA26650@silvia.hip.berkeley.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809201547.XAA25840>