aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2014-02-19 07:47:27 +0000
committerTimo Teräs <timo.teras@iki.fi>2014-02-19 07:50:34 +0000
commit20eae13751573f2ba970f44d16674cbaaf69e101 (patch)
treea1fe0f8ac56566b6147eee9f42c3a76b64611a45 /main/gcc
parent3a5340eca2273ccb3f8e3b38e40283c56e6cbaf8 (diff)
downloadaports-20eae13751573f2ba970f44d16674cbaaf69e101.tar.bz2
aports-20eae13751573f2ba970f44d16674cbaaf69e101.tar.xz
main/gcc: java/musl fixes
Diffstat (limited to 'main/gcc')
-rw-r--r--main/gcc/APKBUILD10
-rw-r--r--main/gcc/fix-gcj-iconv-musl.patch120
-rw-r--r--main/gcc/fix-gcj-musl.patch49
3 files changed, 178 insertions, 1 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 47e068000b..206cc4dec1 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -13,7 +13,7 @@ _cross=""
&& _cross="-$CTARGET"
pkgname="$pkgname$_cross"
-pkgrel=4
+pkgrel=5
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
arch="all"
@@ -182,6 +182,8 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2
gcc-pure64.patch
pr49423.patch
pr57748.patch
+ fix-gcj-musl.patch
+ fix-gcj-iconv-musl.patch
gcc-4.8-build-args.patch
fix-cxxflags-passing.patch
@@ -678,6 +680,8 @@ ab83248e10b2bf4b3d9240de0fefb52b pt_gnu_eh_frame.patch
2e2b787bb988d9007c9f7ce42178dfe6 gcc-pure64.patch
762a7134017fe1056aaa6388b9b3a2d5 pr49423.patch
fb28fd941c110627b7b9ca523d66b8d6 pr57748.patch
+14fc0a0b925ef911ce78cd030fe58902 fix-gcj-musl.patch
+e17bbb0fe802974e20645b4182b4c410 fix-gcj-iconv-musl.patch
0a2041bbf83648e6c4f6d3484f7249ca gcc-4.8-build-args.patch
4aea37d334ab00bb6bba37cd8c481367 fix-cxxflags-passing.patch
87684048ecaaf0e046983bc2782292dd fix-cxxflags-for-target.patch
@@ -722,6 +726,8 @@ fffdcf25b71526be739685f927ab0d66c72afff34ec54dc147ba62b262935007 gcc-4.8-musl.p
f5473c6aea96d5137defd68898ba31042944a3f3ed26c05b964a40bd876c6f47 gcc-pure64.patch
d68d6680b3ab996b4b8dde2ddc351cecb46b560dc743d112e682c596696b67bb pr49423.patch
999fdf60b3a51435e7485a57e12c1110a2af3965e14528f77d5dd0917115011d pr57748.patch
+22c78cc4a2658ff574e7ded1e5bc765a4f81f730d12e72d5883fe0bf73e71220 fix-gcj-musl.patch
+51782c972ab828eb4ccb3ca3570341d025b2ae9a8e8fd8188cefb29c5f87401b fix-gcj-iconv-musl.patch
bd7a6f514fcc457f29e5fda157203f3bcd013aeba5d53b3459196eef3ce752ab gcc-4.8-build-args.patch
a395ba4cf047c48cac56985726fddf0948f4425c9f1a0c9ddba1812b2b3d8300 fix-cxxflags-passing.patch
a5678380e887dbf600c59273d382e81c10f89d28e422238a617d0a43ad5c5a69 fix-cxxflags-for-target.patch
@@ -766,6 +772,8 @@ bda845a6aa1854d2c883910b115f79ccfa93dfc2b5eac69a3a236d83eb34cadc140731d616ffc246
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
b01ec5b2718e74048102d4a8e0a851f63524c9b9a70631ec93467b2e6080e8db2c500040572f64dce8161ef2c955bc1a7abd77d0e7970143967f9c8e0e3de948 pr49423.patch
018a9f2b7b490066a02671be38e1a4f18caeff98210027e68a1d4bd3d78ff810aa45a5cca163f4c46ee0d120715541a95a6e2487e17f4bb923459dec8edf8f8f pr57748.patch
+f89ddeb21bc8f97e6a850a6b70b4501a8f3e49a4bc8cc82897488decda5d98ad01cb7f6c8b392d452e9579924a523bc75da6e0648c1c976d42e40af48b10343b fix-gcj-musl.patch
+54d67cc008b735e47771314171930c5d8b8f5f5dc97fcf4214824c105c808f3e75d22d5a4fdf5068ed0457fa0d46c60cfb442e276259a4a5e9b8722a027d18e6 fix-gcj-iconv-musl.patch
abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch
c731f4aaaa65c8950e1b2bd9331410f92d378fd8c7e718532dccaa27ee11984d51d74216c3611e89a802325b81d7f184116839dce2dab50cae9b643c20a82fe7 fix-cxxflags-for-target.patch
diff --git a/main/gcc/fix-gcj-iconv-musl.patch b/main/gcc/fix-gcj-iconv-musl.patch
new file mode 100644
index 0000000000..b0015751e2
--- /dev/null
+++ b/main/gcc/fix-gcj-iconv-musl.patch
@@ -0,0 +1,120 @@
+--- gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc.orig 2014-02-18 18:46:14.897880526 +0200
++++ gcc-4.8.2/libjava/gnu/gcj/convert/natIconv.cc 2014-02-18 18:50:08.766613550 +0200
+@@ -24,6 +24,13 @@
+
+ #ifdef HAVE_ICONV
+ #include <iconv.h>
++#include <endian.h>
++
++#if __BYTE_ORDER == __BIG_ENDIAN
++#define UCS2_CHARSET "UCS-2BE"
++#else
++#define UCS2_CHARSET "UCS-2LE"
++#endif
+
+ template<typename T>
+ static inline size_t
+@@ -45,7 +52,7 @@
+ _Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
+ buffer[len] = '\0';
+
+- iconv_t h = iconv_open ("UCS-2", buffer);
++ iconv_t h = iconv_open (UCS2_CHARSET, buffer);
+ if (h == (iconv_t) -1)
+ throw new ::java::io::UnsupportedEncodingException (encoding);
+
+@@ -99,18 +106,6 @@
+ throw new ::java::io::CharConversionException ();
+ }
+
+- if (iconv_byte_swap)
+- {
+- size_t max = (old_out - outavail) / sizeof (jchar);
+- for (size_t i = 0; i < max; ++i)
+- {
+- // Byte swap.
+- jchar c = (((out[outpos + i] & 0xff) << 8)
+- | ((out[outpos + i] >> 8) & 0xff));
+- outbuf[i] = c;
+- }
+- }
+-
+ inpos += old_in - inavail;
+ return (old_out - outavail) / sizeof (jchar);
+ #else /* HAVE_ICONV */
+@@ -145,7 +140,7 @@
+ _Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
+ buffer[len] = '\0';
+
+- iconv_t h = iconv_open (buffer, "UCS-2");
++ iconv_t h = iconv_open (buffer, UCS2_CHARSET);
+ if (h == (iconv_t) -1)
+ throw new ::java::io::UnsupportedEncodingException (encoding);
+
+@@ -187,20 +182,6 @@
+ char *inbuf = (char *) &chars[inpos];
+ char *outbuf = (char *) &out[count];
+
+- if (iconv_byte_swap)
+- {
+- // Ugly performance penalty -- don't use losing systems!
+- temp_buffer = (jchar *) _Jv_Malloc (inlength * sizeof (jchar));
+- for (int i = 0; i < inlength; ++i)
+- {
+- // Byte swap.
+- jchar c = (((chars[inpos + i] & 0xff) << 8)
+- | ((chars[inpos + i] >> 8) & 0xff));
+- temp_buffer[i] = c;
+- }
+- inbuf = (char *) temp_buffer;
+- }
+-
+ size_t loop_old_in = old_in;
+ while (1)
+ {
+@@ -252,44 +233,7 @@
+ jboolean
+ gnu::gcj::convert::IOConverter::iconv_init (void)
+ {
+- // Some versions of iconv() always return their UCS-2 results in
+- // big-endian order, and they also require UCS-2 inputs to be in
+- // big-endian order. For instance, glibc 2.1.3 does this. If the
+- // UTF-8=>UCS-2 iconv converter has this feature, then we assume
+- // that all UCS-2 converters do. (This might not be the best
+- // heuristic, but is is all we've got.)
+- jboolean result = false;
+-#ifdef HAVE_ICONV
+- iconv_t handle = iconv_open ("UCS-2", "UTF-8");
+- if (handle != (iconv_t) -1)
+- {
+- jchar c;
+- unsigned char in[4];
+- char *inp, *outp;
+- size_t inc, outc, r;
+-
+- // This is the UTF-8 encoding of \ufeff. At least Tru64 UNIX libiconv
+- // needs the trailing NUL byte, otherwise iconv fails with EINVAL.
+- in[0] = 0xef;
+- in[1] = 0xbb;
+- in[2] = 0xbf;
+- in[3] = 0x00;
+-
+- inp = (char *) in;
+- inc = 4;
+- outp = (char *) &c;
+- outc = 2;
+-
+- r = iconv_adapter (iconv, handle, &inp, &inc, &outp, &outc);
+- // Conversion must be complete for us to use the result.
+- if (r != (size_t) -1 && inc == 0 && outc == 0)
+- result = (c != 0xfeff);
+-
+- // Release iconv handle.
+- iconv_close (handle);
+- }
+-#endif /* HAVE_ICONV */
+- return result;
++ return false;
+ }
+
+ void
diff --git a/main/gcc/fix-gcj-musl.patch b/main/gcc/fix-gcj-musl.patch
new file mode 100644
index 0000000000..d26f510c0b
--- /dev/null
+++ b/main/gcc/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));