[comp.windows.x] more fun with shared lib's and building R4

salzman@RAND.ORG (Isaac Salzman) (01/07/90)

in some previous discussion about shared lib's not being found,  

>rws@expo.lcs.mit.edu (Bob Scheifler) writes:
>mkfontdir should have worked fine during the build, at least if you use Sun's
>cc for everything.  This part was pretty carefully tested.  My guess would be
>that gcc isn't handling the -L option correctly.  If you go ahead and install
>the shared libraries and run ldconfig, you should be OK.

i did a sun3 (SunOS 4.0.3) build with gcc (1.35) and many of the clients
didn't link properly - lots of undefined symbols. my first assumption was
the one Bob made (gcc doesn't handle -L properly) - but that didn't make
sense. i tried linking again with "gcc -v" and "cc -v". same results. cc and
gcc are both passing -L arguments (and everything else) in the same order to
ld. turns out i've got LD_LIBRARY_PATH set to include where my X11R3 lib's
are installed. guess what - ld is broken (i confirmed this by looking at the
source code to ld). LD_LIBRARY_PATH overrides -L, which is contrary to what
the manual page implies:

     ld searches for the desired object file through  a  list  of
     directories  specified  by -L options, the environment vari-
     able LD_LIBRARY_PATH, and  finally,  the  built-in  list  of
     standard library directories:  /lib, /usr/lib, and
     /usr/local/lib.
			 
anyone else run into this little problem? just "unsetenv LD_LIBRARY_PATH"
before you run make to fix it. time to send a bug report to sun....

--
* Isaac J. Salzman                                            ----     
* The RAND Corporation - Information Sciences Dept.          /o o/  /  
* 1700 Main St., PO Box 2138, Santa Monica, CA 90406-2138    | v |  |  
* AT&T      : +1 213-393-0411 x6421 or x7923 (ISL lab)      _|   |_/   
* Internet  : salzman@rand.org                             / |   |
* UUCP      : !uunet!rand.org!salzman                      | |   |