On Thu, 6 Apr 2023 20:39:41 GMT, Roger Riggs <rri...@openjdk.org> wrote:

> > What about PPC (big endian)? Used on AIX?
> 
> I'm not aware of any code (in OpenJDK) related to big/little endian that is 
> derived from `os.arch`.
> 
> > On Arm, it may be useful to know whether we built for thumb mode (We 
> > recently had this problem in tests).
> 
> For tests, there is the test library `jdk.test.lib.Platform` class with its 
> own set of predicates.
> 
> For the moment, the idea is to do the minimum to replace OpenJDK internal 
> uses of `os.arch`.

What I meant was: You define PPCLE. PPCLE specifies ppc, little endian. We also 
have PPC big-endian, it is used by AIX (and you can also run Linux with PPC 
big-endian). Why omit that?

os.arch for AIX is "ppc64". It is even used in our codebase, see 
https://github.com/openjdk/jdk/blob/c67bbcea92919fea9b6f7bbcde8ba4488289d174/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java#L51

> > Another question, how does this work with Zero?
> 
> Zero is orthogonal to architecture; the interpreter is compiled for a 
> specific target architecture.

Sorry, I was not clear. Zero is the vehicle to get the OpenJDK to build and run 
on hardware we don't directly support. It is not only used in bootstrapping but 
finds surprisingly broad use, e.g., for Debian wich itself supports a wide 
range of platforms and tries to provide java on all of them. 

For these JDKs, IIUC, os.arch would have the value of the target architecture 
("PA-RISC", "mips", "alpha" etc). These platforms would be at a disadvantage 
now, as @Glavo pointed out: since OPENJDK_TARGET_CPU is fed from uname: 
https://github.com/openjdk/jdk/blob/c67bbcea92919fea9b6f7bbcde8ba4488289d174/make/RunTestsPrebuilt.gmk#L182,
 they will have a name that expands to an enum that is not compilable. So all 
of these platforms will get build errors.

I understand your intention to keep this patch simple, and that you want to 
limit the enum value. I also like enums. I wonder whether it would be possible 
to have an enum value "other" and map unknown architectures to that.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13357#issuecomment-1499986742

Reply via email to