summaryrefslogtreecommitdiff
path: root/legacy/gcc6/fix-gcj-musl.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2022-07-02 18:51:15 -0500
committerZach van Rijn <me@zv.io>2022-10-21 18:34:01 -0500
commit57b3454125ff268fb900c0d60b267535857bcd93 (patch)
treefb977ce1b0bdb0b6cbd6454809a86d1705277c8e /legacy/gcc6/fix-gcj-musl.patch
parent04142312762064baaf4765e13b479d9e03cfad47 (diff)
downloadpackages-57b3454125ff268fb900c0d60b267535857bcd93.tar.gz
packages-57b3454125ff268fb900c0d60b267535857bcd93.tar.bz2
packages-57b3454125ff268fb900c0d60b267535857bcd93.tar.xz
packages-57b3454125ff268fb900c0d60b267535857bcd93.zip
legacy/gcc6: add buildable patches
Diffstat (limited to 'legacy/gcc6/fix-gcj-musl.patch')
-rw-r--r--legacy/gcc6/fix-gcj-musl.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/legacy/gcc6/fix-gcj-musl.patch b/legacy/gcc6/fix-gcj-musl.patch
new file mode 100644
index 000000000..d26f510c0
--- /dev/null
+++ b/legacy/gcc6/fix-gcj-musl.patch
@@ -0,0 +1,49 @@
+--- gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc.orig 2014-02-18 10:55:08.617678779 +0200
++++ gcc-4.8.2/libjava/gnu/classpath/natSystemProperties.cc 2014-02-18 10:56:31.927227453 +0200
+@@ -289,7 +289,7 @@
+ // just default to `en_US'.
+ setlocale (LC_ALL, "");
+ char *locale = setlocale (LC_MESSAGES, "");
+- if (locale && strlen (locale) >= 2)
++ if (locale && strlen (locale) >= 2 && (locale[2] == '\0' || locale[2] == '_'))
+ {
+ char buf[3];
+ buf[2] = '\0';
+--- gcc-4.8.2/libjava/posix-threads.cc.orig 2014-02-18 13:22:01.789933726 +0200
++++ gcc-4.8.2/libjava/posix-threads.cc 2014-02-18 13:29:50.924058875 +0200
+@@ -657,6 +657,7 @@
+ struct sched_param param;
+ pthread_attr_t attr;
+ struct starter *info;
++ size_t ss;
+
+ if (data->flags & FLAG_START)
+ return;
+@@ -675,8 +676,25 @@
+ // Set stack size if -Xss option was given.
+ if (gcj::stack_size > 0)
+ {
+- int e = pthread_attr_setstacksize (&attr, gcj::stack_size);
++ ss = gcj::stack_size;
++ }
++ else
++ {
++ int e = pthread_attr_getstacksize (&attr, &ss);
++ if (e != 0)
++ JvFail (strerror (e));
++
++ // Request at least 1meg of stack
++ if (ss >= 1024 * 1024)
++ ss = 0;
++ else
++ ss = 1024 * 1024;
++ }
++
++ if (ss)
++ {
++ int e = pthread_attr_setstacksize (&attr, ss);
+ if (e != 0)
+ JvFail (strerror (e));
+ }
+
+ info = (struct starter *) _Jv_AllocBytes (sizeof (struct starter));