review request for 6717128
Xiaobin Lu
Xiaobin.Lu at Sun.COM
Fri Jun 20 11:08:16 PDT 2008
Webrev: http://javaweb.sfbay/~xl116366/webrev/6717128/
6717128: Using relative path for ALT_OUTPUTDIR does not work properly
Details:
The problem I saw when I use a relative path for ALT_OUTPUTDIR is that
there is a redundant directory gets created. For example, if I set
"ALT_OUTPUTDIR=../../vm_output" and launch the build from the top level
make directory, I will see a vm_output directory got created 3 levels
beyond the current directory (besides the actually output dir which is 2
levels beyond the current dir) and that is unexpected and annoying.
And here is the root cause, on both Solaris & Linux, when building
hotspot from the top level make directory, the Makefile there will
launch a sub make process and use the OS specify Makefile to complete
the build. For example, on Linux, the top level Makefile will launch
"make -f make/linux/Makefile $(MAKE_ARGS)" at some point. The OS
specific Makefile imports "make/defs.make" which contains a bunch of
variable definitions for further references. The problem is in
defs.make, it will re-evlaute ABS_OUTPUTDIR and since OUTPUTDIR is a
relative path, it will make another directory which is 2 levels beyond
the current directory which is the real output directory. That is
exactly why I saw that extra directory got created. To fix this, we just
need to export the already computed ABS_OUTPUTDIR as a absolute path in
MAKE_ARGS variable so that even ABS_OUTPUTDIR is re-evaluated, the
OUTPUTDIR is already an absolute path.
Along the above fix, I am also trying to fix the incremental build
failure due to my recent put back. It relates the way we define GAMMADIR
in defs.make which either gets from the make command line or gets
figured out by traversing the directory until it can locate the src
directory. In the incremental build case, unlike the normal build, we
don't pass GAMMADIR=$(ABS_GAMMADIR) to the sub make process so any
places which includes defs.make will expand the GAMMADIR definition and
eventually get the wrong answer if it can't locate the src directory
which will likely happen when building remotely. The fix is to instead
of importing the whole defs.make in rules.make, just include the part as
a separate file and the upside of doing that is it could avoid
unnecessary redefinitions and re-evaluations of variables in defs.make.
Verified by:
Remote incremental build and normal build on Solaris & Linux.
Thanks,
-Xiaobin
More information about the hotspot-dev
mailing list