I've found the problem. In JvmFeatures.gmk we have:

ifeq ($(call check-jvm-feature, zero), true)
  JVM_CFLAGS_FEATURES += -DZERO -DCC_INTERP -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
  JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    BUILD_LIBJVM_EXTRA_FILES := $(TOPDIR)/src/hotspot/cpu/sparc/memset_with_concurrent_readers_sparc.cpp
  endif
endif

The BUILD_LIBJVM_EXTRA_FILES is implicitly trying to set the EXTRA_FILES argument to the BUILD_LIBJVM SetupNativeCompilation call. This used to work because there was no setting of that parameter in the actual call. In a recent change, that parameter is not set to something else, overriding the assignment above.

To fix this, you need to add $(BUILD_LIBJVM_EXTRA_FILES) to the EXTRA_FILES line in CompileJvm.gmk.

/Erik


On 2018-04-10 04:58, John Paul Adrian Glaubitz wrote:
On 04/10/2018 01:37 PM, John Paul Adrian Glaubitz wrote:
@buildd-dev:

I need to build memset_with_concurrent_readers_sparc.cpp for Zero on SPARC as
the Zero build now bails out with linker errors:
Add the source file in question to EXTRA_FILES:

glaubitz@deb4g:/srv/glaubitz/hs$ hg diff
diff -r b3c09ab95c1a make/hotspot/lib/CompileGtest.gmk
--- a/make/hotspot/lib/CompileGtest.gmk Tue Apr 10 12:21:58 2018 +0200
+++ b/make/hotspot/lib/CompileGtest.gmk Tue Apr 10 14:57:05 2018 +0300
@@ -71,7 +71,8 @@
     EXCLUDES := $(JVM_EXCLUDES), \
     EXCLUDE_FILES := gtestLauncher.cpp, \
     EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
-    EXTRA_FILES := $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc, \
+    EXTRA_FILES := $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc \
+ $(TOPDIR)/src/hotspot/cpu/sparc/memset_with_concurrent_readers_sparc.cpp, \
     EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
         $(BUILD_LIBJVM_ALL_OBJS)), \
     CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
@@ -109,7 +110,8 @@
     NAME := gtestLauncher, \
     TYPE := EXECUTABLE, \
     OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
-    EXTRA_FILES := $(GTEST_LAUNCHER_SRC), \
+    EXTRA_FILES := $(GTEST_LAUNCHER_SRC) \
+ $(TOPDIR)/src/hotspot/cpu/sparc/memset_with_concurrent_readers_sparc.cpp, \
     OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
     CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
         -I$(GTEST_FRAMEWORK_SRC)/include, \
glaubitz@deb4g:/srv/glaubitz/hs$

Causes the object files to be built. But for some reason, the linker is not
picking up those object files even though they are located in the object
directories of gtest:

glaubitz@deb4g:/srv/glaubitz/hs$ find . -name "memset_with_concurrent_readers_sparc.o" ./build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/gtest/objs/memset_with_concurrent_readers_sparc.o ./build/linux-sparcv9-normal-zero-release/hotspot/variant-zero/libjvm/gtest/launcher-objs/memset_with_concurrent_readers_sparc.o
glaubitz@deb4g:/srv/glaubitz/hs$

Adrian


Reply via email to