Subject: Current status of OpenJDK-9 on sparc64



Hi!

I have been working on OpenJDK-9 on sparc64 the past days and managed
to fix some bugs. While the build gets quite far, it's still currently
failing with a linker error:

=== 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:" <
/<<PKGBUILDDIR>>/build-zero/make-support/failure-logs/hotspot_variant-zero_libjvm_gtest_objs_BUILD_GTEST_LIBJVM_link.log
|| true) | /usr/bin/head -n 12
/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/gtest/objs/test_memset_with_concurrent_readers.o:
In function `gc_memset_with_concurrent_readers_test_Test::TestBody()':
./src/hotspot/make/./src/hotspot/test/native/gc/shared/test_memset_with_concurrent_readers.cpp:66:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o:
In function `BlockOffsetSharedArray::fill_range(unsigned long,
unsigned long, unsigned char)':
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o:./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
more undefined references to `memset_with_concurrent_readers(void*,
int, unsigned long)' follow
collect2: error: ld returned 1 exit status
if test `/usr/bin/wc -l <
/<<PKGBUILDDIR>>/build-zero/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:" <
/<<PKGBUILDDIR>>/build-zero/make-support/failure-logs/hotspot_variant-zero_libjvm_objs_BUILD_LIBJVM_link.log
|| true) | /usr/bin/head -n 12
/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o:
In function `BlockOffsetSharedArray::fill_range(unsigned long,
unsigned long, unsigned char)':
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
undefined reference to `memset_with_concurrent_readers(void*, int,
unsigned long)'
/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/objs/blockOffsetTable.o:./src/hotspot/make/./src/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp:159:
more undefined references to `memset_with_concurrent_readers(void*,
int, unsigned long)' follow
collect2: error: ld returned 1 exit status
if test `/usr/bin/wc -l <
/<<PKGBUILDDIR>>/build-zero/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
/<<PKGBUILDDIR>>/build-zero/make-support/failure-logs.\n"

* All command lines available in
/<<PKGBUILDDIR>>/build-zero/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"
=== End of repeated output ===

To get there, I needed to fix the sparc-linux code in several places,
I'm attaching all my current patches to this bug report.

The above linker error comes from the fact that on SPARC, OpenJDK-9
uses its own implementation of "memset_with_concurrent_readers()"
which resides in memset_with_concurrent_readers_sparc.cpp. Although
the latter source file gets compiled, the linker cannot find it in the
later steps. I tried patching the makefiles myself, but the whole
hand-written set of makefiles is rather obscure and I can't seem to
find the right place to patch.

If anyone has any idea, please let me know. I have already asked on
the hotspot-dev mailing list at Oracle, but for some reasons which are
beyond human reasoning, Oracle does not support OpenJDK on their own
hardware, so any support requests remain unanswered or get dismissed.

Cheers,
Adrian

> [1] https://people.debian.org/~glaubitz/openjdk-9_9~b170-2_sparc64.build.gz

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - glaubitz@xxxxxxxxxx
`. `' Freie Universitaet Berlin - glaubitz@xxxxxxxxxxxxxxxxxxx
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

Attachment: hotspot-fix-checkbytebuffer.diff
Description: Text Data

Attachment: rename-sparc-linux-atomic-header.diff
Description: Text Data

Attachment: sparc64-fix-include-path.diff
Description: Text Data

Attachment: sparc64-remove-include.diff
Description: Text Data



Programming list archiving by: Enterprise Git Hosting