Subject: Re: RPATH and XFree86-libs package
To: None <>
From: Jeremy C. Reed <>
List: tech-pkg
Date: 06/03/2004 21:28:43
On Thu, 27 May 2004, Hubert Feyrer wrote:

> On Wed, 26 May 2004, Jeremy C. Reed wrote:
> > Does anyone have any comments on the SharedLibraryLoadFlags above?
> Not really, but the libs in /usr/lib etc. don't pull in what they need
> either, and last time I asked why that was (quite some time ago) was to
> ensure that the application programmer knows what's going on by forcing
> him to list all the required libs manually.
> Maybe that's the same reasoning for XFree...

I think you are probably correct. I looked on a Red Hat 9 install and saw
the same:

$ ldd /mnt/usr/X11R6/lib/ => not found => not found => not found => not found => not found => /usr/lib/ (0x40020000)
        /usr/lib/ => /usr/lib/ (0x80000000)
$ ldd /mnt/usr/X11R6/lib/ => not found => not found => not found => /usr/lib/ (0x4005c000)
        /usr/lib/ => /usr/lib/ (0x80000000)

objdump -x shows that no RPATH is defined for above.

But a Debian 3.0 box shows:

reed@sloth:~$ ldd /usr/X11R6/lib/ => /usr/X11R6/lib/ (0x40017000) => /usr/X11R6/lib/ (0x40061000) => /usr/X11R6/lib/ (0x4006a000) => /usr/X11R6/lib/ (0x40080000) => /usr/X11R6/lib/ (0x4008d000) => /lib/ (0x40167000)
        /lib/ => /lib/ (0x80000000)
reed@sloth:~$ ldd /usr/X11R6/lib/ => /usr/X11R6/lib/ (0x4004d000) => /usr/X11R6/lib/ (0x40127000) => /usr/X11R6/lib/ (0x40130000) => /lib/ (0x40146000)
        /lib/ => /lib/ (0x80000000)

But the above Debian libraries do not have any RPATH set as shown by
objdump. Now I see that /etc/ (on that Debian box) has the
single line: "/usr/X11R6/lib".

I guess it is correct for Linux to not include a RPATH with the X libs.

For NetBSD (1.6.2_STABLE), it does have some rpath set though:

rainier:~$ ldd /usr/X11R6/lib/
         -lX11.6 => /usr/X11R6/lib/
         -lICE.6 => /usr/X11R6/lib/
         -lSM.6 => /usr/X11R6/lib/
rainier:~$ ldd /usr/X11R6/lib/
         -lX11.6 => /usr/X11R6/lib/
         -lICE.6 => /usr/X11R6/lib/
         -lSM.6 => /usr/X11R6/lib/
         -lXt.6 => /usr/X11R6/lib/
         -lXext.6 => /usr/X11R6/lib/

objdump -x shows "RPATH       /usr/X11R6/lib" for above.

I had noticed this problem when building some qt3-based packages using a
qt3-libs that was using buildlink3. I am now using improved buildlink3'd
qt3-libs from Joachim Kuebart's PR pkg/25753. So I'll pkg_add my old
XFree86-libs back to the way it was.

... And now a day later, qt3-libs, qt3-tools, wip/qhacc, and lyx-qt all
build and appear to work fine using XFree86-libs without RPATH defined
(to /usr/X11R6/lib).

So my orginal patch idea for this can be ignored.

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links