LD_PRELOAD and LD_LIBRARY_PATH

Kacvinsky, Tom Tom.Kacvinsky@vector.com
Tue Apr 22 21:14:32 GMT 2025



> -----Original Message-----
> From: Cygwin-developers <cygwin-developers-
> bounces~tom.kacvinsky=vector.com@cygwin.com> On Behalf Of Kacvinsky,
> Tom via Cygwin-developers
> Sent: Tuesday, April 22, 2025 1:44 PM
> To: cygwin-developers@cygwin.com
> Subject: LD_PRELOAD and LD_LIBRARY_PATH
> 
> Hi,
> 
> Is it possible on Cygwin to set LD_LIBRARY_PATH to contain multiple
> directories (one for 32 bit and one for 64 bit) and then set LD_PRELOAD to one
> DLL, so that when a 64 bit executable is run, the 64 bit flavor of the
> LD_PRELOAD DLL is used, and when a 32 bit executable is run, the
> 32 bit flavor of the DLL is used.  This is something that you can do on Linux,
> but from what I've read, this won't  work on Cygwin.
> 
> Any pointers as to what I can do to get this to work?

I should add I am using Windows 11.

Somewhere between 3.1.4 and 3.5.7 is the behavior changed. With 3.1.4
I can have a mixed 32-bit and 64-bit library and the right one gets loaded,
but 3.5.7 insists on loading the 32-bit library even for a 64-bit application.

I'll work on an MRE



More information about the Cygwin-developers mailing list