Description
Embedded processors support a variety of CPU configurations that are not all binary compatible. If a developer needs to provide native binaries for one or more of these configurations, they need a way of querying the platform constraints in order to load the appropriate JNI shared library.
Here's a specific example of this issue:
There are three predominate binaries that we support Java for Linux ARM platforms on.
1. Full soft-floatABI (No floating point instructions)
2. VFP with softfp ABI (floating arguments are not passed in floating point registers)
3. VFP with hard float ABI (floating pointer arguments passes in registers)
The first two (1,2) options are binary compatible at the ABI level. The only difference is the use of VFP instructions and if you are running on a processor that can execute them.
The third option is a new ABI and is incompatible with the older ABIs unless you are running on a system that supports multi-arch.
Developers are requesting a way to identify which ABI Java is currently using in order to select a compatible native library when using JNI.
Solution
I propose adding a new JDK specific System property that can be used to provide ABI specific information beyond the basic os.arch values for ARM as well as other processor architectures. This property will be optional.
sun.arch.abi
------------------
This property, if set, will contain the industry standard toolchain ABI substring that defines the ABI that the current running Java process is using for its native binaries.
Here are some ARM specific examples:
gnueabi GNU softfp EABI
gnueabihf GNU hard float EABI
androideabi Android EABI
This sun.arch.abi property, if available, will also be added to the "release" file located in the top level JRE directory as SUN_ARCH_ABI.
In addition to the addition of sun.arch.abi, I'd like to see our Linux support for all platforms modified to set the already existing property sun.cpu.isalist to the cpu features found in /proc/cpuinfo. This will allow developers to understand more specifics about the CPU their application is running on. This property is currently NULL for all Linux platforms.
Here's a specific example of this issue:
There are three predominate binaries that we support Java for Linux ARM platforms on.
1. Full soft-floatABI (No floating point instructions)
2. VFP with softfp ABI (floating arguments are not passed in floating point registers)
3. VFP with hard float ABI (floating pointer arguments passes in registers)
The first two (1,2) options are binary compatible at the ABI level. The only difference is the use of VFP instructions and if you are running on a processor that can execute them.
The third option is a new ABI and is incompatible with the older ABIs unless you are running on a system that supports multi-arch.
Developers are requesting a way to identify which ABI Java is currently using in order to select a compatible native library when using JNI.
Solution
I propose adding a new JDK specific System property that can be used to provide ABI specific information beyond the basic os.arch values for ARM as well as other processor architectures. This property will be optional.
sun.arch.abi
------------------
This property, if set, will contain the industry standard toolchain ABI substring that defines the ABI that the current running Java process is using for its native binaries.
Here are some ARM specific examples:
gnueabi GNU softfp EABI
gnueabihf GNU hard float EABI
androideabi Android EABI
This sun.arch.abi property, if available, will also be added to the "release" file located in the top level JRE directory as SUN_ARCH_ABI.
In addition to the addition of sun.arch.abi, I'd like to see our Linux support for all platforms modified to set the already existing property sun.cpu.isalist to the cpu features found in /proc/cpuinfo. This will allow developers to understand more specifics about the CPU their application is running on. This property is currently NULL for all Linux platforms.
Attachments
Issue Links
- relates to
-
JDK-8178318 SUN_ARCH_ABI property not set or in release file for aarch32 builds
- Closed