Hello John,

If the cpp file is compiled for libjvm.so, the object file should automatically end up on the link command line. I found your build log in the original email. The link command line is:

/usr/bin/sparc64-linux-gnu-g++-6 -Wl,-z,defs -Wl,-z,noexecstack -Wl,-O1 -Wl,-z,relro -shared -Xlinker -z -Xli nker relro -Xlinker -Bsymbolic-functions -Wl,-version-script=/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/l ibjvm/mapfile -Wl,-soname=libjvm.so -o /<<PKGBUILDDIR>>/build-zero/support/modules_libs/java.base/server/libjvm .so @/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/objs/_BUILD_LIBJVM_objectfilenames.txt -lm -ldl -l
pthread -lffi_pic

Can you check the contents of this file to verify that the object file in question is actually missing:

/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/objs/_BUILD_LIBJVM_objectfilenames.txt

/Erik

On 2017-06-07 11:29, Severin Gehwolf wrote:
Hi,

On Wed, 2017-06-07 at 02:10 +0200, John Paul Adrian Glaubitz wrote:
Hi!

I'm still working on fixing OpenJDK-9 on Linux/sparc64 and I'm currently
running into something which should be a trivial Makefile issue which
is a linker problem (see for the paste below, full log in [1]).

Now, the problem obviously happens on SPARC only because it has its own
custom implementation of the memset_with_concurrent_readers() function
in ./src/cpu/sparc/vm/memset_with_concurrent_readers_sparc.cpp, the
other platforms use ./src/share/vm/gc/shared/memset_with_concurrent_readers.hpp.

 From the full build log, it's obvious that 
memset_with_concurrent_readers_sparc.cpp
is being compiled earlier, but it's apparently missing on the linker command
line later.

I have been trying to understand the hand-written Makefiles but I can't
seem to find the place which I need to patch.

Does anyone who is more familiar with the build system have an idea
where to look?
This is likely a question for build-dev (CC). They might have some
pointers.

Thanks,
Severin

Thanks,
Adrian

[1] http://people.debian.org/~glaubitz/openjdk-9_9~b170-2_sparc64.build.gz
=== 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 ===
if /bin/grep -q "recipe for target .* failed" /<<PKGBUILDDIR>>/build-zero/build.log 
2> /dev/null; then /usr/bin/printf "\n=== Make failed targets repeated here
===\n" ; /bin/grep "recipe for target .* failed" /<<PKGBUILDDIR>>/build-zero/build.log ; 
/usr/bin/printf "=== End of repeated output ===\n" ; /usr/bin/printf
"\nHint: Try searching the build log for the name of the first failed target.\n" ; else 
/usr/bin/printf "\nNo indication of failed target found.\n" ;
/usr/bin/printf "Hint: Try searching the build log for '] Error'.\n" ; fi

=== Make failed targets repeated here ===
lib/CompileJvm.gmk:212: recipe for target 
'/<<PKGBUILDDIR>>/build-zero/support/modules_libs/java.base/server/libjvm.so' 
failed
lib/CompileGtest.gmk:64: recipe for target 
'/<<PKGBUILDDIR>>/build-zero/hotspot/variant-zero/libjvm/gtest/libjvm.so' failed
make/Main.gmk:263: recipe for target 'hotspot-zero-libs' failed
=== End of repeated output ===


Reply via email to