N00b question regarding Cygwin and delay loading

Bill Zissimopoulos billziss@navimatics.com
Mon Jun 20 08:20:00 GMT 2016


TLDR: I am trying to use delay loading with Cygwin. Is it supported?

I have found information that I can do something along the following lines:

	gendef NATIVE.dll
	dlltool --input-def NATIVE.def --output-delaylib NATIVE.dll.a
	gcc -shared -o cygNAME.dll -Wl,--out-implib=libNAME.a NAME.c NATIVE.dll.a


However the messages that I get back say that I am missing the symbol
__delayLoadHelper2. Which actually makes sense. But where is Cygwin’s
delayimp.lib? Is there even one? Or am I supposed to somehow use this with
MSVC’s delayimp.lib? Or perhaps this is just a MinGW feature and not
supported on Cygwin?

Thank for any help. Full (failing) make output below:
<<
billziss@windows:~/Projects/winfsp/src/cygwin [libfuse]$ make
gendef "/cygdrive/c/Program Files (x86)/WinFsp/bin/winfsp-x64.dll"
 * [/cygdrive/c/Program Files (x86)/WinFsp/bin/winfsp-x64.dll] Found PE+
image
dlltool --input-def winfsp-x64.def --output-delaylib winfsp-x64.dll.a
gcc -shared -o cygfuse.dll -Wl,--out-implib=libfuse.a -I../../inc/fuse
cygfuse.c winfsp-x64.dll.a
winfsp-x64.dll.a(dwjdh.o):fake:(.text+0x15): undefined reference to
`__delayLoadHelper2'
winfsp-x64.dll.a(dwjdh.o):fake:(.text+0x15): relocation truncated to fit:
R_X86_64_PC32 against undefined symbol `__delayLoadHelper2'
collect2: error: ld returned 1 exit status
make: *** [Makefile:7: cygfuse.dll] Error 1

>>

Bill



More information about the Cygwin mailing list