jdk8u: -Wno-regsiter to support newer compilers

Zdeněk Žamberský zzambers at redhat.com
Wed Aug 7 12:02:13 UTC 2024


I think to have jdk8 build work out of box, it is better to use older OSes.
Like rhel/centos <= 8. You can use VM or container.
I personally usually use rhel-8 VM, if I want to build jdk8 locally.

Others distros, which should work:
Ubuntu <= 20.04
debian <= bullseye (I think)

When it comes to vendors providing JDK 8 builds, I think they generally use
older linux distros (like rhel-6/7 or equivalent) to maximize portability.

I cannot really comment much on Mac OS X. I have never owned mac.
GHA was just recently updated macos-13. (there are still some issues to 
solve there)
https://github.com/openjdk/jdk8u-dev/pull/544

I don't think MacOS/aarch64 is even supported currently, at least I am 
not aware of any work in that regard.
May need some additional patching. (Adoptium does not offer MacOS/aarch64.)


However if you just want to test some changes, you can just use GHA. You 
can do test branch,
with modified GHA workflow to run test groups, you are interested in, on 
top of your changes.


On 06. 08. 24 20:42, Elazar Leibovich wrote:
> Thanks,
> I did follow the readme, but could not find any commentary about the 
> build environment or the required compilers.
> Even less information was on Mac OS X, where the autoconf files seems 
> not to be updated, and as a result arm was chosen instead of aarch64.
>
> If you can point me to a specific section in the documentation 
> specifying, say, a list of known good compilers, I'll be grateful.
>
> On Tue, 6 Aug 2024 at 21:37, Magnus Ihse Bursie 
> <magnus.ihse.bursie at oracle.com> wrote:
>
>     On 2024-08-06 20:33, Elazar Leibovich wrote:
>
>>     Thanks,
>>     I still fail to understand how JDK8u developers are building the
>>     project.
>
>     Setting up a build environment for jdk8 is unfortunately not a
>     trivial task. The build readme can be of some use:
>     https://github.com/openjdk/jdk8u-dev/blob/master/doc/building.md.
>     The build system has gone through a complete overhaul in later
>     versions, so if you were to build the mainline JDK it would be a
>     much smoother experience. After all, JDK 8 was released 10 years
>     ago, and much has happened since then.
>
>     /Magnus
>
>
>
>>     Is there a docker file specifying the build environment? What's
>>     the recommended way of doing that?
>>     Removing the register keyword, plus disabling an overflow warning
>>     in a specific test with pragma did the trick for me, but:
>>     1. I could not get it built in Mac OS X
>>     2. I felt as if I'm paving my own path building it, instead of
>>     following the Yellow Brick Road, which I'm trying to locate.
>>
>>     Thanks again,
>>
>>     On Tue, 6 Aug 2024 at 21:10, Zdeněk Žamberský
>>     <zzambers at redhat.com> wrote:
>>
>>         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
>>

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



More information about the build-dev mailing list