This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: gcj problem compiling 850 files


>>>> 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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]