Commit 356b47d2 authored by Simon F's avatar Simon F Committed by Natanael Copa

testing/openjdk9: New aport

parent 81e24164
# Contributor: Simon Frankenberger <simon-alpine@fraho.eu>
# Maintainer: Simon Frankenberger <simon-alpine@fraho.eu>
pkgname=openjdk9
_pkgver=9.0.4+12
pkgver=${_pkgver/+/.}
pkgrel=0
pkgdesc="Oracle OpenJDK 9"
url="https://hg.openjdk.java.net/jdk-updates/jdk9u"
arch="all"
license="GPL-2.0 with Classpath"
makedepends="autoconf
bash
gawk
grep
make
openjdk8
zip
alsa-lib-dev
cups-dev
freetype-dev
giflib-dev
lcms2-dev
libelf-dev
libexecinfo-dev
libffi-dev
libjpeg-turbo-dev
libx11-dev
libxext-dev
libxrender-dev
libxt-dev
libxtst-dev
linux-headers
zlib-dev
"
depends="$pkgname-jmods $pkgname-demos $pkgname-doc $pkgname-dbg $pkgname-jdk" # for the virtual openjdk9 package
subpackages="$pkgname-jmods:_jmods:noarch
$pkgname-demos:_demos:noarch
$pkgname-doc:_doc:noarch
$pkgname-dbg:_dbg
$pkgname-jre-headless:_jre_headless
$pkgname-jre:_jre
$pkgname-jdk:_jdk
"
source="jdk-$_pkgver-root.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-corba.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/corba/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-hotspot.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/hotspot/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-jaxp.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/jaxp/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-jaxws.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/jaxws/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-jdk.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/jdk/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-langtools.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/langtools/archive/jdk-$_pkgver.tar.bz2
jdk-$_pkgver-nashorn.tar.bz2::http://hg.openjdk.java.net/jdk-updates/jdk9u/nashorn/archive/jdk-$_pkgver.tar.bz2
2019-01-05_config.sub::https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;h=3b4c7624b68d2d7f84618e1b5fa2badd43a48325;hb=286a38db91ea2dce1749ab7d1d9ea5ae344a16c1
build.patch
aarch64.patch
arm.patch
ppc64le.patch
x86.patch
HelloWorld.java
"
builddir="$srcdir/jdk9u-jdk-$_pkgver"
_java_home="/usr/lib/jvm/java-9-openjdk"
ldpath="$_java_home/lib:$_java_home/lib/jli:$_java_home/lib/server"
sonameprefix="$pkgname:"
# enable running the JTReg tests in check?
# see comment in that function for explanation
_run_jtreg=0
if [ $_run_jtreg -ne 0 ]; then
makedepends="$makedepends java-jtreg"
checkdepends="$checkdepends ttf-freefont xvfb"
fi
unpack() {
if [ -z "$force" ]; then
verify
initdcheck
fi
mkdir -p "$srcdir"
msg "Unpacking root.tar.bz2"
tar -C "$srcdir" -jxf jdk-$_pkgver-root.tar.bz2
for i in corba hotspot jaxp jaxws jdk langtools nashorn; do
msg "Unpacking $i.tar.bz2"
mkdir $builddir/$i
tar -C $builddir/$i --strip-components=1 -jxf "$srcdir/jdk-$_pkgver-$i.tar.bz2"
done
}
build() {
cd "$builddir"
# update the config.sub file to detect alpine
cp $srcdir/2019-01-05_config.sub common/autoconf/build-aux/autoconf-config.sub
# remove not compilable module (hotspot jdk.hotspot.agent)
# this needs libthread_db which is only provided by glibc
#
# haven't found any way to disable this module so just remove it.
rm -r hotspot/src/jdk.hotspot.agent
if [ $_run_jtreg -ne 0 ]; then
_with_jtreg="--with-jtreg=/usr/share/java/jtreg"
else
_with_jtreg="--with-jtreg=no"
fi
CFLAGS= CXXFLAGS= LDFLAGS= \
bash ./configure \
--openjdk-target=$CHOST \
--prefix="$_java_home" \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
--with-extra-cflags="$CFLAGS" \
--with-extra-cxxflags="$CXXFLAGS" \
--with-extra-ldflags="$LDFLAGS" \
--with-zlib=system \
--with-libjpeg=system \
--with-giflib=system \
--with-libpng=system \
--with-lcms=system \
--with-jobs=${JOBS:-4} \
--with-test-jobs=${JOBS:-4} \
--with-native-debug-symbols=external \
$_with_jtreg \
--disable-warnings-as-errors \
--disable-precompiled-headers \
--enable-dtrace=no \
--with-jvm-variants=server \
--with-debug-level=release \
--with-version-pre= \
--with-version-opt=alpine-r${pkgrel} \
--with-version-build=${_pkgver#*+}
MAKEFLAGS= make jdk-image
}
check() {
cd "$builddir"
# compile and run a simple hello world
cp "$srcdir/HelloWorld.java" .
./build/*-normal-server-release/images/jdk/bin/javac HelloWorld.java
./build/*-normal-server-release/images/jdk/bin/java HelloWorld
# run the gtest unittest suites
# they don't take long, DO NOT DISABLE THEM!
MAKEFLAGS= make test-hotspot-gtest
# The jtreg tests take very, very long to finish and show some failures (9 - 12 on my machine, varying between runs)
# I think these are not critical and can be safely ignored.
# As the tests take too long, they are disabled by default.
# When updating this aport please let them run at least once on your machine to see if the failure count changes.
if [ $_run_jtreg -ne 0 ]; then
_logfile=$( mktemp -p "$builddir" )
if [ -z "$DISPLAY" ]; then
Xvfb :99 &
_xvfb_pid=$!
DISPLAY=:99
fi
MAKEFLAGS= DISPLAY=$DISPLAY make \
run-test-tier1 \
run-test-tier2 \
run-test-tier3 \
| tee "$_logfile"
msg "---------------------------------------"
msg "The build log can be found at $_logfile"
if [ -n "$_xvfb_pid" ]; then
kill $_xvfb_pid
fi
false
fi
}
package() {
cd "$builddir"
mkdir -p "$pkgdir/$_java_home"
cp -r build/*-normal-server-release/images/jdk/* "$pkgdir/$_java_home"
}
_jmods() {
pkgdesc="Oracle OpenJDK 9 (jmods)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/jmods" "$_toroot"
}
_demos() {
pkgdesc="Oracle OpenJDK 9 (demos)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/demo" "$_toroot"
}
_doc() {
pkgdesc="Oracle OpenJDK 9 (Documentation)"
depends=""
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/man" "$_toroot"
}
_dbg() {
pkgdesc="Oracle OpenJDK 9 (debug)"
depends="$pkgname-jdk"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot/lib/server"
mkdir -p "$_toroot/lib/jli"
mv "$_fromroot"/lib/server/*.debuginfo "$_toroot"/lib/server
mv "$_fromroot"/lib/jli/*.debuginfo "$_toroot"/lib/jli
mv "$_fromroot"/lib/*.debuginfo "$_toroot"/lib
}
_jre_headless() {
pkgdesc="Oracle OpenJDK 9 (JRE headless)"
depends="java-common java-cacerts"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/lib" "$_toroot"
# move back unwanted libs
mkdir -p "$_fromroot/lib"
mv "$_toroot/lib/src.zip" \
"$_toroot/lib/libawt_xawt.so" \
"$_toroot/lib/libfontmanager.so" \
"$_toroot/lib/libjavajpeg.so" \
"$_toroot/lib/libjawt.so" \
"$_toroot/lib/libjsoundalsa.so" \
"$_toroot/lib/liblcms.so" \
"$_toroot/lib/libsplashscreen.so" \
"$_fromroot/lib"
mkdir -p "$_toroot/bin"
for i in appletviewer \
idlj \
java \
jjs \
jrunscript \
keytool \
orbd \
pack200 \
rmid \
rmiregistry \
servertool \
tnameserv \
unpack200; do
mv "$_fromroot/bin/$i" "$_toroot/bin/$i"
done
mv "$_fromroot/legal" "$_toroot"
mv "$_fromroot/conf" "$_toroot"
mv "$_fromroot/release" "$_toroot"
cp "$builddir/ASSEMBLY_EXCEPTION" "$_toroot"
cp "$builddir/LICENSE" "$_toroot"
cp "$builddir/README" "$_toroot"
# symlink to shared cacerts store
rm "$_toroot/lib/security/cacerts"
ln -sf /etc/ssl/certs/java/cacerts \
"$_toroot/lib/security/cacerts"
# symlink for java-common to work (expects jre in $_java_home/jre)
ln -sf . "$_toroot/jre"
}
_jre() {
pkgdesc="Oracle OpenJDK 9 (JRE)"
depends="$pkgname-jre-headless"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot/lib"
mv "$_fromroot/lib/libawt_xawt.so" \
"$_fromroot/lib/libfontmanager.so" \
"$_fromroot/lib/libjavajpeg.so" \
"$_fromroot/lib/libjawt.so" \
"$_fromroot/lib/libjsoundalsa.so" \
"$_fromroot/lib/liblcms.so" \
"$_fromroot/lib/libsplashscreen.so" \
"$_toroot/lib"
}
_jdk() {
pkgdesc="Oracle OpenJDK 9 (JDK)"
depends="$pkgname-jre"
_fromroot="$pkgdir/$_java_home"
_toroot="$subpkgdir/$_java_home"
mkdir -p "$_toroot"
mv "$_fromroot/lib" "$_toroot"
mv "$_fromroot/bin" "$_toroot"
mv "$_fromroot/include" "$_toroot"
}
sha512sums="cef3655ae7db657e6c81aa86587e451e58896bb6ee786495f6d757096334435b6a4de26ec3ec927da2487e135f09ce26414f8d6b9b9c508a28d3087be286b1ec jdk-9.0.4+12-root.tar.bz2
455998437a9e3ff538b921025d57e19e6fb5148b3f124c9c427c3604689884d81b3ce5c9dbd93d88de26bf1b43ce76d75f75afd95e473a94973a668575e41748 jdk-9.0.4+12-corba.tar.bz2
49d93764b13085a5626bec1c3d4e790f8748c24577a4e990e76bd1006721a5b8b9a256c40bf6419df4dda6f6390e457485f90c1b1101c010476a04d9056e9f16 jdk-9.0.4+12-hotspot.tar.bz2
82f28586fd576cc01062e2ff37a917987775838910e4a5ecdfd096abec1c8d23028b77bfc87a38ada53bc30d71d89bde7408c1ae572a43c87a71ced64fd08d3a jdk-9.0.4+12-jaxp.tar.bz2
459978a5e3ca21910781daed848229e043eea5bd82dcd20e9249934ec97a2a982126c6e37aac1a36719e3b73a5e6c8a92a50b63033149913614d8f3edfc0846e jdk-9.0.4+12-jaxws.tar.bz2
259228d3f439dde239e38cdebb8c3bbb83804ab141d87a9c236310707de9c58cd78cd80ceb4c17755cc1048071f24462839988112c2698f7ec1453a8810610f2 jdk-9.0.4+12-jdk.tar.bz2
ef3c70be906a4b0dd9c9195c88da045909ee3ef144941fb7b4495ed66b4162f481095cad87626d2bd38e5a62134b440223cd008dd6123b6b43c00e338610a692 jdk-9.0.4+12-langtools.tar.bz2
848c6ece418e250561572ad704baeb565580098cfc5f849d4e1a3b41b916aae3487eb4d8d0b319f3a503d122ec064ed4de0678d06821c9a2bdb09c990e589c97 jdk-9.0.4+12-nashorn.tar.bz2
74e3d868d766e605921542969dd2f646a8adec1b82181aaeb02b623a524cb9011e44c261d4e13ab24268c79c6bc1d260e62d41a928b1b402b186dc5676272e36 2019-01-05_config.sub
386490c3be4c9aa9dc4b73911bc0b97298ff8b1a50e53bd601f4d2a7b3e469f5b8e70e446b2bbe6876854302a373522b4819fde24c85eafc00f9524268096615 build.patch
3cc00d9b81377fdffb7f5b3f732a35cebd2575825d85df88330740903dd98de30fe75e69229811d52f2ef192c1df0715c2696edf31f64c8d7de4b502a16792e4 aarch64.patch
fa9fcc0c2f0972435b078669175c44f7d5d3cc29fbecb3e053d196c041ef0ff3feee8ec189a86fce0b35c5fd647ff71963a15e1e6fa50775cc2b6fa35d2ccf0a arm.patch
7244d0dfdb78d2f03ea992ef770ed888e2bd48f49e58438e7f0a763633c9aa8fc27b953d82c023f8f99ff23009a15031c99b2ef5550d277c63db684cd984ce8e ppc64le.patch
427c525e184e2a74f511aad8192dd411fe7fcc4e7a4dc03a3496fb030cec0177b3b520cbdd1c7700f6761a15ff2e5cce59c93d7079b744954122f684d34ce723 x86.patch
d1767dddd8e0956e25c0f77ed45c6fc86a1191bae1704a6dc33be490fd20eaa50461fe5c2a3349512059d555651e2eb41437dd3c1096c351e8ee68b4534a2579 HelloWorld.java"
public class HelloWorld {
public static void main(String[] args) { System.out.println("Hello World!"); }
}
--- old/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
+++ new/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp
@@ -77,7 +77,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef BUILTIN_SIM
#define REG_SP REG_RSP
--- old/hotspot/src/os_cpu/linux_arm/vm/os_linux_arm.cpp
+++ new/hotspot/src/os_cpu/linux_arm/vm/os_linux_arm.cpp
@@ -71,7 +71,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
# include <asm/ptrace.h>
#define SPELL_REG_SP "sp"
@@ -104,6 +103,18 @@
#define ARM_REGS_IN_CONTEXT 31
#else
+
+// Stupid hack as the origin if below doesnt compile with gcc 8.2.0:
+//
+// os_linux_arm.cpp:114:5: error: missing binary operator before token "("
+// #if NGREG == 16
+// ^~~~~
+//
+// The NGREG is 18, so force it to that value.
+#ifdef NGREG
+# undef NGREG
+#endif
+#define NGREG 18
#if NGREG == 16
// These definitions are based on the observation that until
--- old/common/autoconf/build-aux/config.guess
+++ new/common/autoconf/build-aux/config.guess
@@ -30,6 +30,17 @@
DIR=`dirname $0`
OUT=`. $DIR/autoconf-config.guess`
+# config.guess doesn't identify systems running the musl C library, and will
+# instead return a string with a -gnu suffix. This block detects musl and
+# modifies the string to have a -musl suffix instead.
+echo $OUT | grep -- -linux- > /dev/null 2> /dev/null
+if test $? = 0; then
+ ldd_version=`ldd --version 2>&1 | head -1 | cut -f1 -d' '`
+ if [ x"${ldd_version}" = x"musl" ]; then
+ OUT=`echo $OUT | sed 's/-gnu/-musl/'`
+ fi
+fi
+
# Test and fix solaris on x86_64
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
if test $? = 0; then
--- old/hotspot/make/lib/CompileJvm.gmk
+++ new/hotspot/make/lib/CompileJvm.gmk
@@ -135,6 +135,7 @@
-DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
-DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
-DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
+ -DLIBC='"musl"' \
#
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
--- old/hotspot/src/os/linux/vm/os_linux.cpp
+++ new/hotspot/src/os/linux/vm/os_linux.cpp
@@ -98,7 +98,6 @@
# include <string.h>
# include <syscall.h>
# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
# include <sys/ipc.h>
# include <sys/shm.h>
# include <link.h>
@@ -496,6 +495,11 @@
// detecting pthread library
void os::Linux::libpthread_init() {
+#if !defined(__GLIBC__) && !defined(__UCLIBC__)
+ // Hard code Alpine Linux supported musl compatible settings
+ os::Linux::set_glibc_version("glibc 2.9");
+ os::Linux::set_libpthread_version("NPTL");
+#else
// Save glibc and pthread version strings.
#if !defined(_CS_GNU_LIBC_VERSION) || \
!defined(_CS_GNU_LIBPTHREAD_VERSION)
@@ -513,6 +517,7 @@
str = (char *)malloc(n, mtInternal);
confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
os::Linux::set_libpthread_version(str);
+#endif
}
/////////////////////////////////////////////////////////////////////////////
@@ -2803,17 +2808,32 @@
extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
extern "C" JNIEXPORT void numa_error(char *where) { }
+static void* dlvsym_if_available(void* handle, const char* name, const char* version) {
+ typedef void* (*dlvsym_func_type)(void* handle, const char* name, const char* version);
+ static dlvsym_func_type dlvsym_func;
+ static bool initialized = false;
+ if (!initialized) {
+ dlvsym_func = (dlvsym_func_type)dlsym(RTLD_NEXT, "dlvsym");
+ initialized = true;
+ }
+
+ if (dlvsym_func != NULL) {
+ void *f = dlvsym_func(handle, name, version);
+ if (f != NULL) {
+ return f;
+ }
+ }
+
+ return dlsym(handle, name);
+}
+
// If we are running with libnuma version > 2, then we should
// be trying to use symbols with versions 1.1
// If we are running with earlier version, which did not have symbol versions,
// we should use the base version.
void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
- void *f = dlvsym(handle, name, "libnuma_1.1");
- if (f == NULL) {
- f = dlsym(handle, name);
- }
- return f;
+ return dlvsym_if_available(handle, name, "libnuma_1.1");
}
bool os::Linux::libnuma_init() {
--- old/hotspot/src/os/linux/vm/os_linux.inline.hpp
+++ new/hotspot/src/os/linux/vm/os_linux.inline.hpp
@@ -31,7 +31,7 @@
#include <unistd.h>
#include <sys/socket.h>
-#include <sys/poll.h>
+#include <poll.h>
#include <netdb.h>
// File names are case-sensitive on windows only
--- old/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ new/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -73,7 +73,6 @@
# include <pwd.h>
# include <poll.h>
# include <ucontext.h>
-# include <fpu_control.h>
#ifdef AMD64
#define REG_SP REG_RSP
--- old/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp
+++ new/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp
@@ -1017,7 +1017,7 @@
static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
bool first = true;
size_t min_size = 0; // "first" makes this conceptually infinite.
- ScratchBlock **smallest_ptr, *smallest;
+ ScratchBlock **smallest_ptr = NULL, *smallest;
ScratchBlock *cur = *prev_ptr;
while (cur) {
assert(*prev_ptr == cur, "just checking");
--- old/hotspot/src/share/vm/runtime/vm_version.cpp
+++ new/hotspot/src/share/vm/runtime/vm_version.cpp
@@ -263,7 +263,7 @@
#endif
#define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \
- " for " OS "-" CPU FLOAT_ARCH_STR \
+ " for " OS "-" CPU FLOAT_ARCH_STR LIBC \
" JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \
" by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER
--- old/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+++ new/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
@@ -216,7 +216,7 @@
#elif defined(__APPLE__)
inline int g_isnan(double f) { return isnan(f); }
#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
-inline int g_isnan(float f) { return isnanf(f); }
+inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
--- old/hotspot/test/runtime/StackGuardPages/exeinvoke.c
+++ new/hotspot/test/runtime/StackGuardPages/exeinvoke.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <jni.h>
+#include <jvm.h>
#include <alloca.h>
#include <signal.h>
#include <string.h>
@@ -91,6 +92,20 @@
}
}
+int get_java_stacksize () {
+ size_t stacksize;
+ pthread_attr_t attr;
+ JDK1_1InitArgs jdk_args;
+
+ jdk_args.version = JNI_VERSION_1_1;
+ JNI_GetDefaultJavaVMInitArgs(&jdk_args);
+ if (jdk_args.javaStackSize <= 0) {
+ fprintf(stderr, "Test ERROR. Can't get a valid value for the default stacksize.\n");
+ exit(7);
+ }
+ return jdk_args.javaStackSize;
+}
+
void *run_java_overflow (void *p) {
JNIEnv *env;
jclass class_id;
@@ -254,13 +269,19 @@
exit(7);
}
+ int stack_size = get_java_stacksize();
pthread_t thr;
+ pthread_attr_t thread_attr;
+ pthread_attr_init(&thread_attr);
+ pthread_attr_setstacksize(&thread_attr, stack_size);
+
if (argc > 1 && strcmp(argv[1], "test_java_overflow") == 0) {
printf("\nTesting JAVA_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_java_overflow, NULL);
+
+ pthread_create (&thr, &thread_attr, run_java_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
@@ -273,7 +294,7 @@
printf("\nTesting NATIVE_OVERFLOW\n");
printf("Testing stack guard page behaviour for other thread\n");
- pthread_create (&thr, NULL, run_native_overflow, NULL);
+ pthread_create (&thr, &thread_attr, run_native_overflow, NULL);
pthread_join (thr, NULL);
printf("Testing stack guard page behaviour for initial thread\n");
--- old/jdk/make/lib/CoreLibraries.gmk
+++ new/jdk/make/lib/CoreLibraries.gmk
@@ -339,6 +339,7 @@
endif
LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
+LIBJLI_CFLAGS += -DLIBC=\"musl\"
ifneq ($(USE_EXTERNAL_LIBZ), true)
LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
--- old/jdk/src/java.base/linux/native/libnet/linux_close.c
+++ new/jdk/src/java.base/linux/native/libnet/linux_close.c
@@ -58,7 +58,7 @@
/*
* Signal to unblock thread
*/
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
/*
* fdTable holds one entry per file descriptor, up to a certain
@@ -147,6 +147,7 @@
/*
* Setup the signal handler
*/
+ sigWakeup = SIGRTMAX - 2;
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
--- old/jdk/src/java.base/unix/native/include/jvm_md.h
+++ new/jdk/src/java.base/unix/native/include/jvm_md.h
@@ -65,7 +65,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
-#include <sys/signal.h>
+#include <signal.h>
/* O Flags */
--- old/jdk/src/java.base/unix/native/libjava/childproc.c
+++ new/jdk/src/java.base/unix/native/libjava/childproc.c
@@ -237,7 +237,13 @@
{
if (envp == NULL || (char **) envp == environ) {
execvp(file, (char **) argv);
- return;
+ // ENOEXEC indicates that the file header was not recognized. The musl C
+ // library does not implement the fallback to /bin/sh for that case, so fall
+ // through to the code below which implements that fallback using
+ // execve_with_shell_fallback.