OMNeT++/OMNEST Bug Tracker - OMNeT++
View Issue Details
0000155OMNeT++command line toolspublic2010-04-23 16:212010-12-09 17:12
rhornig 
rhornig 
normalminoralways
resolvedfixed 
4.1b3 
4.2 
0000155: Large projects cannot be built on MINGW because of linker command line length limitation
The INETMANET project cannot be linked if all sources are included in the build (i.e. including the underTest directory). Command line arguments are limited to 32K on windows. It is possible to pass a long command line by putting the commands into a file and pasing the filename as @filename to g++.
A fix has been implemented which puts the linker command line onto a file and invokes g++ using the @.tmp$$ syntax on windows if we are using minge compiler and it detects larger command line size. Unfortunately g++ extracts all the options from the file and tries to pass the expanded command line when it invokes internally the linker program. So the linker will again fail. It would be a solution if we could convince g++ not to expand the file. There are suggestions to use the -Wl,@filename option to pass all the object files to the linker without expanding it. At the moment it seems that in this case the nternal "collect2" program fails.

See: http://www.itk.org/Bug/view.php?id=10401&nbn=5 [^]
No tags attached.
Issue History
2010-04-23 16:21rhornigNew Issue
2010-04-23 16:52andrasNote Added: 0000241
2010-05-06 09:31andrasStatusnew => confirmed
2010-12-09 12:49rhornigNote Added: 0000343
2010-12-09 17:12rhornigNote Added: 0000346
2010-12-09 17:12rhornigStatusconfirmed => resolved
2010-12-09 17:12rhornigFixed in Version => 4.2
2010-12-09 17:12rhornigResolutionopen => fixed
2010-12-09 17:12rhornigAssigned To => rhornig

Notes
(0000241)
andras   
2010-04-23 16:52   
Possible workaround: keep the @tmpfile fix, and additionally wrap the linker command into a perl script. The perl script could split up the list of object files to 2 or more sub-lists (each <32K), create temporary static libs from each of them, and call the linker to build dll from those static libs.
(0000343)
rhornig   
2010-12-09 12:49   
The current workaround (using response files i.e. @file) is not working becaose of a bug in mingw'S collect2 executable.

See the related discussion on the gcc list.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45749 [^]
(0000346)
rhornig   
2010-12-09 17:12   
Added a preliminary step of building static library first using the @response files syntax. The library tool can handle response files correctly. After this, the created temporary static lib is used in the linker command line.

This could be dropped if the @resultfile handling in MINGW/GCC 4.5.1 is fixed and a new version is bundled with omnet.