-
Enhancement
-
Resolution: Fixed
-
P4
-
8, 9
-
b112
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8257479 | openjdk8u282 | Simon Tooke | P4 | Resolved | Fixed | b04 |
In the gensrc step for java.base, we generate a couple of java classes with the purpose of extracting native constants from the system. We currently do this by compiling a C program that when run, generates the java source file. The problem with this approach is that when cross compiling, we can't do it, so we have to provide pregenerated versions of the java source files for each cross compiled platform.
I would like to fix this by changing the method to instead just run the C preprocessor to extract the constants into java source files. This works fine for most of the constants. There are however 3 that, at least on Linux, are defined as an enum and not a constant, which makes them unavailable to the preprocessor. These are:
IPPROTO_TCP = 6
IPPROTO_IP = 0
IPPROTO_PV6 = 41
I would say that this is fine. They have the same value on all our supported platforms and are actually part of the IP spec. I cannot imagine a reason for ever defining them differently. So the solution is to simply define these as constants in the java source.
By fixing this, cross compiling new or existing platforms becomes much easier.
I would like to fix this by changing the method to instead just run the C preprocessor to extract the constants into java source files. This works fine for most of the constants. There are however 3 that, at least on Linux, are defined as an enum and not a constant, which makes them unavailable to the preprocessor. These are:
IPPROTO_TCP = 6
IPPROTO_IP = 0
IPPROTO_PV6 = 41
I would say that this is fine. They have the same value on all our supported platforms and are actually part of the IP spec. I cannot imagine a reason for ever defining them differently. So the solution is to simply define these as constants in the java source.
By fixing this, cross compiling new or existing platforms becomes much easier.
- backported by
-
JDK-8257479 Use preprocessor instead of compiling a program to generate native nio constants
- Resolved
- blocks
-
JDK-8151973 Add Jib and JPRT configuration for linux-arm64 open only
- Closed
- relates to
-
JDK-8072664 BUILD_LD is set incorrectly when cross compiling on linux
- Resolved
-
JDK-8150529 aarch32: use gcc instead of ld to link genSocketOptionRegistry
- Resolved
- links to