pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/40692: imake, Solaris and GCC



>Number:         40692
>Category:       pkg
>Synopsis:       imake, Solaris and GCC
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 19 16:10:00 +0000 2009
>Originator:     Jörn Clausen
>Release:        
>Organization:
University of Bielefeld
>Environment:
SunOS spare4200 5.10 Generic_120012-14 i86pc i386 i86pc

>Description:
When building packages that use imake on Solaris, using GCC as compiler and 
modular X11, the resulting binaries are missing a runpath to the X libraries. 
Examples are sysutils/xdu, x11/xearth and probably others:

$ ldd xearth
        libXt.so.6 =>    (file not found)
        libSM.so.6 =>    /usr/lib/libSM.so.6
        libICE.so.6 =>   /usr/lib/libICE.so.6
        libXext.so.0 =>  /usr/lib/libXext.so.0
        libX11.so.6 =>   (file not found)
        libm.so.2 =>     /lib/libm.so.2
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libc.so.1 =>     /lib/libc.so.1
        libdl.so.1 =>    /lib/libdl.so.1
        libX11.so.4 =>   /usr/openwin/lib/libX11.so.4
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1

The libraries found in /usr/lib (SM, ICE, Xext) are wrong, i.e. not the ones 
originally linked against.

The reason is, that imake defines the runpath by setting LD_RUN_PATH. This is 
ignored, because GCC internally passes the option '-R /path/to/gccs/libraries' 
to the linker, which takes precedence over LD_RUN_PATH, i.e. the latter is 
ignored.
>How-To-Repeat:

>Fix:
The imake rules are too convoluted for me to understand. This

#ifdef HasGcc3
#define HasLdRunPath NO
#endif

in sun.cf turns off defining LD_RUN_PATH, but I can't find the magic formula to 
insert linker flags like "-R$(USRLIBDIRPATH)" or "-Wl,-R$(USRLIBDIRPATH)".

Note that e.g. graphics/xfig (see patch-ab) just Pull a Homer by unconditional 
changes like this:

-XPMLIBS = -L$(XPMLIBDIR) -lXpm
+XPMLIBS = -Wl,-R$(XPMLIBDIR) -L$(XPMLIBDIR) -lXpm

Otherwise this package would be affected as well.



Home | Main Index | Thread Index | Old Index