From 1120d8f91d976fb89b5b6de50d7ca61f757a403c Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 10 Apr 2012 08:18:52 -0600 Subject: [PATCH] fix ProGuarded openjdk-src build This makes a simple "hello, world!" app work, at least. Further changes may be needed for more sophisticated apps. --- openjdk.pro | 6 ++++++ src/classpath-openjdk.cpp | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/openjdk.pro b/openjdk.pro index dd9e07a910..953b5e205b 100644 --- a/openjdk.pro +++ b/openjdk.pro @@ -11,6 +11,7 @@ -keep class java.lang.System { private static void initializeSystemClass(); + public static void setProperties(java.util.Properties); } -keep class java.lang.ClassLoader { @@ -33,6 +34,11 @@ -keep class java.util.Properties { public java.lang.Object setProperty(java.lang.String, java.lang.String); + public java.lang.String getProperty(java.lang.String); + } + +-keep class java.util.Hashtable { + public java.lang.Object remove(java.lang.Object); } -keep class avian.OpenJDK { diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index cbb705d8d9..5b23b4019f 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -1777,10 +1777,14 @@ intercept(Thread* t, object c, const char* name, const char* spec, set(t, runtimeData, MethodRuntimeDataNative, native); } else { - fprintf(stderr, "unable to find %s%s in %s\n", - name, spec, &byteArrayBody(t, className(t, c), 0)); + // If we can't find the method, just ignore it, since ProGuard may + // have stripped it out as unused. Otherwise, the code below can + // be uncommented for debugging purposes. - abort(t); + // fprintf(stderr, "unable to find %s%s in %s\n", + // name, spec, &byteArrayBody(t, className(t, c), 0)); + + // abort(t); } }