Description
Trying to build Zero on linux-sparc currently fails with:
=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:\n"
* For target hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:
(/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log || true) | /usr/bin/head -n 12
/home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/init.o: In function `init_globals()':
/home/glaubitz/openjdk/hs/src/hotspot/share/runtime/init.cpp:120: undefined reference to `g1_barrier_stubs_init()'
collect2: error: ld returned 1 exit status
if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
/usr/bin/printf "* For target hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link:\n"
* For target hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link:
(/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log || true) | /usr/bin/head -n 12
/home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/init.o: In function `init_globals()':
/home/glaubitz/openjdk/hs/src/hotspot/share/runtime/init.cpp:120: undefined reference to `g1_barrier_stubs_init()'
collect2: error: ld returned 1 exit status
if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
/usr/bin/printf "\n* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.\n"
* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"
=== End of repeated output ===
This happens because of this snippet of code in src/hotspot/share/runtime/init.cpp:
#if INCLUDE_ALL_GCS
// depends on universe_init, must be before interpreter_init (currently only on SPARC)
void g1_barrier_stubs_init() NOT_SPARC({});
#endif
A possible fix is:
diff -r 71ad0eec75e8 src/hotspot/share/runtime/init.cpp
--- a/src/hotspot/share/runtime/init.cpp Thu Sep 28 14:55:45 2017 +0200
+++ b/src/hotspot/share/runtime/init.cpp Thu Nov 02 21:59:10 2017 +0300
@@ -60,7 +60,11 @@
jint universe_init(); // depends on codeCache_init and stubRoutines_init
#if INCLUDE_ALL_GCS
// depends on universe_init, must be before interpreter_init (currently only on SPARC)
+#ifndef ZERO
void g1_barrier_stubs_init() NOT_SPARC({});
+#else
+void g1_barrier_stubs_init() {};
+#endif
#endif
void interpreter_init(); // before any methods loaded
void invocationCounter_init(); // before any methods loaded
=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:\n"
* For target hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link:
(/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log || true) | /usr/bin/head -n 12
/home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/init.o: In function `init_globals()':
/home/glaubitz/openjdk/hs/src/hotspot/share/runtime/init.cpp:120: undefined reference to `g1_barrier_stubs_init()'
collect2: error: ld returned 1 exit status
if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
/usr/bin/printf "* For target hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link:\n"
* For target hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link:
(/bin/grep -v -e "^Note: including file:" < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log || true) | /usr/bin/head -n 12
/home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/objs/init.o: In function `init_globals()':
/home/glaubitz/openjdk/hs/src/hotspot/share/runtime/init.cpp:120: undefined reference to `g1_barrier_stubs_init()'
collect2: error: ld returned 1 exit status
if test `/usr/bin/wc -l < /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log` -gt 12; then /bin/echo " ... (rest of output omitted)" ; fi
/usr/bin/printf "\n* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.\n"
* All command lines available in /home/glaubitz/openjdk/hs/build/linux-sparcv9-normal-zero-release/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"
=== End of repeated output ===
This happens because of this snippet of code in src/hotspot/share/runtime/init.cpp:
#if INCLUDE_ALL_GCS
// depends on universe_init, must be before interpreter_init (currently only on SPARC)
void g1_barrier_stubs_init() NOT_SPARC({});
#endif
A possible fix is:
diff -r 71ad0eec75e8 src/hotspot/share/runtime/init.cpp
--- a/src/hotspot/share/runtime/init.cpp Thu Sep 28 14:55:45 2017 +0200
+++ b/src/hotspot/share/runtime/init.cpp Thu Nov 02 21:59:10 2017 +0300
@@ -60,7 +60,11 @@
jint universe_init(); // depends on codeCache_init and stubRoutines_init
#if INCLUDE_ALL_GCS
// depends on universe_init, must be before interpreter_init (currently only on SPARC)
+#ifndef ZERO
void g1_barrier_stubs_init() NOT_SPARC({});
+#else
+void g1_barrier_stubs_init() {};
+#endif
#endif
void interpreter_init(); // before any methods loaded
void invocationCounter_init(); // before any methods loaded