Hello,

this is known issue, which should get fixed by JDK-8281096:
https://github.com/openjdk/jdk8u-dev/pull/357

(see also: https://github.com/openjdk/jdk8u-dev/pull/508)

TLDR:
Jdk 8 explicitly specifies older c++ version (gnu++98, which not yet deprecated
'register' keyword), but flags are not propagated to ADLC build due to bug.
(correct me, if I am wrong)


When it comes to Adoptium, I don't know exactly, but I think they are using
older compiler, which uses older c++ standard by default.

On 06. 08. 24 18:37, Magnus Ihse Bursie wrote:
Hi Elazar,

I see that you never got any replies here. I suggest that you re-ask your question on the jdk8u mailing list instead (cc'd).

/Magnus

On 2024-07-19 16:20, Elazar Leibovich wrote:
When trying to compile the latest jdk8u on linux I get failures over warnings with the register keywords.

I'm using https://github.com/openjdk/jdk8u-dev.git which seems to be pretty up to date (I'm using master), and last commit is less than two days ago.

This is a workaround I had to use:
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index 7dde7f0963..81f156574a 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -202,7 +202,7 @@ else
 endif

 # Compiler warnings are treated as errors
-WARNINGS_ARE_ERRORS = -Werror
+WARNINGS_ARE_ERRORS = -Werror -Wno-register

But I guess the best solution is to remove the register keywords from the codebase.

How is adoptium building it? Does it use specific compiler? Is the supported compiler documented anywhere?

FTR using temurin-build repository and scripts, fails for other reasons, and fails even with -D/--podman docker containers.

This patch builds it with centos stream 9 on amd64.

Am I doing something wrong? What's the recommended way of building jdk8?

Thanks,
Elazar Leibovich


--
Zdeněk Žamberský
OpenJDK QE
Red Hat

Reply via email to