[Vm-dev] The squeak.sh wrapper an LD_LIBRARY_PATH

Eliot Miranda eliot.miranda at gmail.com
Fri Jan 19 17:48:22 UTC 2018


Hi Tobias,


> On Jan 19, 2018, at 7:57 AM, Tobias Pape <Das.Linux at gmx.de> wrote:
> 
> 
> Hi all,
> 
> So I've seen this LD_LIBRARY_PATH dance in the squeak.sh wrapper.
> I would like to see an example where leaving it out fails.
> My assumption is, that we can rather do something about it on the dlopen-side of the problem and make this script simpler (or even completely unnecessary).

It is vital in cases where one is using external  dynamic link libraries which themselves use other dynamic link libraries.  Also vital in cares where there are variants of e.g. lunch.so for different implementations of features such as thread-local storage.

> 
> I have played around with dlopen on linux (https://github.com/krono/dltest) and my bet is that if we catch all strange names of libc on the dlopen side, change them to "libc.so.6" and just go with it, we might end up just fine.

We might.  But in my hard experience at Cadence using external libraries for license verification, xml parsing and much more, we don't.  It may seem complex but it's there for a reason, and If It Ain't Broke, Don't Fix It. Further, debugging some application because, due to it not having the right LD_LIBRARY_PATH, the VM is using a different errno to that the library ends up using (for a complete because the VM is using a thread-specific implementation but the library ends up using a static one) is really hard, and results in one implementing the LD_LIBRARY_PATH dance you see in the script.

I hope the dance makes more sense now.  Perhaps we should put more commentary in the script.  One /really/ doesn't want these kinds of things to break unless one loves migraines.

> Best regards
>    -Tobias

Cheers!


More information about the Vm-dev mailing list