[jdk8u-dev] RFR: 8296959: Fix hotspot shell tests of 8u on multilib systems
zzambers
duke at openjdk.org
Tue Nov 15 13:00:16 UTC 2022
On Tue, 15 Nov 2022 08:56:42 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Few hotspot tests (from hotspot/tier1) currently fail for x86 (32-bit) builds on 64-bit system (Linux).
>>
>> compiler/criticalnatives/argumentcorruption/Test8167409.sh
>> runtime/jni/CallWithJNIWeak/test.sh
>> runtime/jni/ReturnJNIWeak/test.sh
>>
>> **Problem:**
>> Tests build 64-bit JNI libraries and trying to use them for 32-bit jdk, resulting in error:
>>
>> Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/runner/work/jdk8u-dev/jdk8u-dev/test-results/testoutput/hotspot_tier1/JTwork/scratch/libCNCheckLongArgs.so: /home/runner/work/jdk8u-dev/jdk8u-dev/test-results/testoutput/hotspot_tier1/JTwork/scratch/libCNCheckLongArgs.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
>>
>> These tests only target Linux and (some) Solaris.
>>
>> **Solution:**
>> Fixed by supplying appropriate compiler argument (-m32) to build 32-bit libraries for 32-bit JDK. (Some tests already did that, but not in uniform way). I verified in manpage of gcc that -m32 argument is supported for all 32-bit variants of architectures supported by JDK 8 [1]. Solaris cc also seems to support -m32 [2].
>> This fix is JDK 8 only as newer JDK use new approach, where JNI test libraries are build are build system and tests not longer build them themselfs.
>>
>> **Testing:**
>> Change fixed these tests on linux-x86. (tested here [3])
>> Tests are part of hotspot/tier1. This is one of problems, which needs to be fixed, so that hotspot/tier1 can be enabled in GHA on linux-x86. Other one is JDK-8295952 [4] (will need to get fixed and backported).
>>
>> [1] https://man7.org/linux/man-pages/man1/gcc.1.html
>> [2] https://docs.oracle.com/cd/E37069_01/html/E54439/cc-1.html
>> [3] https://github.com/zzambers/jdk8u-dev/actions/runs/3441392968
>> [4] https://bugs.openjdk.org/browse/JDK-8295952
>
> Seems OK to me.
@jerboaa thank you for review
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/173
More information about the jdk8u-dev
mailing list