gcj problem compiling 850 files

Erik Poupaert erik.poupaert@chello.be
Fri Jan 24 11:10:00 GMT 2003


>>>> I have experienced problems with many input files as well, concerning
>>>> the mingw port. In the linux port there seems to be no limit to the
>>>> number of input classes, or at least I haven't bumped into it yet.
>>>> Windows is a completely different matter it seems. I solve it by
>>>> compiling in bites to .o object files, and then linking it all.

I've run into the same problem. The lpCommandLine string in the win32
CreateProcess() function is limited to 32Kb. When the string gets larger
than the limit, the process creation fails.
I solve this by creating archives of the *.o files (for example, per
namespace) with ar; and link the resulting *.a files:
 <target name="archive">
 <apply failonerror="true" executable="ar" parallel="true">
 <fileset dir="obj/namespace1" includes="**/*.o"/>
 <arg line="-cr arc/namespace1.a"/>
 </apply>
 <apply failonerror="true" executable="ar" parallel="true">
 <fileset dir="obj/namespace2" includes="**/*.o"/>
 <arg line="-cr arc/namespace2.a"/>
 </apply>
 </target>
 <target name="link">
 <apply failonerror="true" executable="gcj" parallel="true">
 <fileset dir="arc/" includes="*.a"/>
 <arg value="--main=myMain"/>
 <arg line="-o exe/myexe"/>
 <srcfile/>
 </apply>
 </target>


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /