summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/openjdk-10-setsignalhandler.patch
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2023-04-05 15:50:24 +0200
committerAndreas Enge <andreas@enge.fr>2023-04-05 15:52:00 +0200
commita0cf2bb5f1d28b636574fb6b974dd7ba1ded6d2d (patch)
tree749af58a4b617c99159500cf21938c505d5359e8 /gnu/packages/patches/openjdk-10-setsignalhandler.patch
parentb7c8a69fd8e038990f1489c9d85def5b2cae52a8 (diff)
gnu: openjdk10: Add patches to fix build.
* gnu/packages/patches/openjdk-10-pointer-comparison.patch, gnu/packages/patches/openjdk-10-setsignalhandler.patch: New files. * gnu/local.mk (dist_patch_DATA): Register patches. * gnu/packages/java.scm (openjdk10)[origin]: Use patches.
Diffstat (limited to 'gnu/packages/patches/openjdk-10-setsignalhandler.patch')
-rw-r--r--gnu/packages/patches/openjdk-10-setsignalhandler.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/gnu/packages/patches/openjdk-10-setsignalhandler.patch b/gnu/packages/patches/openjdk-10-setsignalhandler.patch
new file mode 100644
index 0000000000..c91ae6b318
--- /dev/null
+++ b/gnu/packages/patches/openjdk-10-setsignalhandler.patch
@@ -0,0 +1,25 @@
+Patch inspired by file comparison with openjdk@19.
+
+diff -u -r openjdk-10.alt/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c openjdk-10/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c
+--- openjdk-10.alt/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2023-04-05 15:03:00.070787628 +0200
++++ openjdk-10/test/hotspot/jtreg/runtime/StackGuardPages/exeinvoke.c 2023-04-05 15:29:51.379824348 +0200
+@@ -67,8 +67,17 @@
+ longjmp(context, 1);
+ }
+
+-void set_signal_handler() {
+- static char altstack[SIGSTKSZ];
++static char* altstack = NULL;
++
++ void set_signal_handler() {
++ if (altstack == NULL) {
++ // Dynamically allocated in case SIGSTKSZ is not constant
++ altstack = (char*)malloc(SIGSTKSZ);
++ if (altstack == NULL) {
++ fprintf(stderr, "Test ERROR. Unable to malloc altstack space\n");
++ exit(7);
++ }
++ }
+
+ stack_t ss = {
+ .ss_size = SIGSTKSZ,