Skip to content

8270517: Add Zero support for LoongArch #413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

8270517: Add Zero support for LoongArch #413

wants to merge 2 commits into from

Conversation

xiangzhai
Copy link
Member

@xiangzhai xiangzhai commented Jan 5, 2024

Hi,

I'd like to backport this patch to jdk8u. common/autoconf/build-aux/config.guess and hotspot/src/os/linux/vm/os_linux.cpp do not apply cleanly due to context difference, but it is easy to resolve them manually. common/autoconf/platform.m4 just changed file path.

common/autoconf/generated-configure.sh regenerated by bash common/autoconf/autogen.sh.

A native build on LoongArch hardware is tested.

Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060236

$ ./build/images/j2sdk-image/bin/java -version
openjdk version "1.8.0_392"
OpenJDK Runtime Environment (build 1.8.0_392-8u392-ga-1-b08)
OpenJDK 64-Bit Zero VM (build 25.392-b08, interpreted mode)

Loongnix Desktop:

$ ./build/linux-loongarch64-normal-zero-release/images/j2sdk-image/bin/java -version
openjdk version "1.8.0_412-internal"
OpenJDK Runtime Environment (build 1.8.0_412-internal-zhaixiang_2024_01_06_10_53-b00)
OpenJDK 64-Bit Zero VM (build 25.412-b00, interpreted mode)

The risk of the downport is low.

Thanks,
Leslie Zhai


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8270517 needs maintainer approval

Issue

  • JDK-8270517: Add Zero support for LoongArch (Enhancement - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/413/head:pull/413
$ git checkout pull/413

Update a local copy of the PR:
$ git checkout pull/413
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/413/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 413

View PR using the GUI difftool:
$ git pr show -t 413

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/413.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 5, 2024

👋 Welcome back lzhai! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot changed the title Backport e92e2fd4e0bc805d8f7d70f632cce0282eb1809b 8270517: Add Zero support for LoongArch Jan 5, 2024
@openjdk
Copy link

openjdk bot commented Jan 5, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base rfr Pull request is ready for review labels Jan 5, 2024
@mlbridge
Copy link

mlbridge bot commented Jan 5, 2024

Webrevs

@theaoqi
Copy link
Member

theaoqi commented Jan 6, 2024

As the author of 8270517, the backport looks good to me. The releaes and fastdebug native builds are passed on my loongarch64 platform. I am not a Reviewer. The GHA test failure seems unrelated, see #169 (comment) and #228 (comment).

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Jan 6, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Feb 3, 2024

@xiangzhai This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@xiangzhai
Copy link
Member Author

Hi @theRealAph

Could you sponsor it?

Thanks,
Leslie Zhai

@xiangzhai
Copy link
Member Author

Hi @jerboaa

Could you review and sponsor it please?

Thanks,
Leslie Zhai

@theaoqi
Copy link
Member

theaoqi commented Feb 4, 2024

Hi @jerboaa

Could you review and sponsor it please?

Thanks, Leslie Zhai

I think you should get a review (by a Reviewer of jdk8u) and the maintainer's approval first.

Copy link
Member

@gnu-andrew gnu-andrew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me. Does this allow Zero build on LoongArch?

@gnu-andrew
Copy link
Member

To move this forward, you need to formally request maintainer approval. See https://wiki.openjdk.org/display/SKARA/Pull+Request+Commands#PullRequestCommands-/approval

I'm assuming from the thumbs up that it does allow Zero builds on LoongArch :)

@xiangzhai
Copy link
Member Author

/approval request allow Zero build on LoongArch

@openjdk
Copy link

openjdk bot commented Feb 13, 2024

@xiangzhai
8270517: The approval request has been created successfully.

@gnu-andrew
Copy link
Member

/approve yes

@openjdk
Copy link

openjdk bot commented Feb 16, 2024

@gnu-andrew
8270517: The approval request has been approved.

@openjdk
Copy link

openjdk bot commented Feb 16, 2024

@xiangzhai This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

8270517: Add Zero support for LoongArch

Reviewed-by: aoqi, andrew

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 19 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@gnu-andrew) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added ready Pull request is ready to be integrated and removed approval Requires approval; will be removed when approval is received labels Feb 16, 2024
@xiangzhai
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Feb 17, 2024
@openjdk
Copy link

