eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

static library linking failing : j9codert_vm #20118

Open Afzal-ibm opened 1 week ago

Afzal-ibm commented 1 week ago

Hello, I am trying to build Java 17 on AIX 7.3 system and I am facing this error when building.

/home/aa/build/7.5/jv1_java17_buildv7r5_08262343/openj9-openjdk-jdk17/build/aix-ppc64-server-release/vm/runtime/codert_vm/pnathelp.s: line 38610: Instruction stxvd2x is not implemented in the current assembly mode PPC64.
/home/aa/build/7.5/jv1_java17_buildv7r5_08262343/openj9-openjdk-jdk17/build/aix-ppc64-server-release/vm/runtime/codert_vm/pnathelp.s: line 38612: Instruction stxvd2x is not implemented in the current assembly mode PPC64.
/home/aa/build/7.5/jv1_java17_buildv7r5_08262343/openj9-openjdk-jdk17/build/aix-ppc64-server-rel[ 21%] Linking C
ERROR: Build faXX static librariled for target y ../lib/libj9co'all' in configudert_vm.a
ration 'aix-ppc6[ 21%] Built tar4-server-releaseget j9codert_vm
' (exit code 2)
ease/vm/runtime/codert_vm/pnathelp.s: line 38614: Instruction stxvd2x is not implemented in the current assembly mode PPC64.

I am looking for suggestions.

Afzal-ibm commented 1 week ago

machine details :

AIX ut202p33 3 7 0002CF8A7A00
Afzal-ibm commented 1 week ago

additional details if needed

System Model: IBM,8247-22L
Machine Serial Number: 212CF8A
Processor Type: PowerPC_POWER8
Processor Implementation Mode: POWER 8
Processor Version: PV_8_Compat
Number Of Processors: 2
Processor Clock Speed: 3026 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: 33 ut202p33
Memory Size: 16384 MB
Good Memory Size: 16384 MB
Platform Firmware level: SV860_212
Firmware Version: IBM,FW860.80 (SV860_212)
Console Login: enable
Auto Restart: true
Full Core: true
NX Crypto Acceleration: Capable and Enabled
In-Core Crypto Acceleration: Capable, but not Enabled
pshipton commented 1 week ago

@zl-wang any ideas about this?

zl-wang commented 1 week ago

yeah, that means: pnathelp.s file contains instructions only available after/at a certain level of ISA (later than the default level assembler uses. neither the makefile nor the file itself provides option or pseudo op to indicate the necessary level of ISA needed) such that those instructions were complained as "not implemented". it can be fixed by either assembler option or set in with appropriate pseudo op, like below:

.machine "pwr7" (indicating ISA level of POWER7)

zl-wang commented 1 week ago

of course, once you put in the option or pseudo code, that build should be run on machines at least with that level of ISA (otherwise, it likely results in SIGILL).

Afzal-ibm commented 5 days ago

HI @zl-wang how do i set .machine "pwr7" ? in the build script or as a parameter to something ? Please answer.

zl-wang commented 5 days ago

the easiest way to move forward is to modify the AIX makefile: runtime/compiler/build/toolcfg/aix-xlc/common.mk replace -mppc64 with -mpwr7

@pshipton i haven't looked into overnight build how this is circumvented (maybe some macro is not defined in overnight build and vector reg save/restore is not included).

Afzal-ibm commented 4 days ago

Hi Julian, after adding the changes in common.mk file, I am facing this error

[ 21%] Building C object runtime/util/CMakeFiles/j9util.dir/aix/sethwprefetch.c.o
[ 21%] Linking CXX static library ../lib/libj9util.a
[ 21%] Built target j9util
make[4]: *** [all] Error 2
make[3]: *** [build-j9] Error 2
make[2]: *** [j9vm-build] Error 2

ERROR: Build failed for target 'all' in configuration 'aix-ppc64-server-release' (exit code 2)

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

make[1]: *** [main] Error 2
make: *** [all] Error 2
make all failed.
Afzal-ibm commented 4 days ago

This is the change that I have added in common.mk

ifeq ($(HOST_BITS),32)
    S_FLAGS+=-mppc
endif

ifeq ($(HOST_BITS),64)
    S_FLAGS+=-mpwr7 -a64
endif
zl-wang commented 4 days ago

you have to scroll up to see what the real error was. the change for assembler option looked ok.