Github messages for voidlinux
 help / color / mirror / Atom feed
* Re: openjdk8: mips* support
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
@ 2020-07-22 15:10 ` Vaelatern
  2020-07-22 15:11 ` Vaelatern
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Vaelatern @ 2020-07-22 15:10 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/23722#issuecomment-662510389

Comment:
Shouldn't be able to break other platforms, so I'm OK with this.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: openjdk8: mips* support
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
  2020-07-22 15:10 ` openjdk8: mips* support Vaelatern
@ 2020-07-22 15:11 ` Vaelatern
  2020-07-22 15:39 ` [PR REVIEW] " ericonr
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: Vaelatern @ 2020-07-22 15:11 UTC (permalink / raw)
  To: ml

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

New comment by Vaelatern on void-packages repository

https://github.com/void-linux/void-packages/pull/23722#issuecomment-662510389

Comment:
Shouldn't be able to break other platforms, so I'm OK with this.

Would prefer the patch to have a source.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR REVIEW] openjdk8: mips* support
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
  2020-07-22 15:10 ` openjdk8: mips* support Vaelatern
  2020-07-22 15:11 ` Vaelatern
@ 2020-07-22 15:39 ` ericonr
  2020-07-22 23:25 ` fosslinux
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ericonr @ 2020-07-22 15:39 UTC (permalink / raw)
  To: ml

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

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/23722#discussion_r458887741

Comment:
"optimising"

And I think it would be best if the comments were right above their respective archs, since there are different special cases here.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: openjdk8: mips* support
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
                   ` (2 preceding siblings ...)
  2020-07-22 15:39 ` [PR REVIEW] " ericonr
@ 2020-07-22 23:25 ` fosslinux
  2020-07-25 22:02 ` [PR PATCH] [Updated] " fosslinux
  2020-07-25 22:07 ` fosslinux
  5 siblings, 0 replies; 6+ messages in thread
From: fosslinux @ 2020-07-22 23:25 UTC (permalink / raw)
  To: ml

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

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/23722#issuecomment-662746610

Comment:
@Vaelatern Is it OK just to have a link to the debian URL in the header of the patch?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] openjdk8: mips* support
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
                   ` (3 preceding siblings ...)
  2020-07-22 23:25 ` fosslinux
@ 2020-07-25 22:02 ` fosslinux
  2020-07-25 22:07 ` fosslinux
  5 siblings, 0 replies; 6+ messages in thread
From: fosslinux @ 2020-07-25 22:02 UTC (permalink / raw)
  To: ml

[-- 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: 4266 bytes --]

From ea99de545fa87f4ddac42bf77d4174da2f3578de 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.

[ci skip]
---
 .../openjdk8/patches/104_mips-support.patch   | 69 +++++++++++++++++++
 srcpkgs/openjdk8/template                     | 10 ++-
 2 files changed, 77 insertions(+), 2 deletions(-)
 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..a788ea6df5b
--- /dev/null
+++ b/srcpkgs/openjdk8/patches/104_mips-support.patch
@@ -0,0 +1,69 @@
+# DP: Add support for zero architectures alpha, m68k, mips*, sh4
+
+Sourced from https://bazaar.launchpad.net/~openjdk/openjdk/openjdk8/view/head:/debian/patches/zero-architectures.diff
+
+--- 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..b38679bad8a 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
@@ -185,12 +185,18 @@ do_configure() {
 	CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
 	CXXFLAGS=${CXXFLAGS/-D_FORTIFY_SOURCE=2/}
 
-	# force ELFv2 for ppc64 just in case
 	case "$XBPS_TARGET_MACHINE" in
+	    # force ELFv2 for ppc64 just in case
 		ppc64*)
 			CFLAGS+=" -DABI_ELFv2"
 			CXXFLAGS+=" -DABI_ELFv2"
 			;;
+	    # with normal -O2 on mipshf there is a too-large jump which causes the
+    	# assembler to fail. optimising for size means the jump is made smaller
+		mips*hf*)
+			CFLAGS+=" -Os"
+			CXXFLAGS+=" -Os"
+			;;
 	esac
 
 	configure_args=${configure_args/--with-libtool-sysroot=\/usr\/[a-z0-9]*-linux-[a-z]*/}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: openjdk8: mips* support
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
                   ` (4 preceding siblings ...)
  2020-07-25 22:02 ` [PR PATCH] [Updated] " fosslinux
@ 2020-07-25 22:07 ` fosslinux
  5 siblings, 0 replies; 6+ messages in thread
From: fosslinux @ 2020-07-25 22:07 UTC (permalink / raw)
  To: ml

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

New comment by fosslinux on void-packages repository

https://github.com/void-linux/void-packages/pull/23722#issuecomment-663910893

Comment:
Addressed.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-25 22:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-23722@inbox.vuxu.org>
2020-07-22 15:10 ` openjdk8: mips* support Vaelatern
2020-07-22 15:11 ` Vaelatern
2020-07-22 15:39 ` [PR REVIEW] " ericonr
2020-07-22 23:25 ` fosslinux
2020-07-25 22:02 ` [PR PATCH] [Updated] " fosslinux
2020-07-25 22:07 ` fosslinux

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).