Using hard links for debug builds

Ioi Lam ioi.lam at oracle.com
Mon Jan 9 20:40:50 UTC 2017


Hi,

libjvm.so gets copied a few times during the build. I usually build 
slowdebug builds with --with-native-debug-symbols=internal (to make it 
easier with gdb). This gives me 8 libjvm.so files:

./support/interim-image/lib/server/libjvm.so
./support/modules_libs/java.base/server/libjvm.so
./hotspot/variant-server/libjvm/gtest/libjvm.so
./images/test/hotspot/gtest/server/libjvm.so
./images/serverjre/lib/server/libjvm.so
./images/jdk/lib/server/libjvm.so
./images/jre/lib/server/libjvm.so
./jdk/lib/server/libjvm.so

Each of them is 320+MB. Even though I have a fast SSD, it's overwhelmed 
by the large churn and my machine becomes unresponsive for a long time.

The 8 libjvm.so files have 2 variants -- the gtest version (2 of them) 
vs the normal version (6 of them). Would it make sense to change the 
'cp' to hard links instead?

For now, I am doing a hack by patching this in the generated spec.gmk file:

     CP:=/bin/cp

to point to my script, which uses 'ln' instead of /bin/cp when dealing 
with libjvm.so ....

BTW, what's the use for the 'gtest' versions of libjvm.so?

Thanks
- Ioi



More information about the build-dev mailing list