summaryrefslogtreecommitdiff
path: root/system/gcc/fix-gcj-iconv-musl.patch
diff options
context:
space:
mode:
authorLaurent Bercot <ska-adelie@skarnet.org>2019-03-07 00:23:26 +0000
committerLaurent Bercot <ska-adelie@skarnet.org>2019-03-07 00:23:26 +0000
commit5dba7907e14196aa368b0d84d3a2df7a0fd55123 (patch)
tree56fdada6ebda794f877de30628ac949a0f3a46f6 /system/gcc/fix-gcj-iconv-musl.patch
parent506539dec83c52b7e24bbd3f98cb8bea68b2d886 (diff)
parent89573ea3c2e8ec27ad4433a00fa238f7be475c54 (diff)
downloadpackages-5dba7907e14196aa368b0d84d3a2df7a0fd55123.tar.gz
packages-5dba7907e14196aa368b0d84d3a2df7a0fd55123.tar.bz2
packages-5dba7907e14196aa368b0d84d3a2df7a0fd55123.tar.xz
packages-5dba7907e14196aa368b0d84d3a2df7a0fd55123.zip
Merge branch 'master' of code.foxkit.us:adelie/packages
Diffstat (limited to 'system/gcc/fix-gcj-iconv-musl.patch')
-rw-r--r--system/gcc/fix-gcj-iconv-musl.patch120
1 files changed, 0 insertions, 120 deletions
diff --git a/system/gcc/fix-gcj-iconv-musl.patch b/system/gcc/fix-gcj-iconv-musl.patch
deleted file mode 100644
index b0015751e..000000000
--- a/system/gcc/fix-gcj-iconv-musl.patch
+++ /dev/null
@@ -1,120 +0,0 @@
---- 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