void-packages/srcpkgs/gcc6/patches/502-fix-gcj-musl.patch
q66 6f1c7ff607 New package: gcc6-6.5.0
This is the first part of an effort to allow bootstrapping openjdk
without downloading any binaries. The next part will be an openjdk7
package that will be used to bootstrap openjdk8.

After that, we can proceed to add the missing parts to go all the
way up to 11.

[ci skip]
2019-11-15 22:56:51 +01:00

49 lines
1.4 KiB
Diff

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