When making in subdirectory lib, Sun's original javac (version 1.6.0_02)
runs out of java heap memory when compiling "@classes".
Passing the option "-J-Xmx256m" (increasing the heap limit to 256 MB)
solves the problem.
The makefile should automatically pass this option to javac.
Actually this sounds like a bug in Sun's javac rather than classpath.
I thought we had come across and solved this problem already?
The build will support passing options to javac:
2007-06-25 Dalibor Topic <firstname.lastname@example.org>
* m4/acinclude.m4 (CLASSPATH_CHECK_JAVAC): If the user passes an
explicit argument to configure, just use it, and don't attempt to
run AC_CHECK_PROG. This makes --with-javac="javac -J-Xmx512M" work.
Most likely more users will come across this problem, and nobody will search the Changelog for the solution.
Could this be documented in a prominent place (like INSTALL)?
I think we should pass that option to javac, rather than frustrate users.
I think passing 512M would mean we'd be on the safe side of x86_64 heap explosion as well.
Agreed. I actually thought that's what your original patch had done until I saw this bug. I ran into the same problem with ecj when we first ran it on the generics branch, but because people write scripts for this anyway or use the native version, we don't see this problem.
Created attachment 14348 [details]
Patch committed to Classpath
Can you confirm this now builds for you?
Subject: Bug 33622
Module name: classpath
Changes by: Andrew John Hughes <gnu_andrew> 07/10/12 21:37:44
. : ChangeLog
lib : Makefile.am
m4 : acinclude.m4
2007-10-12 Andrew John Hughes <email@example.com>
* lib/Makefile.am: Use JAVAC_ARGS variable.
* m4/acinclude.m4: Check javac is 1.5 compliant
and whether it supports -J.
Works for me with classpath-latest dated 20071015:
javac is called with the correct option.
However, I noticed that JAVAC_OPTS is only used in lib/Makefile,
not in examples/Makefile and tools/Makefile.
Should javac be called with JAVAC_OPTS in all places?
I didn't add it there because the larger heap isn't needed, but it doesn't do any harm (it's a maximum not an allocation request) so I'll add it there for consistency. It also means tools and examples will be in line with lib should JAVAC_OPTS be used for something else.
We've rejigged things again recently, and so there is now the option of setting the environment variable JAVACFLAGS to add further options in addition to the memory option which is still only present in lib. I think this is the best solution for the time being, so closing this bug.