Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!male!sunpix!matthew From: matthew@sunpix.East.Sun.COM (Matthew Stier - Sun Visualization Products) Newsgroups: comp.windows.x Subject: Re: Sun shared libs - openwin vs MIT R4 Message-ID: <785@sunpix.East.Sun.COM> Date: 10 May 91 13:52:36 GMT References: <9105090143.AA02124@lightning.McRCIM.McGill.EDU> Sender: news@sunpix.East.Sun.COM Organization: Sun Microsystems, Research Triangle Park, NC Lines: 66 In article <9105090143.AA02124@lightning.McRCIM.McGill.EDU> mouse@lightning.mcrcim.mcgill.EDU (der Mouse) writes: >Did you try -Bstatic? :-) Best suggestion, if the user has the source to his program. Gets around the shared library problems all together. (Note: only the X11R4 libraries would need to be statically link. The standard libraries can still be dynamically linked. This is the way I run X11 binaries that require Xaw, within OpenWindows.) > >A couple of suggestions: > >1) Replace all the OW programs with shell script wrappers that bash > $LD_LIBRARY_PATH and then exec the real binary. Actually this could be done the other way around. Have a shell script wrapper for each X11R4 program, that deletes LD_LIBRARY_PATH, and then executes the real X11R4 binary. This way, when the program ends, the shell script ends, and the OpenWindow environment is left the way it was. > >2) Use your favorite binary editor to bash the LD_LIBRARY_PATH string > in the OW binaries to OW_LIBRARY_PATH or some such. (Could be > automated easily; I can toss together a program to do it if you > want.) Won't work. LD_LIBRARY_PATH is only used in /usr/lib/ld.so. LD_LIBRARY_PATH is not OpenWindows specific. It can be used to create a list of alternate libraries for the linker phase of compiling, or the startup phase of execution. > >I have some other suggestions, but they're more in the nature of >beating Sun over the head than help. (Things like "junk anything you >don't have source to, then fix the source and rebuild".) > > der Mouse > > old: mcgill-vision!mouse > new: mouse@larry.mcrcim.mcgill.edu As to the order of execution by the dynamic linker, I submit the following manpage clipping, to support the statement, that the linker is acting properly. ENVIRONMENT LD_LIBRARY_PATH A colon-separated list of directories in which to search for libraries specified with the -l option. Similar to the PATH environment variable. LD_LIBRARY_PATH also affects library searching during execution-time loading, causing the search to use first those directories found in the environment variable, then any directories specified by -L options, and finally the standard directories /usr/lib and /usr/local/lib. NOTE: when running a set-user- or set-group-ID program, ld.so will only search for libraries in directories it "trusts", which are /usr/lib, /usr/5lib, /usr/local/lib, and any direc- tories specified within the executable as a result of -L options given when the executable was constructed. -- Matthew Lee Stier (mstier@east.Sun.COM) | Sun Microsystems --- RTP, NC 27709-3447 | "Wisconsin Escapee" uucp: sun!mstier or mcnc!rti!sunpix!matthew | phone: (919) 469-8300 fax: (919) 460-8355 |