openjdk bot commented Feb 17, 2024

@xiangzhai
Your change (at version ed0af16) is now ready to be sponsored by a Committer.

@gnu-andrew
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 17, 2024

Going to push as commit 9aabf22.
Since your change was applied there have been 19 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 17, 2024
@openjdk openjdk bot closed this Feb 17, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Feb 17, 2024
@openjdk
Copy link

openjdk bot commented Feb 17, 2024

@gnu-andrew @xiangzhai Pushed as commit 9aabf22.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@mrserb
Copy link
Member

mrserb commented Feb 19, 2024

It is strange but after integration of this patch, execution of "autogen.sh" using autoconf 2.69 will cut part of the change(tested on macOS+brew).

[autoconf (GNU Autoconf) 2.69]
Generating generated-configure.sh

diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 85eb8a16a21..0803a8782af 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -1017,7 +1017,6 @@ infodir
 docdir
 oldincludedir
 includedir
-runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -1263,7 +1262,6 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1516,15 +1514,6 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
-  | --runstate | --runstat | --runsta | --runst | --runs \
-  | --run | --ru | --r)
-    ac_prev=runstatedir ;;
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
-  | --run=* | --ru=* | --r=*)
-    runstatedir=$ac_optarg ;;
-
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1662,7 +1651,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir runstatedir
+               libdir localedir mandir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1815,7 +1804,6 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -4440,7 +4428,7 @@ VS_TOOLSET_SUPPORTED_2022=true

@mrserb
Copy link
Member

mrserb commented Feb 19, 2024

the same result is on Linux, the next run of "autogen.sh" will delete part of this change.
@xiangzhai please take a look.

@xiangzhai
Copy link
Member Author

Hi @mrserb

Due to AC_INIT: add --runstatedir option to configure. And I also tested with autoconf 2.69 and 2.72, there is runstatedir generated.

Thanks,
Leslie Zhai

@gnu-andrew
Copy link
Member

Hi @mrserb

Due to AC_INIT: add --runstatedir option to configure. And I also tested with autoconf 2.69 and 2.72, there is runstatedir generated.

Thanks, Leslie Zhai

Yes, we've gone back and forth on this before. Some distros have this locally patched in, others don't, and it really depends where configure is generated. I think I may have even generated both forms myself on different systems.

I'm thinking of just backporting JDK-8195689 to remove the generated configure at the start of the next release cycle. The argument for not having autoconf installed was weak to begin with and is now limited to those who don't have to work on any later JDKs, which all have this change. I think it causes more confusion than it helps at this point and there is always the risk of someone forgetting to regenerate it.

@mlbridge
Copy link

mlbridge bot commented Feb 20, 2024

Mailing list message from Thorsten Glaser on jdk8u-dev:

On Mon, 19 Feb 2024, Andrew John Hughes wrote:

I'm thinking of just backporting [?] to remove
the generated `configure` at the start of the next release cycle.From a Debian PoV: yes, please; we regenerate everything now.

bye,
//mirabilos
--
Infrastrukturexperte ? Qvest Digital AG
Am Dickobskreuz 10, D-53121 Bonn ? https://www.qvest-digital.com/
Telephon +49 228 54881-393 ? Fax: +49 228 54881-235
HRB AG Bonn 18196 ? USt-ID (VAT): DE274355441
Vorstand: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg
Vorsitzender Aufsichtsrat: Peter N?then

@zifeihan
Copy link
Member

Hi @mrserb
Due to AC_INIT: add --runstatedir option to configure. And I also tested with autoconf 2.69 and 2.72, there is runstatedir generated.
Thanks, Leslie Zhai

Yes, we've gone back and forth on this before. Some distros have this locally patched in, others don't, and it really depends where configure is generated. I think I may have even generated both forms myself on different systems.

I'm thinking of just backporting JDK-8195689 to remove the generated configure at the start of the next release cycle. The argument for not having autoconf installed was weak to begin with and is now limited to those who don't have to work on any later JDKs, which all have this change. I think it causes more confusion than it helps at this point and there is always the risk of someone forgetting to regenerate it.

@gnu-andrew : Hi, May I ask if there is a plan to backport JDK-8195689 ? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Port of a pull request already in a different code base integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants