summaryrefslogtreecommitdiffstats
path: root/main/openjdk6/icedtea-jdk-musl.patch
blob: d0710b646dd2d7d3c6cc37bdb4e1f4ef544e33d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
--- openjdk.orig/jdk/src/share/native/sun/awt/medialib/mlib_types.h
+++ openjdk/jdk/src/share/native/sun/awt/medialib/mlib_types.h
@@ -27,6 +27,7 @@
 #ifndef MLIB_TYPES_H
 #define MLIB_TYPES_H
 
+#include <stddef.h>			/* for NULL */
 #include <limits.h>
 #if defined(_MSC_VER)
 #include <float.h>                      /* for FLT_MAX and DBL_MAX */
--- openjdk.orig/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c
+++ openjdk/jdk/src/solaris/hpi/native_threads/src/sys_api_td.c
@@ -64,11 +64,11 @@
 #endif /* NO_INTERRUPTIBLE_IO */
 
 /*
- * Linux <sys/resource.h> does not define rlim_t (solaris
+ * GLIBC <sys/resource.h> does not define rlim_t (solaris
  * does). THIS IS PROBABLY NOT THE RIGHT THING TO DO, so
  * somebody please fix this.
  */
-#ifdef __linux__
+#ifdef __GLIBC__
 typedef int rlim_t ;
 #else
 #include <sys/resource.h>
--- openjdk.orig/jdk/src/solaris/native/java/io/UnixFileSystem_md.c
+++ openjdk/jdk/src/solaris/native/java/io/UnixFileSystem_md.c
@@ -66,7 +66,7 @@
  * linux_largefile.h with a good stat64 structure to compile on
  * glibc2.0 based systems.
  */
-#if defined(__solaris__) && !defined(_LFS_LARGEFILE) || !_LFS_LARGEFILE
+#if defined(__solaris__) && (!defined(_LFS_LARGEFILE) || !_LFS_LARGEFILE)
 
 /* The stat64 structure must be provided for systems without large-file support
    (e.g., Solaris 2.5.1).  These definitions are copied from the Solaris 2.6
--- openjdk.orig/jdk/src/solaris/native/java/lang/java_props_md.c
+++ openjdk/jdk/src/solaris/native/java/lang/java_props_md.c
@@ -45,11 +45,13 @@
 #include "locale_str.h"
 #include "java_props.h"
 
+#if !defined(CODESET)
 #ifdef __linux__
 #define CODESET _NL_CTYPE_CODESET_NAME
 #else
 #ifdef ALT_CODESET_KEY
 #define CODESET ALT_CODESET_KEY
+#endif
 #endif
 #endif
 
--- openjdk.orig/jdk/src/solaris/native/java/net/Inet4AddressImpl.c
+++ openjdk/jdk/src/solaris/native/java/net/Inet4AddressImpl.c
@@ -45,6 +45,11 @@
 #define HENT_BUF_SIZE 1024
 #define BIG_HENT_BUF_SIZE 10240  /* a jumbo-sized one */
 
+/* glibc vs. linux confusion, define glibc locally to fix musl build */
+#if defined(__linux__) && !defined(__GLIBC__)
+#define __GLIBC__
+#endif
+
 #ifndef __GLIBC__
 /* gethostname() is in libc.so but I can't find a header file for it */
 extern int gethostname(char *buf, int buf_len);
--- openjdk.orig/jdk/src/solaris/native/java/net/Inet6AddressImpl.c
+++ openjdk/jdk/src/solaris/native/java/net/Inet6AddressImpl.c
@@ -48,6 +48,11 @@
 #define NI_MAXHOST 1025
 #endif
 
+/* glibc vs. linux confusion, define glibc locally to fix musl build */
+#if defined(__linux__) && !defined(__GLIBC__)
+#define __GLIBC__
+#endif
+
 #ifndef __GLIBC__
 /* gethostname() is in libc.so but I can't find a header file for it */
 extern int gethostname(char *buf, int buf_len);
--- openjdk.orig/jdk/src/solaris/native/java/net/NetworkInterface.c
+++ openjdk/jdk/src/solaris/native/java/net/NetworkInterface.c
@@ -40,7 +40,6 @@
 #endif
 #ifdef __linux__
 #include <sys/ioctl.h>
-#include <bits/ioctls.h>
 #include <linux/sockios.h>
 #include <sys/utsname.h>
 #include <stdio.h>
--- openjdk.orig/jdk/src/solaris/native/java/net/linux_close.c
+++ openjdk/jdk/src/solaris/native/java/net/linux_close.c
@@ -59,7 +59,7 @@
 /*
  * Signal to unblock thread
  */
-static int sigWakeup = (__SIGRTMAX - 2);
+static int sigWakeup;
 
 /*
  * The fd table and the number of file descriptors
@@ -98,6 +98,7 @@
     /*
      * Setup the signal handler
      */
+    sigWakeup = SIGRTMAX - 2;
     sa.sa_handler = sig_wakeup;
     sa.sa_flags   = 0;
     sigemptyset(&sa.sa_mask);
--- openjdk.orig/jdk/src/solaris/native/java/util/FileSystemPreferences.c
+++ openjdk/jdk/src/solaris/native/java/util/FileSystemPreferences.c
@@ -47,7 +47,6 @@
     return (jint) result;
 }
 
-
 typedef struct flock64 FLOCK;
 
 /**
--- openjdk.orig/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
+++ openjdk/jdk/src/solaris/native/sun/awt/splashscreen/splashscreen_config.h
@@ -32,7 +32,7 @@
 #include <X11/Xutil.h>
 #include <X11/extensions/shape.h>
 #include <sys/types.h>
-#include <sys/unistd.h>
+#include <unistd.h>
 #include <pthread.h>
 #include <signal.h>
 #include <inttypes.h>
--- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
+++ openjdk/jdk/src/solaris/native/sun/nio/ch/EPollArrayWrapper.c
@@ -34,7 +34,9 @@
 #include <unistd.h>
 #include <sys/resource.h>
 #include <sys/time.h>
+#include <sys/epoll.h>
 
+#if 0
 #ifdef  __cplusplus
 extern "C" {
 #endif
@@ -63,6 +65,7 @@
 
 #ifdef  __cplusplus
 }
+#endif
 #endif
 
 #define RESTARTABLE(_cmd, _result) do { \
--- openjdk.orig/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
+++ openjdk/jdk/src/solaris/native/sun/nio/ch/NativeThread.c
@@ -38,7 +38,7 @@
 #include <sys/signal.h>
 
 /* Also defined in src/solaris/native/java/net/linux_close.c */
-#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
+#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
 
 static void
 nullHandler(int sig)
--- openjdk.orig/jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h
+++ openjdk/jdk/src/solaris/native/sun/java2d/opengl/OGLFuncs_md.h
@@ -27,6 +27,7 @@
 #define OGLFuncs_md_h_Included
 
 #include <stdlib.h>
+#include <dlfcn.h>
 #include <link.h>
 #include "J2D_GL/glx.h"
 #include "OGLFuncMacros.h"
--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.h
@@ -23,9 +23,7 @@
  * questions.
  */
 
-#define ushort unsigned short
-#define uint   unsigned int
-#define uchar  unsigned char
+#include <sys/types.h>
 
 struct unpacker;
 
--- openjdk.orig/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
+++ openjdk/jdk/src/share/native/com/sun/java/util/jar/pack/zip.cpp
@@ -46,6 +46,8 @@
 
 #include "zip.h"
 
+#define uchar unsigned char
+
 #ifdef NO_ZLIB
 
 inline bool jar::deflate_bytes(bytes& head, bytes& tail) {