From 5b78f808efeed468b5bb29edf20edc6c8a3d0cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 16 Jul 2020 19:51:17 +0100 Subject: [PATCH] java: add icedtea-8 musl patches. --- dev-java/icedtea/Manifest | 11 +- .../icedtea/files/icedtea-hotspot-musl.patch | 55 ++++++++ .../files/icedtea8-autoconf-config.patch | 114 +++++++++++++++++ .../files/icedtea8-disable-systemtap.patch | 10 ++ .../icedtea/files/icedtea8-gcc-triple.patch | 11 ++ .../files/icedtea8-hotspot-noagent-musl.patch | 84 +++++++++++++ .../icedtea/files/icedtea8-jdk-execinfo.patch | 21 ++++ .../files/icedtea8-jdk-fix-libjvm-load.patch | 14 +++ .../icedtea/files/icedtea8-jdk-musl.patch | 117 ++++++++++++++++++ dev-java/icedtea/icedtea-3.7.0.ebuild | 60 ++++----- 10 files changed, 468 insertions(+), 29 deletions(-) create mode 100644 dev-java/icedtea/files/icedtea-hotspot-musl.patch create mode 100644 dev-java/icedtea/files/icedtea8-autoconf-config.patch create mode 100644 dev-java/icedtea/files/icedtea8-disable-systemtap.patch create mode 100644 dev-java/icedtea/files/icedtea8-gcc-triple.patch create mode 100644 dev-java/icedtea/files/icedtea8-hotspot-noagent-musl.patch create mode 100644 dev-java/icedtea/files/icedtea8-jdk-execinfo.patch create mode 100644 dev-java/icedtea/files/icedtea8-jdk-fix-libjvm-load.patch create mode 100644 dev-java/icedtea/files/icedtea8-jdk-musl.patch diff --git a/dev-java/icedtea/Manifest b/dev-java/icedtea/Manifest index 4d48508..cc2f265 100644 --- a/dev-java/icedtea/Manifest +++ b/dev-java/icedtea/Manifest @@ -1,9 +1,18 @@ AUX generate-cacerts.pl 11051 BLAKE2B e6d54319153735bd4b445581dfbd2b78e2e27a19f3b8a78d2fe6912efa207d133fa550652295648bc0bd1370956f71374d4b42de71776fa253f44d4e9dff2527 SHA512 22d1be675362c09ed61af4dc3ece14cab81e9514937d588ff5d324e61b7eba7d3dd99b26bc5ec0953365de56d099f708b2afdb13cca37bc4ff07fd8ce31fbe97 +AUX icedtea-disable-systemtap.patch 986 BLAKE2B 9fe690c923fab5a23d16c10d4309454f474b806b41e70e83a3f285c74216ef5c8201df06f1f329fb606bf802776d3947cdcc58add56bf304947195dad5486501 SHA512 c1863a99754715c114982fc480ee8ef92ac5252bd20234e1d4088bb2306acc50f9f3aebe1987e16c81cde00491e7b575ff7b32df1fa83b072b33a38c2f7be398 +AUX icedtea-hotspot-musl.patch 1820 BLAKE2B b3abc9dbdc17cee37452b1bdc4fb59e67da43ec6cf79268982548cf65f627d6ccb230e80c42b139cdb200071e553068fcb06df3a92c2c1237f8804bec2e612f4 SHA512 b2afd83433e205b5e183f39b65b5c3ad9583056363b44f68616d4abb3f003a7f26080da7e104e5bf95c570da84eea4b4b2054b5de1d2185ffd0d9fb5c22b5cc2 AUX icedtea-jdk-execinfo.patch 1026 BLAKE2B c09c343ead869275a945d5e2437c833a641728fc39ad3e9218291fd12376b6684fbcf7f129b69fcd1bde11949c6998865b131ee0734cc33d80f332eb7261428e SHA512 0391970e6a32946aa3cccf38fdef9c0fe2af26cd0df824b98aa2fcfa1bf661d4a68e339bffcfd16f386c565fc68bb28a29208a67d4bad8a0e847ad02bd8becbb AUX icedtea-jdk-fix-build.patch 2150 BLAKE2B ebfc48db63836bd3f60f946ad2a647ddfa3aea3e97742a475098ae8a8cd4a4a8b1bc9986f3b41d98c8da49713d374c39aff2199bcaebbb8a2fc112d2de805bb7 SHA512 213a537de5f011cb39d608515c3413513ac75fb93593f9a9ef4205f71d72bdd8b097c80db185f7b26021d5bb85045b866f34f3478482dc4189972d8614a13458 AUX icedtea-jdk-musl.patch 4861 BLAKE2B 40028881fd456a7643501aee235e015039ea7e363c094bb0a23cab2faae1e8ae72501d562f6366f1630c3d1d08f7ee31f05bc95e802be7e146976d9087a07358 SHA512 44a35941c80f408d0607e32763b3b6ccee21e1d39886309327d3d74d2900117e4346ef59e77c663fd022fec10ee8f365eeb46c1260014d5765d226ce175ce3c5 AUX icedtea-jdk-no-soname.patch 369 BLAKE2B e44f1f539abd742963664a6f64cdd8aaaa7b108b20535ca0a5a20b0892a083e81b676fd1c71a6b021b2fa1f15404520be388f14ac326ac909f0a11f1aac20864 SHA512 bf4b184e170f7b0ff64ab30d2162784fe2bd5460d1fa31973259f7065fd4c511c46f97724fe2bd72bb94e9006cb568d0e0c87d1a9c90819e65880f8f44830bb1 AUX icedtea.env.sh 1130 BLAKE2B 8ffd3a9c558b9abb9df723efc531496537d7883d676c145411d9a4f02ecd6826c5edec9451ced8187224a9c24b408e6cbad3dc11ebcbe2f69a38b0966cb691c7 SHA512 79c279338cc2790df91c92d8d9b97c007f1a030374066dfacbbb2f9aac754eafba9197b748adcb9fe6fbff16bd998b6536298443028df281d1b12d3b348da66f +AUX icedtea8-autoconf-config.patch 3529 BLAKE2B 8f3088c7a089199ab3ea6b67db81e69ccb640c84e3abad8376b35c18152eaa469288963faa0032bbbbb32131f3c02a7a83d76497f4993d201bb3cdb50fd71806 SHA512 662d662d0a7a84be2978e921317589f212f3ba3b7629527ba0f1140b5ac4c1024893e0ed176211688ed1a4505968c4befc841ed57ffcdbb9d355c2cb0571b167 +AUX icedtea8-disable-systemtap.patch 569 BLAKE2B 8079c590463bb567f4be47f8db0d83ff4953e61e0d96335e10fba743914fb547585b3b90e5fb385344d5718f289d6ee10d149af36f80a23b18d715ed4a950668 SHA512 b544723b37844462a3939738bd16a0341b85e483207e204db289133e57f6a5ef3f6bde73444735c0ca786a57c6e6478f9d026b572fbe051857edddb3725ae724 +AUX icedtea8-gcc-triple.patch 731 BLAKE2B 39f4368f1e22e7f036cf40eeb319898d6377b25f71be274758b9ac1b4847e7a8fdddfaa2b97cdeb43e70f659ae3023f0ae0f9d3a8f571a47d1ca3297d446e37c SHA512 b53e03a4d6ce81d301392e3fd43801641859c5cd43897eb7490e7a4ceedd4ccc568b6e4566620aa293f8e5e943401bf1e576ca3e3902960a058577d23c9b9786 +AUX icedtea8-hotspot-noagent-musl.patch 3334 BLAKE2B 6595d4a2a245aea05f39c3ccbd7267249f0d0e8d0564569adf637e75c9ae7a7dfd4aa871d5bd8e924ec706570368e7e0168c4f592236c1e1f2d12e324944b872 SHA512 1545bcd15d47fb77e07cbed955d5757d96b99c659ca833db701f8711f123ccef6538a2c1fedd87d3c75f1e309ed840c4c74611f6840369c12ef30633adbdb523 +AUX icedtea8-jdk-execinfo.patch 692 BLAKE2B ca92273d0ce717176765186c9c3039d2644f3a0935d0dc5df354caf31e031fbb13a85ec8aa2b90c6f03b2e98f021d64dfc463b1e969d76c2eb90bbc4c8f30100 SHA512 75804b229d9230f5410fcd731a99448ea5d50e1fa2ce2a39cbb21c9a9f00edef6e76561fc8c19e989b738c3e97c8e7d968a70343fc1bda6736a22d04e7db105e +AUX icedtea8-jdk-fix-libjvm-load.patch 483 BLAKE2B 9d107245fe7a88a73b1ae949f54cac38bed0a763534213f940f8578dcb49b0a19001694c3aea7430cd76340eb11a45bcf3498911ec6bfe5ad5a7a29f191633ad SHA512 b135991c76b0db8fa7c363e0903624668e11eda7b54a943035c214aa4d7fc8c3e8110ed200edcec82792f3c9393150a9bd628625ddf7f3e55720ff163fbbb471 +AUX icedtea8-jdk-musl.patch 5024 BLAKE2B ec3854ccbe434e71eabf81821820613c4322eb02cd42277d7fc383ba9f511e0945f2279ad13622f9e4171891845a848f697b81f4ee75ee24b9b166564eeeea2f SHA512 d2bd0a1c8637b288a0a74796e62fe3d926121270b323aff408280088296533372db87d42a690ae76743b803d30b2a2a8e9a7a3b05f457b7a65074bb39e2838e8 AUX jamvm-1.6.0-aarch64-support.patch 23347 BLAKE2B b80462ea9d8ceb54f8039d1a2c6e161a45eceabcd5e27993dec602605397d70754bcc4c70fcc6be197f17a7d1383d6d91ae57c01063dbc55c61537f50fb71de6 SHA512 aa602103865d64dc0d53d8d46002888b99afb7b92e95f39dacd36a2d3b937006f7816826efc418d0e3b9e7b3eec5b0b01a1642e37875635577c0c5653418596c AUX jamvm-1.6.0-opcode-guard.patch 1416 BLAKE2B 4e866f4dde142d591d3dce89f10589fd3fbd290b1429ad83ba4ba4d4dfcb91d7e9da4ea7797859337690e24a8f1ebcf39eaa5aad085d03233306db02147f18cb SHA512 396d18eaad17bc76d8316bfc8fa2553e081389deade1ce0cd72f082226a91dbd70ec983636d324243be0a502ae9e0dd91d40952f13bf77c991601e61385af728 DIST icedtea-2.6-corba-737fd3fbf139.tar.bz2 1073197 BLAKE2B af7a9a9c91511ba63835e2930e71ad442c45215f66043c6d05c636b8f3ab2803c4a0afb8ebf099b1f707ccb4850a9c4a2ecd78d7434f7c0b6ec38d1f56ba65b9 SHA512 77e81659d3314172c2b80fb1441d268edc52e0ec0bd25f9a9596e3c7a545f0694a11cc2298952d72c85965529b344493d1f2c2187cf4d38749278018fc85a6b8 @@ -28,5 +37,5 @@ DIST icedtea-3.7.0.tar.xz 1487360 BLAKE2B efef75c5ac615c21310f16f50fc425c5a76076 DIST icedtea-cacao-c182f119eaad.tar.gz 4485353 BLAKE2B 5c1faa3cbbfea62f819562a01ec389f3682cf3164d06f5404d1d16359c87b37d6ae4101f7c33cde30bad4f3d52af18f0f410e36868b2c9d1280661d2340e683b SHA512 2ccb947d71b80d84b83295d473c19952e98698a1fd944fc7c12004ff1af29af2989d46fbd95b5daf95eae2fda9de7c7f88f964fa887a6345b4f57d0c490bee23 DIST icedtea-cacao-c182f119eaad.tar.xz 3056520 BLAKE2B 6b1be66ce19f491d49f1591babcd8c088e8e327f828dca3f30b8f8b04c132140f8b9f487ef6d91aed212aebab2c7c3052d79fa3f2d76d3832341d94d48e77089 SHA512 22e8a031db5f93f82b276b310c175f1e926e48d64e1e50bebe51138e0f66391cd005501491a959d31663f338f27a29ec984ac29f77078f59472856e4d08edef7 DIST icedtea-jamvm-ec18fb9e49e62dce16c5094ef1527eed619463aa.tar.gz 317187 BLAKE2B 1ca581a02be4cf5c09162687bbc90ec01b58b4910d866d11512cf17a1caff181fdc69e42f7498b2df9deb875ddc6efc6bc2888428f411da94bbc2313ddf5a2c9 SHA512 a31348481e1c02747f5bb9db333f855c45a1555aa187ee35de5ef553a10a8a47dfcc1beb1e69502046c1758438b91958a328e0a0015812c153221f67734a70a6 -EBUILD icedtea-3.7.0.ebuild 13476 BLAKE2B 83ff27f01a25038abf19cbfe5b13d495fe1845e112d6fa916f3192664779ae5bcef95b6b3d0fe189cf5c5baa24dae6ab901b9c50ee99f6679a4a1b6ffd6d4720 SHA512 beacbf9b65aba5ca2a624f1d3a68245feee9331b694e3a0f6993eacfdae78332174702bed0933809d97e8d5ee2ed2a1007e31f5e246720d2baa3ad0e47dc4619 +EBUILD icedtea-3.7.0.ebuild 14115 BLAKE2B 7c86b17bdb02b6bcac4fcd9f3a4da38259c4613054b642ba65cf188bf443090ee071c9ee1f1480881550d3e2aa59f18b00b95905c9af92cd88ae5838ae4bb7c8 SHA512 9f111f09c628f44f0c1b73ca2476254ca4cd55c6734b2e6632c144c03812a1761bac87b2e62b23a7e1aa8a723c5d63a829b1fac93b25c3d0777c64915aff2158 EBUILD icedtea-7.2.6.9.ebuild 12085 BLAKE2B c392b85759817efe9f53de6eea1051f8b3e9d3671d1b5cc558cb2449830be7e1c53c39ba8a360757dbcf3e43ada82aeb51b56e3bb9e925bbadb406ee965d02f5 SHA512 86643a8bfb678efef4feaad2a9103e64947914d80c2fa14d4fb43ce66a562e0756b64db3d72413e23aa420fa4cf8408b51e51a9928d3a5522b216f09ee4de916 diff --git a/dev-java/icedtea/files/icedtea-hotspot-musl.patch b/dev-java/icedtea/files/icedtea-hotspot-musl.patch new file mode 100644 index 0000000..02f8b8e --- /dev/null +++ b/dev-java/icedtea/files/icedtea-hotspot-musl.patch @@ -0,0 +1,55 @@ +--- openjdk.orig/hotspot/src/os/linux/vm/jvm_linux.cpp ++++ openjdk/hotspot/src/os/linux/vm/jvm_linux.cpp +@@ -154,7 +154,9 @@ + #ifdef SIGSTKFLT + "STKFLT", SIGSTKFLT, /* Stack fault. */ + #endif ++#ifdef SIGCLD + "CLD", SIGCLD, /* Same as SIGCHLD (System V). */ ++#endif + "CHLD", SIGCHLD, /* Child status has changed (POSIX). */ + "CONT", SIGCONT, /* Continue (POSIX). */ + "STOP", SIGSTOP, /* Stop, unblockable (POSIX). */ +--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +@@ -73,7 +73,6 @@ + # include + # include + # include +-# include + + #ifdef AMD64 + #define REG_SP REG_RSP +@@ -532,6 +531,9 @@ + + ShouldNotReachHere(); + } ++ ++#define _FPU_GETCW(cw) __asm__ __volatile__ ("fnstcw %0" : "=m" (*&cw)) ++#define _FPU_SETCW(cw) __asm__ __volatile__ ("fldcw %0" : : "m" (*&cw)) + + void os::Linux::init_thread_fpu_state(void) { + #ifndef AMD64 +--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/threadLS_linux_x86.hpp +@@ -32,7 +32,9 @@ + // map stack pointer to thread pointer - see notes in threadLS_linux_x86.cpp + #define SP_BITLENGTH 32 + #define PAGE_SHIFT 12 ++ #ifndef PAGE_SIZE + #define PAGE_SIZE (1UL << PAGE_SHIFT) ++ #endif + static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; + + public: +--- openjdk.orig/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ++++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +@@ -75,7 +75,7 @@ + # include + # include + # include +-# include ++# include /* provides __u64 */ + + #ifdef BUILTIN_SIM + #define REG_SP REG_RSP diff --git a/dev-java/icedtea/files/icedtea8-autoconf-config.patch b/dev-java/icedtea/files/icedtea8-autoconf-config.patch new file mode 100644 index 0000000..9b75def --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-autoconf-config.patch @@ -0,0 +1,114 @@ +OpenJDK contains very outdated autoconf-config.guess and autoconf-config.sub +that don't handle triplet with -musl. It also contains wrapper scripts +config.guess and config.sub that we don't need at all. + +This patch modifies these wrapper scripts to just include up-to-date +config.guess and config.sub from the icedtea tarball. + +--- openjdk.orig/common/autoconf/build-aux/config.guess ++++ openjdk/common/autoconf/build-aux/config.guess +@@ -28,62 +28,4 @@ + # and fix the broken property, if needed. + + DIR=`dirname $0` +-OUT=`. $DIR/autoconf-config.guess` +- +-# Test and fix solaris on x86_64 +-echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null +-if test $? = 0; then +- # isainfo -n returns either i386 or amd64 +- REAL_CPU=`isainfo -n` +- OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'` +-fi +- +-# Test and fix solaris on sparcv9 +-echo $OUT | grep sparc-sun-solaris > /dev/null 2> /dev/null +-if test $? = 0; then +- # isainfo -n returns either sparc or sparcv9 +- REAL_CPU=`isainfo -n` +- OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'` +-fi +- +-# Test and fix cygwin on x86_64 +-echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null +-if test $? != 0; then +- echo $OUT | grep 86-pc-mingw > /dev/null 2> /dev/null +-fi +-if test $? = 0; then +- case `echo $PROCESSOR_IDENTIFIER | cut -f1 -d' '` in +- intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64) +- REAL_CPU=x86_64 +- OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'` +- ;; +- esac +-fi +- +-# Test and fix architecture string on AIX +-# On AIX 'config.guess' returns 'powerpc' as architecture but 'powerpc' is +-# implicitely handled as 32-bit architecture in 'platform.m4' so we check +-# for the kernel mode rewrite it to 'powerpc64' if we'Re running in 64-bit mode. +-# The check could also be done with `/usr/sbin/prtconf | grep "Kernel Type" | grep "64-bit"` +-echo $OUT | grep powerpc-ibm-aix > /dev/null 2> /dev/null +-if test $? = 0; then +- if [ -x /bin/getconf ] ; then +- KERNEL_BITMODE=`getconf KERNEL_BITMODE` +- if [ "$KERNEL_BITMODE" = "32" ]; then +- KERNEL_BITMODE="" +- fi +- fi +- OUT=powerpc$KERNEL_BITMODE`echo $OUT | sed -e 's/[^-]*//'` +-fi +- +-# Test and fix little endian PowerPC64. +-# TODO: should be handled by autoconf-config.guess. +-if [ "x$OUT" = x ]; then +- if [ `uname -m` = ppc64le ]; then +- if [ `uname -s` = Linux ]; then +- OUT=powerpc64le-unknown-linux-gnu +- fi +- fi +-fi +- +-echo $OUT ++. $DIR/../../../../config.guess +--- openjdk.orig/common/autoconf/build-aux/config.sub ++++ openjdk/common/autoconf/build-aux/config.sub +@@ -28,37 +28,4 @@ + # wrap it and fix the broken property, if needed. + + DIR=`dirname $0` +- +-# First, filter out everything that doesn't begin with "aarch64-" +-if ! echo $* | grep '^aarch64-' >/dev/null ; then +- . $DIR/autoconf-config.sub "$@" +- # autoconf-config.sub exits, so we never reach here, but just in +- # case we do: +- exit +-fi +- +-while test $# -gt 0 ; do +- case $1 in +- -- ) # Stop option processing +- shift; break ;; +- aarch64-* ) +- config=`echo $1 | sed 's/^aarch64-/arm-/'` +- sub_args="$sub_args $config" +- shift; ;; +- - ) # Use stdin as input. +- sub_args="$sub_args $1" +- shift; break ;; +- * ) +- sub_args="$sub_args $1" +- shift; ;; +- esac +-done +- +-result=`. $DIR/autoconf-config.sub $sub_args "$@"` +-exitcode=$? +- +-result=`echo $result | sed "s/^arm-/aarch64-/"` +- +-echo $result +-exit $exitcode +- ++. $DIR/../../../../config.sub "$@" diff --git a/dev-java/icedtea/files/icedtea8-disable-systemtap.patch b/dev-java/icedtea/files/icedtea8-disable-systemtap.patch new file mode 100644 index 0000000..6611038 --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-disable-systemtap.patch @@ -0,0 +1,10 @@ +--- a/Makefile.am 2020-07-16 14:34:04.759855943 +0000 ++++ b/Makefile.am 2020-07-16 14:34:29.151797650 +0000 +@@ -2941,7 +2941,6 @@ + ${mkinstalldirs} $(DESTDIR)${prefix}/jre/lib/$(INSTALL_ARCH_DIR) + ${mkinstalldirs} $(DESTDIR)${prefix}/jre/lib/$(INSTALL_ARCH_DIR)/jli + ${mkinstalldirs} $(DESTDIR)${prefix}/jre/lib/ext +- ${mkinstalldirs} $(DESTDIR)${prefix}/tapset + if SPLIT_DEBUGINFO + ${mkinstalldirs} $(DESTDIR)$(DEBUG_PREFIX)/$(bindir) $(DESTDIR)$(DEBUG_PREFIX)/${exec_prefix}/lib + ${mkinstalldirs} $(DESTDIR)$(DEBUG_PREFIX)/${exec_prefix}/lib/$(INSTALL_ARCH_DIR) diff --git a/dev-java/icedtea/files/icedtea8-gcc-triple.patch b/dev-java/icedtea/files/icedtea8-gcc-triple.patch new file mode 100644 index 0000000..ad971ee --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-gcc-triple.patch @@ -0,0 +1,11 @@ +--- openjdk.orig/common/autoconf/toolchain.m4 2017-05-22 17:47:00.836442251 -0700 ++++ openjdk/common/autoconf/toolchain.m4 2017-05-22 17:47:20.029658125 -0700 +@@ -122,7 +122,7 @@ + else + COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + # Check that this is GCC or the compatible distcc. +- $COMPILER --version 2>&1 | $GREP -E "^(gcc|g\+\+|distcc)" >&AS_MESSAGE_LOG_FD 2>&1 ++ $COMPILER --version 2>&1 | $GREP -E "(gcc|g\+\+|distcc)" >&AS_MESSAGE_LOG_FD 2>&1 + if test $? -ne 0; then + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the recommended GCC compiler.]) + AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"]) diff --git a/dev-java/icedtea/files/icedtea8-hotspot-noagent-musl.patch b/dev-java/icedtea/files/icedtea8-hotspot-noagent-musl.patch new file mode 100644 index 0000000..6467d05 --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-hotspot-noagent-musl.patch @@ -0,0 +1,84 @@ +diff -Naurw openjdk.orig/common/autoconf/configure openjdk/common/autoconf/configure +--- openjdk.orig/common/autoconf/configure 2016-02-02 13:31:48.655932240 -0800 ++++ openjdk/common/autoconf/configure 2016-02-02 13:36:24.860924385 -0800 +@@ -96,7 +96,7 @@ + } + + # Check for local changes +-check_hg_updates ++run_autogen_or_fail + + if test -e $conf_custom_script_dir/generated-configure.sh; then + # Test if open configure is newer than custom configure, if so, custom needs to +diff -Naurw openjdk.orig/common/autoconf/jdk-options.m4 openjdk/common/autoconf/jdk-options.m4 +--- openjdk.orig/common/autoconf/jdk-options.m4 2016-02-02 13:31:48.657932240 -0800 ++++ openjdk/common/autoconf/jdk-options.m4 2016-02-02 13:36:24.860924385 -0800 +@@ -151,7 +151,7 @@ + AC_SUBST(JVM_VARIANT_ZEROSHARK) + AC_SUBST(JVM_VARIANT_CORE) + +- INCLUDE_SA=true ++ AC_CHECK_HEADER(thread_db.h,INCLUDE_SA=true,INCLUDE_SA=false) + if test "x$JVM_VARIANT_ZERO" = xtrue ; then + INCLUDE_SA=false + fi +diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/make/linux/makefiles/defs.make +--- openjdk.orig/hotspot/make/linux/makefiles/defs.make 2016-02-02 13:31:53.410932105 -0800 ++++ openjdk/hotspot/make/linux/makefiles/defs.make 2016-02-02 13:36:24.861924385 -0800 +@@ -309,6 +309,9 @@ + + # Serviceability Binaries + # No SA Support for PPC, IA64, ARM or zero ++# or if thread_db.h missing (musl) ++ ++ifneq ($(wildcard /usr/include/thread_db.h),) + ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ + $(EXPORT_LIB_DIR)/sa-jdi.jar + ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ +@@ -326,6 +329,11 @@ + endif + endif + endif ++else ++ADD_SA_BINARIES/x86 = ++ADD_SA_BINARIES/sparc = ++ADD_SA_BINARIES/aarch64 = ++endif + ADD_SA_BINARIES/ppc = + ADD_SA_BINARIES/ia64 = + ADD_SA_BINARIES/arm = +diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/sa.make openjdk/hotspot/make/linux/makefiles/sa.make +--- openjdk.orig/hotspot/make/linux/makefiles/sa.make 2016-02-02 13:31:53.414932105 -0800 ++++ openjdk/hotspot/make/linux/makefiles/sa.make 2016-02-02 13:36:24.861924385 -0800 +@@ -59,9 +59,11 @@ + + # if $(AGENT_DIR) does not exist, we don't build SA + # also, we don't build SA on Itanium or zero. ++# check for thread_db.h too (musl does not have it). + + all: +- if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \ ++ if [ -d $(AGENT_DIR) -a -f /usr/include/thread_db.h \ ++ -a "$(SRCARCH)" != "ia64" \ + -a "$(SRCARCH)" != "zero" ] ; then \ + $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \ + fi +diff -Naurw openjdk.orig/hotspot/make/linux/makefiles/saproc.make openjdk/hotspot/make/linux/makefiles/saproc.make +--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make 2016-02-02 13:31:53.745932095 -0800 ++++ openjdk/hotspot/make/linux/makefiles/saproc.make 2016-02-02 13:36:24.861924385 -0800 +@@ -61,12 +61,15 @@ + + # if $(AGENT_DIR) does not exist, we don't build SA + # also, we don't build SA on Itanium or zero. ++# check for thread_db.h too (musl does not have it). + ++ifneq ($(wildcard /usr/include/thread_db.h),) + ifneq ($(wildcard $(AGENT_DIR)),) + ifneq ($(filter-out ia64 zero,$(SRCARCH)),) + BUILDLIBSAPROC = $(LIBSAPROC) + endif + endif ++endif + + ifneq ($(ALT_SASRCDIR),) + ALT_SAINCDIR=-I$(ALT_SASRCDIR) -DALT_SASRCDIR diff --git a/dev-java/icedtea/files/icedtea8-jdk-execinfo.patch b/dev-java/icedtea/files/icedtea8-jdk-execinfo.patch new file mode 100644 index 0000000..3948bef --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-jdk-execinfo.patch @@ -0,0 +1,21 @@ +diff -Naurw openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c +--- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c 2015-03-23 10:05:01.000000000 +0700 ++++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c 2015-08-26 15:55:39.775658680 +0700 +@@ -27,7 +27,7 @@ + #include + #include + #include +-#ifdef __linux__ ++#if defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__) + #include + #endif + +@@ -799,7 +799,7 @@ + return ret; + } + +-#ifdef __linux__ ++#if defined(__linux__) && defined(__GLIBC__) && !defined(__UCLIBC__) + void print_stack(void) + { + void *array[10]; diff --git a/dev-java/icedtea/files/icedtea8-jdk-fix-libjvm-load.patch b/dev-java/icedtea/files/icedtea8-jdk-fix-libjvm-load.patch new file mode 100644 index 0000000..d0a090e --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-jdk-fix-libjvm-load.patch @@ -0,0 +1,14 @@ +musl needs LD_LIBRARY_PATH set because when .so is opened with dlopen(/abs/path) +it does not qualify for providing symbols for NEEDED dependency. + +--- openjdk.orig/jdk/src/solaris/bin/java_md_solinux.c ++++ openjdk/jdk/src/solaris/bin/java_md_solinux.c +@@ -291,6 +291,8 @@ + char *dmllp = NULL; + char *p; /* a utility pointer */ + ++ return JNI_TRUE; ++ + #ifdef AIX + /* We always have to set the LIBPATH on AIX because ld doesn't support $ORIGIN. */ + return JNI_TRUE; diff --git a/dev-java/icedtea/files/icedtea8-jdk-musl.patch b/dev-java/icedtea/files/icedtea8-jdk-musl.patch new file mode 100644 index 0000000..03bd89f --- /dev/null +++ b/dev-java/icedtea/files/icedtea8-jdk-musl.patch @@ -0,0 +1,117 @@ +diff -Naur openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp +--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2017-01-30 11:02:07.890400844 -0800 ++++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp 2017-01-30 11:03:01.814883550 -0800 +@@ -46,6 +46,8 @@ + + #include "zip.h" + ++#define uchar unsigned char ++ + #ifdef NO_ZLIB + + inline bool jar::deflate_bytes(bytes& head, bytes& tail) { +diff -Naur openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h +--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2017-01-30 11:02:07.890400844 -0800 ++++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h 2017-01-30 11:03:59.025407650 -0800 +@@ -23,9 +23,7 @@ + * questions. + */ + +-#define ushort unsigned short +-#define uint unsigned int +-#define uchar unsigned char ++#include + + struct unpacker; + +diff -Naur openjdk.orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h openjdk/jdk/src/share/native/sun/awt/medialib/mlib_types.h +--- openjdk.orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2017-01-30 11:02:07.946401345 -0800 ++++ openjdk/jdk/src/share/native/sun/awt/medialib/mlib_types.h 2017-01-30 11:04:50.032877774 -0800 +@@ -27,6 +27,7 @@ + #ifndef MLIB_TYPES_H + #define MLIB_TYPES_H + ++#include /* for NULL */ + #include + #if defined(_MSC_VER) + #include /* for FLT_MAX and DBL_MAX */ +diff -Naur openjdk.orig/jdk/src/solaris/native/common/jdk_util_md.h openjdk/jdk/src/solaris/native/common/jdk_util_md.h +--- openjdk.orig/jdk/src/solaris/native/common/jdk_util_md.h 2017-01-30 11:02:08.134403028 -0800 ++++ openjdk/jdk/src/solaris/native/common/jdk_util_md.h 2017-01-30 11:05:23.910190013 -0800 +@@ -37,7 +37,7 @@ + #define ISNAND(d) isnan(d) + #elif defined(__linux__) || defined(_ALLBSD_SOURCE) + #include +-#define ISNANF(f) isnanf(f) ++#define ISNANF(f) isnan(f) + #define ISNAND(d) isnan(d) + #elif defined(_AIX) + #include +diff -Naur openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c openjdk/jdk/src/solaris/native/java/net/Inet4AddressImpl.c +--- openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2017-01-30 11:02:08.137403055 -0800 ++++ openjdk/jdk/src/solaris/native/java/net/Inet4AddressImpl.c 2017-01-30 11:05:52.541453901 -0800 +@@ -47,7 +47,7 @@ + + #include "java_net_Inet4AddressImpl.h" + +-#if defined(__GLIBC__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) ++#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD_version >= 601104)) + #define HAS_GLIBC_GETHOSTBY_R 1 + #endif + +diff -Naur openjdk.orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c openjdk/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c +--- openjdk.orig/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2017-01-30 11:02:08.137403055 -0800 ++++ openjdk/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c 2017-01-30 11:06:33.725833488 -0800 +@@ -41,7 +41,6 @@ + #endif + #ifdef __linux__ + #include +-#include + #include + #include + +diff -Naur openjdk.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c +--- openjdk.orig/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2017-01-30 11:02:08.138403064 -0800 ++++ openjdk/jdk/src/solaris/native/java/net/PlainSocketImpl.c 2017-01-30 11:06:42.985918836 -0800 +@@ -43,7 +43,6 @@ + #endif + #ifdef __linux__ + #include +-#include + #endif + + #include "jvm.h" +diff -Naur openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c openjdk/jdk/src/solaris/native/java/net/linux_close.c +--- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c 2017-01-30 11:02:08.139403072 -0800 ++++ openjdk/jdk/src/solaris/native/java/net/linux_close.c 2017-01-30 11:07:52.952560164 -0800 +@@ -56,7 +56,7 @@ + /* + * Signal to unblock thread + */ +-static int sigWakeup = (__SIGRTMAX - 2); ++static int sigWakeup; + + /* + * The fd table and the number of file descriptors +@@ -95,6 +95,9 @@ + /* + * Setup the signal handler + */ ++#ifndef __AIX ++ sigWakeup = SIGRTMAX - 2; ++#endif + sa.sa_handler = sig_wakeup; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); +diff -Naur openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c +--- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2017-01-30 11:02:08.172403368 -0800 ++++ openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c 2017-01-30 11:08:20.559810213 -0800 +@@ -36,7 +36,7 @@ + #include + #include + /* Also defined in net/linux_close.c */ +- #define INTERRUPT_SIGNAL (__SIGRTMAX - 2) ++ #define INTERRUPT_SIGNAL (SIGRTMAX - 2) + #elif __solaris__ + #include + #include diff --git a/dev-java/icedtea/icedtea-3.7.0.ebuild b/dev-java/icedtea/icedtea-3.7.0.ebuild index ed53482..4e04574 100644 --- a/dev-java/icedtea/icedtea-3.7.0.ebuild +++ b/dev-java/icedtea/icedtea-3.7.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # Build written by Andrew John Hughes (gnu_andrew@member.fsf.org) @@ -6,7 +6,7 @@ EAPI="6" SLOT="8" -inherit check-reqs gnome2-utils java-pkg-2 java-vm-2 multiprocessing pax-utils prefix versionator +inherit autotools check-reqs gnome2-utils java-pkg-2 java-vm-2 multiprocessing pax-utils prefix versionator ICEDTEA_VER=$(get_version_component_range 1-3) ICEDTEA_BRANCH=$(get_version_component_range 1-2) @@ -94,7 +94,6 @@ X_DEPEND=" # The Javascript requirement is obsolete; OpenJDK 8+ has Nashorn COMMON_DEP=" >=dev-libs/glib-2.26:2= - >=dev-util/systemtap-1 media-libs/fontconfig:1.0= >=media-libs/freetype-2.5.3:2= >=media-libs/lcms-2.5:2= @@ -150,22 +149,6 @@ DEPEND="${COMMON_DEP} ${ALSA_COMMON_DEP} ${CUPS_COMMON_DEP} ${X_COMMON_DEP} ${X_ S="${WORKDIR}"/${ICEDTEA_PKG} -# @FUNCTION: get_systemtap_arch -# @DESCRIPTION: -# Get arch name used in /usr/share/systemtap/tapset so we can -# install OpenJDK tapsets. - -get_systemtap_arch() { - local abi=${1-${ABI}} - - case ${abi} in - *_fbsd) get_systemtap_arch ${abi%_fbsd} ;; - amd64*) echo x86_64 ;; - ppc*) echo powerpc ;; - x86*) echo i386 ;; - *) echo ${abi} ;; - esac -} icedtea_check_requirements() { local CHECKREQS_DISK_BUILD @@ -200,6 +183,22 @@ src_unpack() { unpack ${SRC_PKG} } +src_prepare() { + ln -s "${FILESDIR}/jamvm-1.6.0-aarch64-support.patch" "${S}/patches/jamvm" || die + ln -s "${FILESDIR}/jamvm-1.6.0-opcode-guard.patch" "${S}/patches/jamvm" || die + ln -s "${FILESDIR}/${PN}-hotspot-musl.patch" patches || die + ln -s "${FILESDIR}/${PN}8-hotspot-noagent-musl.patch" patches || die + ln -s "${FILESDIR}/${PN}8-jdk-execinfo.patch" patches || die + ln -s "${FILESDIR}/${PN}8-jdk-fix-libjvm-load.patch" patches || die + ln -s "${FILESDIR}/${PN}8-jdk-musl.patch" patches || die + ln -s "${FILESDIR}/${PN}8-autoconf-config.patch" patches || die + ln -s "${FILESDIR}/${PN}8-gcc-triple.patch" patches || die + + eapply "${FILESDIR}/${PN}8-disable-systemtap.patch" + eapply_user + eautoreconf +} + src_configure() { # For bootstrap builds as the sandbox control file might not yet exist. addpredict /proc/self/coredump_filter @@ -210,6 +209,20 @@ src_configure() { local cacao_config config hotspot_port hs_config jamvm_config use_cacao use_jamvm use_zero zero_config local vm=$(java-pkg_get-current-vm) + DISTRIBUTION_PATCHES="" + + DISTRIBUTION_PATCHES+="patches/jamvm/jamvm-1.6.0-aarch64-support.patch " + DISTRIBUTION_PATCHES+="patches/jamvm/jamvm-1.6.0-opcode-guard.patch " + DISTRIBUTION_PATCHES+="patches/${PN}-hotspot-musl.patch " + DISTRIBUTION_PATCHES+="patches/${PN}8-hotspot-noagent-musl.patch " + DISTRIBUTION_PATCHES+="patches/${PN}8-jdk-execinfo.patch " + DISTRIBUTION_PATCHES+="patches/${PN}8-jdk-fix-libjvm-load.patch " + DISTRIBUTION_PATCHES+="patches/${PN}8-jdk-musl.patch " + DISTRIBUTION_PATCHES+="patches/${PN}8-autoconf-config.patch " + DISTRIBUTION_PATCHES+="patches/${PN}8-gcc-triple.patch " + + export DISTRIBUTION_PATCHES + # gcj-jdk ensures ecj is present. if use jbootstrap || has "${vm}" gcj-jdk; then use jbootstrap || einfo "bootstrap is necessary when building with ${vm}, ignoring USE=\"-jbootstrap\"" @@ -355,7 +368,6 @@ src_install() { local dest="/usr/$(get_libdir)/icedtea${SLOT}" local ddest="${ED}${dest#/}" - local stapdest="/usr/share/systemtap/tapset/$(get_systemtap_arch)" if ! use alsa; then rm -v "${ddest}"/jre/lib/$(get_system_arch)/libjsoundalsa.* || die @@ -371,14 +383,6 @@ src_install() { dosym /usr/share/doc/${PF} /usr/share/doc/${PN}${SLOT} - # Link SystemTap tapsets into SystemTap installation directory - mkdir -p "${ED}/${stapdest}" - for tapsets in "${ddest}"/tapset/*.stp; do - tapname=$(basename ${tapsets}) - destname=${tapname/./-${SLOT}.} - dosym "${dest}"/tapset/${tapname} ${stapdest}/${destname} - done - # Fix the permissions. find "${ddest}" \! -type l \( -perm /111 -exec chmod 755 {} \; -o -exec chmod 644 {} \; \) || die