Build failed with core variant in x86
Dingli Zhang
dingli at iscas.ac.cn
Fri Aug 12 09:59:41 UTC 2022
Hi, I found a small problem when I built openjdk8u x86 with core variant.
Repo: https://github.com/openjdk/jdk8u.git
commit id: a18e9043fa2a0a14098e1ec25d32577aaac6c023 (tag: jdk8u342-b06)
Build commands:
```
$ bash configure \
--with-boot-jdk=/home/dingli/java-se-8u42-ri \
--with-jvm-variants=core \
--with-debug-level=release \
--with-native-debug-symbols=none \
--with-extra-cflags="-Wno-error”
$ make JOBS=$(proc)
```
The configure command executes correctly, but the make command gives the following error:
```
## Starting hotspot
make[2]: warning: -j1 forced in submake: resetting jobserver mode.
INFO: ENABLE_FULL_DEBUG_SYMBOLS=0
No (productcore) for x86
INFO: ENABLE_FULL_DEBUG_SYMBOLS=0
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Generating linux_amd64_docs/jvmti.html
INFO: ENABLE_FULL_DEBUG_SYMBOLS=0
make[3]: *** No rule to make target '/home/dingli/jdk8u/build/linux-x86_64-normal-core-release/hotspot/dist/jre/lib/amd64/libjsig.so', needed by 'generic_export'. Stop.
make[2]: *** [Makefile:296: export_product] Error 2
make[1]: *** [HotspotWrapper.gmk:45: /home/dingli/jdk8u/build/linux-x86_64-normal-core-release/hotspot/_hotspot.timestamp] Error 2
make: *** [/home/dingli/jdk8u//make/Main.gmk:110: hotspot-only] Error 2
```
I think the problem is in `/home/dingli/jdk8u/hotspot/make/Makefile:245-257`:
```
generic_buildcore: $(HOTSPOT_SCRIPT)
ifeq ($(HS_ARCH),ppc)
ifeq ($(ARCH_DATA_MODEL),64)
$(MKDIR) -p $(OUTPUTDIR)
$(CD) $(OUTPUTDIR); \
$(MAKE) -f $(ABS_OS_MAKEFILE) \
$(MAKE_ARGS) $(VM_TARGET)
else
@$(ECHO) "No ($(VM_TARGET)) for ppc ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
endif
else
@$(ECHO) "No ($(VM_TARGET)) for $(HS_ARCH)"
endif
```
The rule `generic_buildcore ` only allow ppc64 to build core variant.
I added a new conditional judgment: https://github.com/DingliZhang/jdk8u/commit/e2f9ebeba6e779fc2a06fae723d7318977097977
```
diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile
index ad195763be..168f17524d 100644
--- a/hotspot/make/Makefile
+++ b/hotspot/make/Makefile
@@ -252,6 +252,11 @@ ifeq ($(HS_ARCH),ppc)
else
@$(ECHO) "No ($(VM_TARGET)) for ppc ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
endif
+else ifeq ($(HS_ARCH),x86)
+ $(MKDIR) -p $(OUTPUTDIR)
+ $(CD) $(OUTPUTDIR); \
+ $(MAKE) -f $(ABS_OS_MAKEFILE) \
+ $(MAKE_ARGS) $(VM_TARGET)
else
@$(ECHO) "No ($(VM_TARGET)) for $(HS_ARCH)"
endif
```
It works:
```
$ build/linux-x86_64-normal-core-release/jdk/bin/java -version
openjdk version "1.8.0_342-internal"
OpenJDK Runtime Environment (build 1.8.0_342-internal-dingli_2022_08_12_17_41-b00)
OpenJDK 64-Bit VM (build 25.342-b00, interpreted mode)
```
By the way, I also tried it on aarch64 and it produces the same errors as x86 before submitting a similar patch, but there are also new errors after fixing the generic_buildcore rule (new errors can be fixed like https://gitee.com/openeuler/bishengjdk-11/commit/085a5bc8cf66d1606e40d51bb6580ed24d99eccc ), and the latest ones are currently as follows:
```
/home/parallels/jdk8u/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp: In member function ‘void StubGenerator::generate_all()’:
/home/parallels/jdk8u/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp:4381:9: error: ‘UseMultiplyToLenIntrinsic’ was not declared in this scope
4381 | if (UseMultiplyToLenIntrinsic) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/parallels/jdk8u/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp:4385:9: error: ‘UseMontgomeryMultiplyIntrinsic’ was not declared in this scope
4385 | if (UseMontgomeryMultiplyIntrinsic) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling /home/parallels/jdk8u/hotspot/src/share/vm/code/stubs.cpp
Compiling /home/parallels/jdk8u/hotspot/src/share/vm/gc_implementation/g1/survRateGroup.cpp
/home/parallels/jdk8u/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp:4391:9: error: ‘UseMontgomerySquareIntrinsic’ was not declared in this scope
4391 | if (UseMontgomerySquareIntrinsic) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling /home/parallels/jdk8u/hotspot/src/share/vm/gc_implementation/shared/suspendibleThreadSet.cpp
make[6]: *** [/home/parallels/jdk8u/hotspot/make/linux/makefiles/rules.make:151: stubGenerator_aarch64.o] Error 1
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [/home/parallels/jdk8u/hotspot/make/linux/makefiles/top.make:120: the_vm] Error 2
make[4]: *** [/home/parallels/jdk8u/hotspot/make/linux/Makefile:302: productcore] Error 2
make[3]: *** [Makefile:249: generic_buildcore] Error 2
make[2]: *** [Makefile:181: productcore] Error 2
make[1]: *** [HotspotWrapper.gmk:45: /home/parallels/jdk8u/build/linux-aarch64-normal-core-release/hotspot/_hotspot.timestamp] Error 2
make: *** [/home/parallels/jdk8u//make/Main.gmk:110: hotspot-only] Error 2
```
I think we can fix the problem in x86 first.
Best regards,
Dingli
More information about the jdk8u-dev
mailing list