Github messages for voidlinux
 help / color / mirror / Atom feed
From: fosslinux <fosslinux@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] openjdk8: mips* support
Date: Wed, 22 Jul 2020 12:58:36 +0200	[thread overview]
Message-ID: <20200722105836.yaEUdSV9jsyx37mujuc0rHHJxUiP3Mz2wWxxXJyqwcQ@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

There is an updated pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages openjdk-mips
https://github.com/void-linux/void-packages/pull/23722

openjdk8: mips* support
Builds for all mips* platforms, using the zero backend. A mips port
properly is in process but has been "getting close to ready" for years
now, so we are using the much more tested zero backend.

mipshf had a branch jump error (mips hates super large branch jumps).
This is a known bug that is not going to be fixed very easily. To
workaround this, I reduced the jump by ~400 lines of assembly by
compiling with -Os, enough to make the jump close enough.

The mips support patch was taken from debian, I left mips64 in there because it might be useful in the future, we don't lose anything by having it there. (I debated putting the whole patch with all the extra archs in there, but it looked a bit unwieldy then)

cc @pullmoll recent committer and mips expert ;)
cc @Vaelatern maintainer

openjdk11 coming up

A patch file from https://github.com/void-linux/void-packages/pull/23722.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openjdk-mips-23722.patch --]
[-- Type: text/x-diff, Size: 4041 bytes --]

From bc392de6b564ef67703d5ea8fc854a41c1e5e9c4 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Wed, 22 Jul 2020 20:31:14 +1000
Subject: [PATCH] openjdk8: mips* support

Builds for all mips* platforms, using the zero backend. A mips port
properly is in process but has been "getting close to ready" for years
now, so we are using the much more tested zero backend.

mipshf had a branch jump error (mips hates super large branch jumps).
This is a known bug that is not going to be fixed very easily. To
workaround this, I reduced the jump by ~400 lines of assembly by
compiling with -Os, enough to make the jump close enough.
---
 .../openjdk8/patches/104_mips-support.patch   | 67 +++++++++++++++++++
 srcpkgs/openjdk8/template                     |  8 ++-
 2 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/openjdk8/patches/104_mips-support.patch

diff --git a/srcpkgs/openjdk8/patches/104_mips-support.patch b/srcpkgs/openjdk8/patches/104_mips-support.patch
new file mode 100644
index 00000000000..4783578ec06
--- /dev/null
+++ b/srcpkgs/openjdk8/patches/104_mips-support.patch
@@ -0,0 +1,67 @@
+# DP: Add support for zero architectures alpha, m68k, mips*, sh4
+
+--- openjdk/common/autoconf/platform.m4
++++ openjdk/common/autoconf/platform.m4
+@@ -54,6 +60,42 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU
+       VAR_CPU_BITS=64
+       VAR_CPU_ENDIAN=little
+       ;;
++    mips)
++      VAR_CPU=mips
++      VAR_CPU_ARCH=mips
++      VAR_CPU_BITS=32
++      VAR_CPU_ENDIAN=big
++      ;;
++    mipsel)
++      VAR_CPU=mipsel
++      VAR_CPU_ARCH=mipsel
++      VAR_CPU_BITS=32
++      VAR_CPU_ENDIAN=little
++      ;;
++    mipsn32)
++      VAR_CPU=mipsn32
++      VAR_CPU_ARCH=mipsn32
++      VAR_CPU_BITS=32
++      VAR_CPU_ENDIAN=big
++      ;;
++    mipsn32el)
++      VAR_CPU=mipsn32el
++      VAR_CPU_ARCH=mipsn32el
++      VAR_CPU_BITS=32
++      VAR_CPU_ENDIAN=little
++      ;;
++    mips64)
++      VAR_CPU=mips64
++      VAR_CPU_ARCH=mips64
++      VAR_CPU_BITS=64
++      VAR_CPU_ENDIAN=big
++      ;;
++    mips64el)
++      VAR_CPU=mips64el
++      VAR_CPU_ARCH=mips64el
++      VAR_CPU_BITS=64
++      VAR_CPU_ENDIAN=little
++      ;;
+     powerpc)
+       VAR_CPU=ppc
+       VAR_CPU_ARCH=ppc
+@@ -373,6 +433,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
+ 
+   # ZERO_ARCHDEF is used to enable architecture-specific code
+   case "${OPENJDK_TARGET_CPU}" in
++    mips|mipsn32|mips64)  ZERO_ARCHDEF=MIPS ;;
++    mipsel|mipsn32el|mips64el)  ZERO_ARCHDEF=MIPSEL ;;
+     ppc)     ZERO_ARCHDEF=PPC32 ;;
+     ppc64)   ZERO_ARCHDEF=PPC64 ;;
+     s390*)   ZERO_ARCHDEF=S390  ;;
+--- openjdk/common/autoconf/flags.m4
++++ openjdk/common/autoconf/flags.m4
+@@ -827,6 +827,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAG
+     *)
+       ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
+   esac
++  # use the default for the package builds
++  ZERO_ARCHFLAG=""
+   FLAGS_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""])
+   AC_SUBST(ZERO_ARCHFLAG)
+ 
diff --git a/srcpkgs/openjdk8/template b/srcpkgs/openjdk8/template
index ad1c3a23b6e..034a5f9fe08 100644
--- a/srcpkgs/openjdk8/template
+++ b/srcpkgs/openjdk8/template
@@ -67,7 +67,7 @@ desc_option_docs="Build documentation"
 # no hotspot JIT for arm32 and ppc32
 case "$XBPS_TARGET_MACHINE" in
 	ppc64*) ;;
-	arm*|ppc*) _use_zero=yes ;;
+	arm*|ppc*|mips*) _use_zero=yes ;;
 esac
 
 # specifically do not enable docs because with zero it takes hours
@@ -186,11 +186,17 @@ do_configure() {
 	CXXFLAGS=${CXXFLAGS/-D_FORTIFY_SOURCE=2/}
 
 	# force ELFv2 for ppc64 just in case
+	# with normal -O2 on mipshf there is a too-large jump which causes the
+	# assembler to fail. optomising for size means the jump is made smaller
 	case "$XBPS_TARGET_MACHINE" in
 		ppc64*)
 			CFLAGS+=" -DABI_ELFv2"
 			CXXFLAGS+=" -DABI_ELFv2"
 			;;
+		mipshf*)
+			CFLAGS+=" -Os"
+			CXXFLAGS+=" -Os"
+			;;
 	esac
 
 	configure_args=${configure_args/--with-libtool-sysroot=\/usr\/[a-z0-9]*-linux-[a-z]*/}

       reply	other threads:[~2020-07-22 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
2020-07-22 10:58 ` fosslinux [this message]
2020-07-25 22:02 ` fosslinux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200722105836.yaEUdSV9jsyx37mujuc0rHHJxUiP3Mz2wWxxXJyqwcQ@z \
    --to=fosslinux@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).