[wg-windows] mingw, ocamlopt and "input line is too long"

Andre Maroneze Andre.OLIVEIRAMARONEZE at cea.fr
Thu Jul 7 13:27:36 BST 2016

On 07/07/2016 12:27 PM, Andreas Hauptmann wrote:
> Ok, I think I've identified the problem. Flexlink already writes the
> command to a file and execute this file with bash, if the command line
> is too long. Since both bash and gcc are linked against cygwin-1.dll,
> there aren't any limits beside your main memory (cygwin programs use
> shared memory to pass command line arguments and environment variables
> around, if they hit a limit imposed by windows).
> However there are at least two problems:
> - the decision to use bash or not is based on a gross estimation, not
> the real command line length (It looks at your object files, not your
> include directories)
> - The wrong quote function is used to write the shell script
> (Filename.quote quotes for cmd, not a unix shell,...)
> Try:
> https://www.dropbox.com/s/570bs4205llxqwt/flexlink32.exe
> or
> https://www.dropbox.com/s/ki1bvfdld27vlwb/flexlink64.exe
> as replacement for your current flexlink.exe.
> I’m not sure, if my guess (and patch) is correct. When I’ve tried to
> use a opam switch under a location with long filenames, I fail much
> earlier because of the filename length limit of 260 - not because of
> flexlink. (If you want to use more than 260 chars, you have to use the
> unicode api and always use absolute paths – of course no commonly used
> build system can deal with such limitations.)
> _______________________________________________
> wg-windows mailing list
> wg-windows at lists.ocaml.org
> http://lists.ocaml.org/listinfo/wg-windows

Thanks a lot, I just tested using your flexlink32.exe and it worked just 
fine, I was able to compile frama-c-base on a directory with a long name.

The prefix in my case is only 132 characters long, so even when adding 
the longest path in my sources (~100 characters), it remains under 260, 
so it worked. Still, it's good to know about that limit, I'll inform our 
users about it.

André Maroneze
Ingénieur-chercheur CEA/LIST
Laboratoire Sûreté et Sécurité des Logiciels

More information about the wg-windows mailing list