ocaml / flexdll

a dlopen-like API for Windows
Other
98 stars 30 forks source link

Added quoting functions for mingw, cygwin, etc. #30

Closed bschommer closed 6 years ago

bschommer commented 7 years ago

The new gnu_quote functions is an ocaml reimplementation of the libiberty writeargv function. Responsefiles will be create for msvc if the command line lenght is larger than 1024 and for gnu based tools for 8192.

This should solve issue #7 .

alainfrisch commented 7 years ago

build_diversion is called from quote_files, used to produce the command line for calling the linker through run_command. When the resulting command line is longer than 8192 characters, this function dumps the command line to a file and applies bash to it. My understanding was that this is enough to pass arbitrarily long command lines to Cygwin programs (relying on some Cygwin magic). Is it not the case?

bschommer commented 7 years ago

I'm not sure. However it would still be better to call the tool directly since process creation is expensive.

bschommer commented 6 years ago

I think in order to have this working it would require some updates concerning uchar support, since I have no time to test this and the current setup works I will close this PR.