summaryrefslogtreecommitdiff
path: root/package/openjdk7/patches/openadk.patch
blob: 75e291e471b2ba2ce5f3d6197a686adde7a19069 (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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
diff -Nur icedtea-2.3.12.orig/Makefile.in icedtea-2.3.12/Makefile.in
--- icedtea-2.3.12.orig/Makefile.in	2013-07-26 20:18:01.000000000 +0200
+++ icedtea-2.3.12/Makefile.in	2014-01-16 08:54:53.000000000 +0100
@@ -695,7 +695,7 @@
 	$(DISTRIBUTION_PATCHES)
 
 # Bootstrapping patches
-ICEDTEA_BOOT_PATCHES = patches/boot/javafiles.patch \
+ICEDTEA_BOOT_PATCHES = patches/openadk.patch patches/boot/javafiles.patch \
 	patches/boot/ant-javac.patch patches/boot/corba-idlj.patch \
 	patches/boot/corba-no-gen.patch patches/boot/corba-orb.patch \
 	patches/boot/demos.patch patches/boot/ecj-fphexconstants.patch \
@@ -2090,7 +2090,7 @@
 # Optional native ecj
 stamps/native-ecj.stamp:
 	mkdir -p stamps 
-@BUILD_NATIVE_ECJ_TRUE@	${GCJ} $(IT_CFLAGS) -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
+@BUILD_NATIVE_ECJ_TRUE@	${GCJ} -lgcj -Wl,-Bsymbolic -findirect-dispatch -o native-ecj \
 @BUILD_NATIVE_ECJ_TRUE@	    --main=org.eclipse.jdt.internal.compiler.batch.Main ${ECJ_JAR}
 	touch $@
 
diff -Nur icedtea-2.3.12.orig/patches/openadk.patch icedtea-2.3.12/patches/openadk.patch
--- icedtea-2.3.12.orig/patches/openadk.patch	1970-01-01 01:00:00.000000000 +0100
+++ icedtea-2.3.12/patches/openadk.patch	2014-01-16 08:55:05.000000000 +0100
@@ -0,0 +1,546 @@
+diff -Nur openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+--- openjdk.orig/hotspot/src/os/linux/vm/os_linux.cpp	2013-07-17 20:14:46.000000000 +0200
++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp	2013-12-08 15:44:03.000000000 +0100
+@@ -115,7 +115,6 @@
+ # include <string.h>
+ # include <syscall.h>
+ # include <sys/sysinfo.h>
+-# include <gnu/libc-version.h>
+ # include <sys/ipc.h>
+ # include <sys/shm.h>
+ # include <link.h>
+@@ -649,9 +648,7 @@
+      os::Linux::set_glibc_version(str);
+   } else {
+      // _CS_GNU_LIBC_VERSION is not supported, try gnu_get_libc_version()
+-     static char _gnu_libc_version[32];
+-     jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
+-              "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
++     static char _gnu_libc_version[32] = "2.9";
+      os::Linux::set_glibc_version(_gnu_libc_version);
+   }
+ 
+@@ -2648,10 +2645,7 @@
+ // If we are running with earlier version, which did not have symbol versions,
+ // we should use the base version.
+ void* os::Linux::libnuma_dlsym(void* handle, const char *name) {
+-  void *f = dlvsym(handle, name, "libnuma_1.1");
+-  if (f == NULL) {
+-    f = dlsym(handle, name);
+-  }
++  void *f = dlsym(handle, name);
+   return f;
+ }
+ 
+@@ -4916,7 +4910,21 @@
+ // Linux doesn't yet have a (official) notion of processor sets,
+ // so just return the system wide load average.
+ int os::loadavg(double loadavg[], int nelem) {
+-  return ::getloadavg(loadavg, nelem);
++ FILE *LOADAVG;
++ double avg[3] = { 0.0, 0.0, 0.0 };
++ int i, res = -1;;
++
++ if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
++ fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
++ res = 0;
++ fclose(LOADAVG);
++ }
++
++ for (i = 0; (i < nelem) && (i < 3); i++) {
++ loadavg[i] = avg[i];
++ }
++
++ return res;
+ }
+ 
+ void os::pause() {
+diff -Nur openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp
+--- openjdk.orig/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2013-07-17 20:14:46.000000000 +0200
++++ openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp	2013-12-08 15:44:03.000000000 +0100
+@@ -253,7 +253,7 @@
+ #elif defined(__APPLE__)
+ inline int g_isnan(double f) { return isnan(f); }
+ #elif defined(LINUX) || defined(_ALLBSD_SOURCE)
+-inline int g_isnan(float  f) { return isnanf(f); }
++inline int g_isnan(float  f) { return __isnanf(f); }
+ inline int g_isnan(double f) { return isnan(f); }
+ #else
+ #error "missing platform-specific definition here"
+@@ -267,8 +267,8 @@
+ 
+ // Checking for finiteness
+ 
+-inline int g_isfinite(jfloat  f)                 { return finite(f); }
+-inline int g_isfinite(jdouble f)                 { return finite(f); }
++inline int g_isfinite(jfloat  f)                 { return isfinite(f); }
++inline int g_isfinite(jdouble f)                 { return isfinite(f); }
+ 
+ 
+ // Wide characters
+diff -Nur openjdk.orig/jdk/make/com/sun/java/pack/Makefile openjdk/jdk/make/com/sun/java/pack/Makefile
+--- openjdk.orig/jdk/make/com/sun/java/pack/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/com/sun/java/pack/Makefile	2013-12-08 15:44:03.000000000 +0100
+@@ -80,7 +80,7 @@
+     LDDFLAGS += $(ZIPOBJS)
+   endif
+ else
+-  OTHER_CXXFLAGS += -DNO_ZLIB -DUNPACK_JNI
++  CXXFLAGS_COMMON += -DNO_ZLIB -DUNPACK_JNI
+   OTHER_LDLIBS += $(JVMLIB)
+ endif
+ 
+diff -Nur openjdk.orig/jdk/make/com/sun/nio/sctp/Makefile openjdk/jdk/make/com/sun/nio/sctp/Makefile
+--- openjdk.orig/jdk/make/com/sun/nio/sctp/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/com/sun/nio/sctp/Makefile	2013-12-08 15:44:03.000000000 +0100
+@@ -64,7 +64,7 @@
+ COMPILER_WARNINGS_FATAL=true
+ endif
+ #OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread -ldl
+-OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -lnio -lnet -lpthread -ldl
++OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -lnio -ljavanet -lpthread -ldl
+ endif
+ ifeq ($(PLATFORM), solaris)
+ #LIBSCTP = -lsctp
+diff -Nur openjdk.orig/jdk/make/common/Defs.gmk openjdk/jdk/make/common/Defs.gmk
+--- openjdk.orig/jdk/make/common/Defs.gmk	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/common/Defs.gmk	2013-12-08 15:44:03.000000000 +0100
+@@ -204,7 +204,7 @@
+       ifeq ($(PLATFORM), macosx)
+         FREETYPE_HEADERS_PATH = /usr/X11R6/include
+       else
+-        FREETYPE_HEADERS_PATH = /usr/include
++        FREETYPE_HEADERS_PATH = /usr/include/disabled
+       endif
+     endif
+   endif
+diff -Nur openjdk.orig/jdk/make/common/shared/Platform.gmk openjdk/jdk/make/common/shared/Platform.gmk
+--- openjdk.orig/jdk/make/common/shared/Platform.gmk	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/common/shared/Platform.gmk	2013-12-08 15:44:03.000000000 +0100
+@@ -160,9 +160,6 @@
+   else
+     mach := $(shell uname -m)
+   endif
+-  ifneq (,$(wildcard /usr/bin/dpkg-architecture))
+-    mach := $(shell (dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null || echo $(mach)) | sed 's/powerpc$$/ppc/;s/hppa/parisc/')
+-  endif
+   archExpr = case "$(mach)" in \
+                 i[3-9]86) \
+                     echo i586 \
+diff -Nur openjdk.orig/jdk/make/java/instrument/Makefile openjdk/jdk/make/java/instrument/Makefile
+--- openjdk.orig/jdk/make/java/instrument/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/java/instrument/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -140,6 +140,8 @@
+ # We don't want to link against -ljava
+ JAVALIB=
+ 
++OTHER_LDLIBS += -liconv
++
+ #
+ # Add to ambient vpath so we pick up the library files
+ #
+diff -Nur openjdk.orig/jdk/make/java/net/Makefile openjdk/jdk/make/java/net/Makefile
+--- openjdk.orig/jdk/make/java/net/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/java/net/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -25,7 +25,7 @@
+ 
+ BUILDDIR = ../..
+ PACKAGE = java.net
+-LIBRARY = net
++LIBRARY = javanet
+ PRODUCT = sun
+ include $(BUILDDIR)/common/Defs.gmk
+ 
+diff -Nur openjdk.orig/jdk/make/java/nio/Makefile openjdk/jdk/make/java/nio/Makefile
+--- openjdk.orig/jdk/make/java/nio/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/java/nio/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -369,7 +369,7 @@
+ endif
+ 
+ ifeq ($(PLATFORM), linux)
+-  OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -lnet -lpthread $(LIBDL)
++  OTHER_LDLIBS += -L$(LIBDIR)/$(LIBARCH) -ljava -ljavanet -lpthread $(LIBDL)
+   ifdef USE_SYSTEM_GIO
+     OTHER_LDLIBS += $(GIO_LIBS)
+     OTHER_INCLUDES += $(GIO_CFLAGS) -DUSE_SYSTEM_GIO
+@@ -923,7 +923,7 @@
+ 
+ $(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
+ 	$(prep-target)
+-	($(CD) $(TEMPDIR); $(NIO_CC) $(CPPFLAGS) $(LDDFLAGS) \
++	($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS_FOR_BUILD) $(LDDFLAGS) \
+ 	   -o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
+ 
+ ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
+@@ -959,7 +959,7 @@
+ 
+ $(GENUC_EXE) : $(GENUC_SRC)
+ 	$(prep-target)
+-	$(NIO_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
++	$(HOST_CC) $(CPPFLAGS_FOR_BUILD) -o $@ $(GENUC_SRC)
+ 
+ ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
+ $(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
+diff -Nur openjdk.orig/jdk/make/java/npt/Makefile openjdk/jdk/make/java/npt/Makefile
+--- openjdk.orig/jdk/make/java/npt/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/java/npt/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -64,6 +64,8 @@
+ # We don't want to link against -ljava
+ JAVALIB=
+ 
++OTHER_LDLIBS += -liconv
++
+ # Add -export options to explicitly spell exported symbols
+ ifeq ($(PLATFORM), windows)
+   OTHER_LCF += -export:nptInitialize -export:nptTerminate
+diff -Nur openjdk.orig/jdk/make/sun/awt/mawt.gmk openjdk/jdk/make/sun/awt/mawt.gmk
+--- openjdk.orig/jdk/make/sun/awt/mawt.gmk	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/sun/awt/mawt.gmk	2013-12-08 15:44:04.000000000 +0100
+@@ -151,22 +151,6 @@
+ #endif
+ 
+ LIBXTST = -lXtst
+-ifeq ($(PLATFORM), linux)
+-   ifeq ($(ARCH_DATA_MODEL), 64)
+-   # XXX what about the rest of them?
+-        LIBXT = -lXt
+-    else
+-    # Allows for builds on Debian GNU Linux, X11 is in a different place 
+-       LIBXT = $(firstword $(wildcard $(OPENWIN_LIB)/libXt.a) \
+-                        $(wildcard /usr/lib/libXt.a))
+-       LIBSM = $(firstword $(wildcard $(OPENWIN_LIB)/libSM.a) \
+-                        $(wildcard /usr/lib/libSM.a))
+-       LIBICE = $(firstword $(wildcard $(OPENWIN_LIB)/libICE.a) \
+-                         $(wildcard /usr/lib/libICE.a))
+-       LIBXTST = $(firstword $(wildcard $(OPENWIN_LIB)/libXtst.a) \
+-                         $(wildcard /usr/lib/libXtst.a))
+-   endif
+-endif
+ 
+ # Use -lXmu for EditRes support
+ LIBXMU_DBG	= -lXmu
+@@ -181,7 +165,7 @@
+ OTHER_CFLAGS += -DMLIB_NO_LIBSUNMATH
+ # XXX what is this define below? Isn't it motif-related?
+ OTHER_CFLAGS += -DXMSTRINGDEFINES=1
+-OTHER_LDLIBS =  $(LIBXMU) $(LIBXTST) -lXext $(LIBXT) $(LIBSM) $(LIBICE) -lX11 -lXi
++OTHER_LDLIBS =  $(LIBXMU) $(LIBXTST) -lXext -lXt -lSM -lICE -lX11 -lXi
+ endif
+ 
+ endif
+@@ -230,11 +214,6 @@
+   CPPFLAGS += -I$(PLATFORM_SRC)/native/common/deps/fontconfig2
+ endif
+ 
+-ifndef HEADLESS
+-CPPFLAGS += -I$(OPENWIN_HOME)/include 
+-LDFLAGS  += -L$(OPENWIN_LIB)
+-
+-endif # !HEADLESS
+ 
+ CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/debug \
+             -I$(SHARE_SRC)/native/$(PKGDIR)/../font \
+@@ -269,11 +248,6 @@
+ endif # !HEADLESS
+ endif # PLATFORM
+ 
+-ifeq ($(PLATFORM), linux)
+-  # Checking for the X11/extensions headers at the additional location
+-  CPPFLAGS += -I$(firstword $(wildcard $(OPENWIN_HOME)/include/X11/extensions) \
+-                        $(wildcard /usr/include/X11/extensions))
+-endif
+ 
+ ifeq ($(PLATFORM), macosx))
+   CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
+diff -Nur openjdk.orig/jdk/make/sun/splashscreen/Makefile openjdk/jdk/make/sun/splashscreen/Makefile
+--- openjdk.orig/jdk/make/sun/splashscreen/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/sun/splashscreen/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -55,6 +55,8 @@
+ 
+ JAVALIB=
+ 
++OTHER_LDLIBS += -liconv
++
+ #
+ # C Flags
+ #
+diff -Nur openjdk.orig/jdk/make/sun/xawt/Makefile openjdk/jdk/make/sun/xawt/Makefile
+--- openjdk.orig/jdk/make/sun/xawt/Makefile	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/make/sun/xawt/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -292,16 +292,10 @@
+ SIZERS = $(SIZER).32
+ SIZERS_C = $(SIZER_32_C)
+ SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
+-ifdef CROSS_COMPILE_ARCH
+-CFLAGS_32 = -m32
+-endif
+ else # !32
+ SIZERS = $(SIZER).64
+ SIZERS_C = $(SIZER_64_C)
+ SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.64
+-ifdef CROSS_COMPILE_ARCH
+-CFLAGS_64 = -m64
+-endif
+ endif # 32
+ endif # !macosx
+ endif # solaris
+@@ -337,11 +331,7 @@
+ WRAPPER_GENERATOR_CLASS=$(WRAPPER_GENERATOR_TEMPDIR)/WrapperGenerator.class 
+ XLIBTYPES=$(PLATFORM_SRC)/classes/sun/awt/X11/generator/xlibtypes.txt
+ 
+-ifndef CROSS_COMPILE_ARCH
+-SIZERS_CC = $(CC)
+-else
+-SIZERS_CC = $(HOST_CC)
+-endif
++SIZERS_CC = $(CC) -static
+ 
+ $(SIZERS): $(SIZERS_C) 
+ 	$(prep-target)
+@@ -364,7 +354,7 @@
+ 	    $(CHMOD) +w $@;\
+ 	else	\
+ 	    $(ECHO) GENERATING $@; \
+-	    $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
++	    $(QEMU) $(WRAPPER_GENERATOR_DIR)/sizer$(suffix $@) > $@; \
+ 	fi
+ 	@if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
+ 	    $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
+diff -Nur openjdk.orig/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java openjdk/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java
+--- openjdk.orig/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/net/AbstractPlainDatagramSocketImpl.java	2013-12-08 15:44:04.000000000 +0100
+@@ -69,7 +69,7 @@
+      */
+     static {
+         java.security.AccessController.doPrivileged(
+-                  new sun.security.action.LoadLibraryAction("net"));
++                  new sun.security.action.LoadLibraryAction("javanet"));
+     }
+ 
+     /**
+diff -Nur openjdk.orig/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java openjdk/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java
+--- openjdk.orig/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/net/AbstractPlainSocketImpl.java	2013-12-08 15:44:04.000000000 +0100
+@@ -78,7 +78,7 @@
+      */
+     static {
+         java.security.AccessController.doPrivileged(
+-                  new sun.security.action.LoadLibraryAction("net"));
++                  new sun.security.action.LoadLibraryAction("javanet"));
+     }
+ 
+     /**
+diff -Nur openjdk.orig/jdk/src/share/classes/java/net/DatagramPacket.java openjdk/jdk/src/share/classes/java/net/DatagramPacket.java
+--- openjdk.orig/jdk/src/share/classes/java/net/DatagramPacket.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/net/DatagramPacket.java	2013-12-08 15:44:04.000000000 +0100
+@@ -47,7 +47,7 @@
+      */
+     static {
+         java.security.AccessController.doPrivileged(
+-                  new sun.security.action.LoadLibraryAction("net"));
++                  new sun.security.action.LoadLibraryAction("javanet"));
+         init();
+     }
+ 
+diff -Nur openjdk.orig/jdk/src/share/classes/java/net/InetAddress.java openjdk/jdk/src/share/classes/java/net/InetAddress.java
+--- openjdk.orig/jdk/src/share/classes/java/net/InetAddress.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/net/InetAddress.java	2013-12-08 15:44:04.000000000 +0100
+@@ -260,7 +260,7 @@
+     static {
+         preferIPv6Address = java.security.AccessController.doPrivileged(
+             new GetBooleanAction("java.net.preferIPv6Addresses")).booleanValue();
+-        AccessController.doPrivileged(new LoadLibraryAction("net"));
++        AccessController.doPrivileged(new LoadLibraryAction("javanet"));
+         init();
+     }
+ 
+diff -Nur openjdk.orig/jdk/src/share/classes/java/net/NetworkInterface.java openjdk/jdk/src/share/classes/java/net/NetworkInterface.java
+--- openjdk.orig/jdk/src/share/classes/java/net/NetworkInterface.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/java/net/NetworkInterface.java	2013-12-08 15:44:04.000000000 +0100
+@@ -53,7 +53,7 @@
+     private static final int defaultIndex; /* index of defaultInterface */
+ 
+     static {
+-        AccessController.doPrivileged(new LoadLibraryAction("net"));
++        AccessController.doPrivileged(new LoadLibraryAction("javanet"));
+         init();
+         defaultInterface = DefaultInterface.getDefault();
+         if (defaultInterface != null) {
+diff -Nur openjdk.orig/jdk/src/share/classes/sun/net/sdp/SdpSupport.java openjdk/jdk/src/share/classes/sun/net/sdp/SdpSupport.java
+--- openjdk.orig/jdk/src/share/classes/sun/net/sdp/SdpSupport.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/sun/net/sdp/SdpSupport.java	2013-12-08 15:44:04.000000000 +0100
+@@ -76,6 +76,6 @@
+ 
+     static {
+         AccessController.doPrivileged(
+-            new sun.security.action.LoadLibraryAction("net"));
++            new sun.security.action.LoadLibraryAction("javanet"));
+     }
+ }
+diff -Nur openjdk.orig/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java openjdk/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java
+--- openjdk.orig/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/sun/net/spi/DefaultProxySelector.java	2013-12-08 15:44:04.000000000 +0100
+@@ -95,7 +95,7 @@
+                 }});
+         if (b != null && b.booleanValue()) {
+             java.security.AccessController.doPrivileged(
+-                      new sun.security.action.LoadLibraryAction("net"));
++                      new sun.security.action.LoadLibraryAction("javanet"));
+             hasSystemProxies = init();
+         }
+     }
+diff -Nur openjdk.orig/jdk/src/share/classes/sun/nio/ch/Util.java openjdk/jdk/src/share/classes/sun/nio/ch/Util.java
+--- openjdk.orig/jdk/src/share/classes/sun/nio/ch/Util.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/share/classes/sun/nio/ch/Util.java	2013-12-08 15:44:04.000000000 +0100
+@@ -483,7 +483,7 @@
+                 return;
+             loaded = true;
+             java.security.AccessController
+-                .doPrivileged(new sun.security.action.LoadLibraryAction("net"));
++                .doPrivileged(new sun.security.action.LoadLibraryAction("javanet"));
+             java.security.AccessController
+                 .doPrivileged(new sun.security.action.LoadLibraryAction("nio"));
+             // IOUtil must be initialized; Its native methods are called from
+diff -Nur openjdk.orig/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java openjdk/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java
+--- openjdk.orig/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/solaris/classes/sun/net/dns/ResolverConfigurationImpl.java	2013-12-08 15:44:04.000000000 +0100
+@@ -247,7 +247,7 @@
+ 
+     static {
+         java.security.AccessController.doPrivileged(
+-            new sun.security.action.LoadLibraryAction("net"));
++            new sun.security.action.LoadLibraryAction("javanet"));
+     }
+ 
+ }
+diff -Nur openjdk.orig/jdk/src/solaris/native/sun/awt/awt_InputMethod.c openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c
+--- openjdk.orig/jdk/src/solaris/native/sun/awt/awt_InputMethod.c	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/solaris/native/sun/awt/awt_InputMethod.c	2013-12-08 15:44:04.000000000 +0100
+@@ -246,7 +246,8 @@
+     if (wcs == NULL)
+         return NULL;
+ 
+-    n = len*MB_CUR_MAX + 1;
++    //evil hack for uclibc
++    n = len*1 + 1;
+ 
+     mbs = (char *) malloc(n * sizeof(char));
+     if (mbs == NULL) {
+diff -Nur openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c
+--- openjdk.orig/jdk/src/solaris/native/sun/xawt/XToolkit.c	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/solaris/native/sun/xawt/XToolkit.c	2013-12-08 15:44:04.000000000 +0100
+@@ -27,9 +27,6 @@
+ #include <X11/Xutil.h>
+ #include <X11/Xos.h>
+ #include <X11/Xatom.h>
+-#ifdef __linux__
+-#include <execinfo.h>
+-#endif
+ 
+ #include <jvm.h>
+ #include <jni.h>
+@@ -785,25 +782,6 @@
+     return ret;
+ }
+ 
+-#ifdef __linux__
+-void print_stack(void)
+-{
+-  void *array[10];
+-  size_t size;
+-  char **strings;
+-  size_t i;
+-
+-  size = backtrace (array, 10);
+-  strings = backtrace_symbols (array, size);
+-
+-  fprintf (stderr, "Obtained %zd stack frames.\n", size);
+-
+-  for (i = 0; i < size; i++)
+-     fprintf (stderr, "%s\n", strings[i]);
+-
+-  free (strings);
+-}
+-#endif
+ 
+ Window get_xawt_root_shell(JNIEnv *env) {
+   static jclass classXRootWindow = NULL;
+diff -Nur openjdk.orig/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java openjdk/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java
+--- openjdk.orig/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	2013-06-23 17:54:05.000000000 +0200
++++ openjdk/jdk/src/windows/classes/sun/net/dns/ResolverConfigurationImpl.java	2013-12-08 15:44:04.000000000 +0100
+@@ -159,7 +159,7 @@
+ 
+     static {
+         java.security.AccessController.doPrivileged(
+-            new sun.security.action.LoadLibraryAction("net"));
++            new sun.security.action.LoadLibraryAction("javanet"));
+         init0();
+ 
+         // start the address listener thread
+diff -Nur openjdk.orig/Makefile openjdk/Makefile
+--- openjdk.orig/Makefile	2013-06-23 17:53:43.000000000 +0200
++++ openjdk/Makefile	2013-12-08 15:44:04.000000000 +0100
+@@ -53,9 +53,7 @@
+ REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
+ REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
+ 
+-ifndef TOPDIR
+-  TOPDIR:=.
+-endif
++TOPDIR:=.
+ 
+ ifndef JDK_TOPDIR
+   JDK_TOPDIR=$(TOPDIR)/jdk
+diff -Nur openjdk-boot.orig/hotspot/make/linux/makefiles/vm.make openjdk-boot/hotspot/make/linux/makefiles/vm.make
+--- openjdk-boot.orig/hotspot/make/linux/makefiles/vm.make	2013-07-26 12:31:42.000000000 +0200
++++ openjdk-boot/hotspot/make/linux/makefiles/vm.make	2014-01-14 21:28:27.000000000 +0100
+@@ -285,7 +285,7 @@
+   LIBS_VM                  += $(LIBS)
+ endif
+ ifeq ($(ZERO_BUILD), true)
+-  LIBS_VM += $(LIBFFI_LIBS)
++  LIBS_VM += $(FFI_LDFLAGS) -Wl,-Bstatic $(LIBFFI_LIBS) -Wl,-Bdynamic
+ endif
+ ifeq ($(SHARK_BUILD), true)
+   LFLAGS_VM += $(LLVM_LDFLAGS)
+diff -Nur openjdk-boot.orig/Makefile openjdk-boot/Makefile
+--- openjdk-boot.orig/Makefile	2013-07-24 23:26:43.000000000 +0200
++++ openjdk-boot/Makefile	2014-01-13 22:15:04.000000000 +0100
+@@ -53,9 +53,7 @@
+ REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
+ REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
+ 
+-ifndef TOPDIR
+-  TOPDIR:=.
+-endif
++TOPDIR:=.
+ 
+ ifndef JDK_TOPDIR
+   JDK_TOPDIR=$(TOPDIR)/jdk
+diff -Nur openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
+--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make	2013-07-26 12:31:42.000000000 +0200
++++ openjdk/hotspot/make/linux/makefiles/zeroshark.make	2014-01-16 08:45:53.000000000 +0100
+@@ -38,7 +38,7 @@
+ 
+ offsets_arm.s:	mkoffsets
+ 	@echo Generating assembler offsets
+-	./mkoffsets > $@
++	$(QEMU) ./mkoffsets > $@
+ 
+ bytecodes_arm.s: bytecodes_arm.def mkbc
+ 	@echo Generating ARM assembler bytecode sequences
+@@ -46,12 +46,12 @@
+ 
+ mkbc:	$(GAMMADIR)/tools/mkbc.c
+ 	@echo Compiling mkbc tool
+-	$(CC_COMPILE) -o $@ $< $(COMPILE_DONE)
++	$(CC_FOR_BUILD) -o $@ $< $(COMPILE_DONE)
+ 
+ mkoffsets:	asm_helper.cpp
+ 	@echo Compiling offset generator
+ 	$(QUIETLY) $(REMOVE_TARGET)
+-	$(CC_COMPILE) $(CFLAGS) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE)
++	$(CC_COMPILE) $(CFLAGS) -static -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE)
+ 
+ endif
+