btool hitting command line limit on XP/Mingw/Msys
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
David Mathog |
Bug Description
It seems that current releases of trunk will not build on WIndows XP under mingw because they are hitting command line length limits.
History:
In trunk at r12815 btool running in cmd.exe failed with:
##### link objects and library to create executable
--- link / rc
--- link / link
Make error line 437: LINK problem: mingw32-g++: error: CreateProcess: No
such file or directory
To diagnose this I hacked up the local copy of buildtool.cpp to dump the command it was choking on. This turned out to be a very long lne of 30152 characters (longlink.txt). Tried to run it from within Msys via:
. longlink.txt
but it didn't like the '\' characters. So swapped those all to '/' and tried:
. longlink2.txt
which gave the same error.
Then edited longlink2.txt into longlink3.txt, which is one clause per line. Tried
mingw32-g++ @longlink3.txt
and still the same error. Then did
mingw32-g++ -v @longlink3.txt
and it turned out that g++ was reassembling the file in lines and passing it to collect2, so it could still be a long line issue.
Noticed that there were MANY "-Lc:/progs/
mingw32-g++ -v @longlink3.txt
worked. Conclusion: btool is trying to use a command line that is too long for one of the underlying tools, most likely Mingw or Msys, but possibly some library in Windows XP.
Versions:
mingw32-g++ (GCC) 4.6.2
XP SP3
mingw32 3.20 (from /mingw/
Related issue:
build.xml constructs the link line using:
${pcl.
for each library. However, since they share various dependencies, this replicates a very large number of linker command line options. That is no problem on an OS with an unlimited command line, but here, it pushes us over the limit. Having btool sort that list and eliminate the duplicates would save some characters on the command line. However, that would be at best a stop gap measure, since most of the characters are in all of the "build/
Suggested fix - have btool construct a static library for each subdirectory of src, then have it generate a final command line
that links those static libraries together. So long as no subdirectory contains more than 30k characters worth of object files, that should work going forward for the foreseeable future.
It is possible that btool might work in some other run environment. There may be a cmd.exe replacement that somehow lifts the 30k character limit. (I do not know specifically where that comes from, or how Mingw is affected by it.)
Reference: another project with similar issues:
tags: | added: regression |
Changed in inkscape: | |
milestone: | none → 0.49 |
Changed in inkscape: | |
assignee: | nobody → David Mathog (mathog) |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Run like:
. longlink2.txt