ab61e94b2352c291ba63d8a38b95ea3dd34a3181
[org.ibex.core.git] / upstream / gcc-3.3 / patches / zzz-inhibit.reflection.patch
1 diff -rBub boehm-gc/configureboehm-gc/configure
2 --- boehm-gc/configure  Tue May 13 17:18:14 2003
3 +++ boehm-gc/configure  Mon Mar  1 01:03:55 2004
4 @@ -1181,9 +1181,9 @@
5    if test "$ac_test_CFLAGS" = set; then
6      CFLAGS="$ac_save_CFLAGS"
7    elif test $ac_cv_prog_cc_g = yes; then
8 -    CFLAGS="-g -O2"
9 +    CFLAGS="-g -Os -ffunction-sections -fdata-sections"
10    else
11 -    CFLAGS="-O2"
12 +    CFLAGS="-Os -ffunction-sections -fdata-sections"
13    fi
14  else
15    GCC=
16 @@ -1275,9 +1275,9 @@
17    if test "$ac_test_CXXFLAGS" = set; then
18      CXXFLAGS="$ac_save_CXXFLAGS"
19    elif test $ac_cv_prog_cxx_g = yes; then
20 -    CXXFLAGS="-g -O2"
21 +    CXXFLAGS="-g -Os -ffunction-sections -fdata-sections"
22    else
23 -    CXXFLAGS="-O2"
24 +    CXXFLAGS="-Os -ffunction-sections -fdata-sections"
25    fi
26  else
27    GXX=
28 diff -rBub gcc/dwarf2out.cgcc/dwarf2out.c
29 --- gcc/dwarf2out.c     Mon May  5 09:59:20 2003
30 +++ gcc/dwarf2out.c     Sat Feb 28 02:37:20 2004
31 @@ -1040,6 +1040,8 @@
32    else if (!flag_asynchronous_unwind_tables && cfa.reg != STACK_POINTER_REGNUM)
33      return;
34  
35 +  if (frame_pointer_needed) return;
36 +
37    if (GET_CODE (insn) == BARRIER)
38      {
39        /* When we see a BARRIER, we know to reset args_size to 0.  Usually
40 diff -rBub gcc/java/class.cgcc/java/class.c
41 --- gcc/java/class.c    Fri Feb 28 12:53:07 2003
42 +++ gcc/java/class.c    Mon Mar  1 00:20:15 2004
43 @@ -971,7 +971,7 @@
44       tree type;
45  {
46    int is_compiled = is_compiled_class (type);
47 -  if (is_compiled)
48 +  if (is_compiled || flag_inhibit_reflection)
49      {
50        tree ref, decl_name, decl;
51        if (TREE_CODE (type) == POINTER_TYPE)
52 @@ -1199,13 +1199,17 @@
53    int resolved = is_compiled_class (type);
54  
55    START_RECORD_CONSTRUCTOR (finit, field_type_node);
56 +  if (!flag_inhibit_reflection) {
57    PUSH_FIELD_VALUE (finit, "name", build_utf8_ref (DECL_NAME (fdecl)));
58 +  } else {
59 +    PUSH_FIELD_VALUE (finit, "name", null_pointer_node);
60 +  }
61    if (resolved)
62      type = build_class_ref (type);
63    else
64      {
65 +      if (!flag_inhibit_reflection) {
66        tree signature = build_java_signature (type);
67 -
68        type = build_utf8_ref (unmangle_classname 
69                              (IDENTIFIER_POINTER (signature),
70                               IDENTIFIER_LENGTH (signature)));
71 @@ -1209,6 +1213,9 @@
72        type = build_utf8_ref (unmangle_classname 
73                              (IDENTIFIER_POINTER (signature),
74                               IDENTIFIER_LENGTH (signature)));
75 +      } else {
76 +        type = null_pointer_node;
77 +      }
78      }
79    PUSH_FIELD_VALUE (finit, "type", type);
80  
81 @@ -1244,6 +1251,7 @@
82    tree code;
83  #define ACC_TRANSLATED          0x4000
84    int accflags = get_access_flags_from_decl (mdecl) | ACC_TRANSLATED;
85 +  int emitNames = 0;
86  
87    if (!flag_indirect_dispatch && DECL_VINDEX (mdecl) != NULL_TREE)
88      index = DECL_VINDEX (mdecl);
89 @@ -1254,6 +1262,12 @@
90    if (DECL_RTL_SET_P (mdecl))
91      code = build1 (ADDR_EXPR, nativecode_ptr_type_node, mdecl);
92    START_RECORD_CONSTRUCTOR (minit, method_type_node);
93 +
94 +  emitNames = !flag_inhibit_reflection;
95 +  if (!METHOD_STATIC(mdecl)) emitNames = 1;
96 +  if (DECL_CLINIT_P(mdecl)) emitNames = 1;
97 +  if ((METHOD_STATIC(mdecl) && (strcmp(IDENTIFIER_POINTER(DECL_NAME(mdecl)),"main") == 0))) emitNames = 1;
98 +  if (emitNames) {
99    PUSH_FIELD_VALUE (minit, "name",
100                     build_utf8_ref (DECL_CONSTRUCTOR_P (mdecl) ?
101                                     init_identifier_node
102 @@ -1266,6 +1280,10 @@
103                         (IDENTIFIER_POINTER(signature),
104                          IDENTIFIER_LENGTH(signature)))));
105    }
106 +  } else {
107 +    PUSH_FIELD_VALUE (minit, "name", null_pointer_node);
108 +    PUSH_FIELD_VALUE (minit, "signature", null_pointer_node);
109 +  }
110    PUSH_FIELD_VALUE (minit, "accflags", build_int_2 (accflags, 0));
111    PUSH_FIELD_VALUE (minit, "index", index);
112    PUSH_FIELD_VALUE (minit, "ncode", code);
113 @@ -1273,6 +1291,7 @@
114    {
115      /* Compute the `throws' information for the method.  */
116      tree table = null_pointer_node;
117 +  if (!flag_inhibit_reflection)
118      if (DECL_FUNCTION_THROWS (mdecl) != NULL_TREE)
119        {
120         int length = 1 + list_length (DECL_FUNCTION_THROWS (mdecl));
121 @@ -1473,6 +1493,7 @@
122               DECL_INITIAL (field) = initial;
123             }
124           else
125 +  if (!flag_inhibit_reflection)
126             {
127               instance_field_count++;
128               instance_fields = tree_cons (NULL_TREE, init, instance_fields);
129 @@ -1480,6 +1501,9 @@
130         }
131      }
132    field_count = static_field_count + instance_field_count;
133 +  
134 +  // we have to leave this here; part of the class initialization is the process
135 +  // of replacing utf8const's with String objects
136    if (field_count > 0)
137      {
138        static_fields = nreverse (static_fields);
139 @@ -1550,7 +1574,7 @@
140    super = CLASSTYPE_SUPER (type);
141    if (super == NULL_TREE)
142      super = null_pointer_node;
143 -  else if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (type_decl))))
144 +  else if (flag_inhibit_reflection || (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (type_decl)))))
145      super = build_class_ref (super);
146    else
147      {
148 @@ -1576,7 +1600,7 @@
149           tree child = TREE_VEC_ELT (TYPE_BINFO_BASETYPES (type), i);
150           tree iclass = BINFO_TYPE (child);
151           tree index;
152 -         if (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (iclass)))))
153 +         if (flag_inhibit_reflection || (assume_compiled (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (iclass))))))
154             index = build_class_ref (iclass);
155           else
156             {
157 @@ -2225,6 +2249,7 @@
158    index = 0;
159    method_list = otable_methods;
160    list = NULL_TREE;  
161 +  if (!flag_inhibit_reflection)
162    while (method_list != NULL_TREE)
163      {
164        method = TREE_VALUE (method_list);
165 diff -rBub gcc/java/constants.cgcc/java/constants.c
166 --- gcc/java/constants.c        Mon Nov 18 07:46:32 2002
167 +++ gcc/java/constants.c        Mon Mar  1 00:20:32 2004
168 @@ -430,9 +430,13 @@
169    int i;
170    for (i = outgoing_cpool->count;  --i > 0; )
171      {
172 +      if (!flag_inhibit_reflection) {
173        tags_list
174         = tree_cons (NULL_TREE, get_tag_node (outgoing_cpool->tags[i]),
175                      tags_list);
176 +      } else {
177 +        tags_list = null_pointer_node;
178 +      }
179        data_list
180         = tree_cons (NULL_TREE, build_utf8_ref ((tree)outgoing_cpool->data[i]),
181                      data_list);
182 @@ -446,7 +450,9 @@
183        index_type = build_index_type (max_index);
184  
185        /* Add dummy 0'th element of constant pool. */
186 +      if (!flag_inhibit_reflection) {
187        tags_list = tree_cons (NULL_TREE, get_tag_node (0), tags_list);
188 +      }
189        data_list = tree_cons (NULL_TREE, null_pointer_node, data_list);
190    
191        data_decl = TREE_OPERAND (build_constant_data_ref (), 0);
192 @@ -458,6 +464,7 @@
193        rest_of_decl_compilation (data_decl, (char *) 0, 1, 0);
194        data_value = build_address_of (data_decl);
195  
196 +      if (!flag_inhibit_reflection) {
197        tags_type = build_array_type (unsigned_byte_type_node, index_type);
198        tags_decl = build_decl (VAR_DECL, mangled_classname ("_CT_", 
199                                                            current_class),
200 @@ -467,6 +474,9 @@
201                                         NULL_TREE, tags_list);
202        rest_of_decl_compilation (tags_decl, (char*) 0, 1, 0);
203        tags_value = build_address_of (tags_decl);
204 +      } else {
205 +        tags_value = null_pointer_node;
206 +      }
207      }
208    else
209      {
210 diff -rBub gcc/java/java-tree.hgcc/java/java-tree.h
211 --- gcc/java/java-tree.h        Mon Nov 18 10:13:35 2002
212 +++ gcc/java/java-tree.h        Thu Feb 26 15:01:38 2004
213 @@ -225,6 +225,9 @@
214  /* Encoding used for source files.  */
215  extern const char *current_encoding;
216  
217 +/** don't emit reflection information */
218 +extern int flag_inhibit_reflection;
219 +
220  /* The Java .class file that provides main_class;  the main input file. */
221  extern struct JCF *current_jcf;
222  
223 diff -rBub gcc/java/lang.cgcc/java/lang.c
224 --- gcc/java/lang.c     Sun Jan  5 07:03:25 2003
225 +++ gcc/java/lang.c     Thu Feb 26 15:01:38 2004
226 @@ -171,6 +171,9 @@
227  /* The encoding of the source file.  */
228  const char *current_encoding = NULL;
229  
230 +/** don't emit reflection information */
231 +int flag_inhibit_reflection = 0;
232 +
233  /* When nonzero, report the now deprecated empty statements.  */
234  int flag_extraneous_semicolon;
235  
236 @@ -431,6 +434,13 @@
237      {
238        flag_inline_functions = 1;
239        flag_really_inline = 1;
240 +      return 1;
241 +    }
242 +#undef ARG
243 +#define ARG "-finhibit-reflection"
244 +  if (strncmp (p, ARG, sizeof (ARG) - 1) == 0)
245 +    {
246 +      flag_inhibit_reflection = 1;
247        return 1;
248      }
249  #undef ARG
250 diff -rBub libjava/Makefile.inlibjava/Makefile.in
251 --- libjava/Makefile.in Mon Mar  1 01:45:58 2004
252 +++ libjava/Makefile.in Sun Feb 29 22:09:27 2004
253 @@ -174,10 +174,10 @@
254  
255  WARNINGS = -W -Wall
256  AM_CXXFLAGS = -fno-rtti -fnon-call-exceptions \
257 -       -fdollars-in-identifiers \
258 +       -fdollars-in-identifiers -ffunction-sections -fdata-sections \
259         -Wswitch-enum \
260         @LIBGCJ_CXXFLAGS@ @X_CFLAGS@ $(WARNINGS) -D_GNU_SOURCE \
261 -       -DPREFIX="\"$(prefix)\""
262 +       -DPREFIX="\"$(prefix)\"" -Os
263  
264  @USING_GCC_TRUE@AM_CFLAGS = @USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
265  @USING_GCC_FALSE@AM_CFLAGS = @USING_GCC_FALSE@@LIBGCJ_CFLAGS@
266 diff -rBub libjava/boehm.cclibjava/boehm.cc
267 --- libjava/boehm.cc    Thu Jan  2 21:19:53 2003
268 +++ libjava/boehm.cc    Mon Mar  1 00:21:04 2004
269 @@ -17,6 +17,7 @@
270  
271  #include <java/lang/Class.h>
272  #include <java/lang/reflect/Modifier.h>
273 +#include <java/lang/VirtualMachineError.h>
274  #include <java-interp.h>
275  
276  // More nastiness: the GC wants to define TRUE and FALSE.  We don't
277 @@ -147,6 +149,7 @@
278           for (int i = 0; i < c->method_count; ++i)
279             {
280               p = (ptr_t) c->methods[i].name;
281 +              if (p == NULL) continue;
282               MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
283                              cm1label);
284               p = (ptr_t) c->methods[i].signature;
285 @@ -164,9 +167,11 @@
286  
287  #ifndef COMPACT_FIELDS
288           p = (ptr_t) field->name;
289 +          if (p == NULL) continue;
290           MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8alabel);
291  #endif
292           p = (ptr_t) field->type;
293 +          if (p == NULL) continue;
294           MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8blabel);
295  
296           // For the interpreter, we also need to mark the memory
297 @@ -258,6 +263,7 @@
298        // Note: occasionally `klass' can be null.  For instance, this
299        // can happen if a GC occurs between the point where an object
300        // is allocated and where the vtbl slot is set.
301 +      throw new java::lang::VirtualMachineError();
302        while (klass && klass != &java::lang::Object::class$)
303         {
304           jfieldID field = JvGetFirstInstanceField (klass);
305 diff -rBub libjava/configurelibjava/configure
306 --- libjava/configure   Mon Mar  1 01:45:59 2004
307 +++ libjava/configure   Sun Feb 29 22:13:11 2004
308 @@ -1180,13 +1180,13 @@
309    CFLAGS="$ac_save_CFLAGS"
310  elif test $ac_cv_prog_cc_g = yes; then
311    if test "$GCC" = yes; then
312 -    CFLAGS="-g -O2"
313 +    CFLAGS="-g -Os"
314    else
315      CFLAGS="-g"
316    fi
317  else
318    if test "$GCC" = yes; then
319 -    CFLAGS="-O2"
320 +    CFLAGS="-Os"
321    else
322      CFLAGS=
323    fi
324 @@ -1287,9 +1287,9 @@
325    if test "$ac_test_CXXFLAGS" = set; then
326      CXXFLAGS="$ac_save_CXXFLAGS"
327    elif test $ac_cv_prog_cxx_g = yes; then
328 -    CXXFLAGS="-g -O2"
329 +    CXXFLAGS="-g -Os"
330    else
331 -    CXXFLAGS="-O2"
332 +    CXXFLAGS="-Os"
333    fi
334  else
335    GXX=
336 @@ -1683,6 +1683,9 @@
337  
338  
339  
340 +cat >> confdefs.h <<\EOF
341 +#undef USE_LTDL
342 +EOF
343  
344  
345  # Only use libltdl for native builds.
346 @@ -1697,9 +1700,9 @@
347  
348     
349     DIRLTDL=libltdl
350 -   cat >> confdefs.h <<\EOF
351 -#define USE_LTDL 1
352 -EOF
353 +#   cat >> confdefs.h <<\EOF
354 +##define USE_LTDL 1
355 +#EOF
356  
357     # Sigh.  Libtool's macro doesn't do the right thing.
358     INCLTDL="-I\$(top_srcdir)/libltdl $INCLTDL"
359 @@ -5644,7 +5647,7 @@
360  fi
361  fi
362  
363 -  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
364 +  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -Os"
365    
366  
367  
368 @@ -5798,7 +5801,7 @@
369  echo $ac_n "checking for g++ -ffloat-store bug""... $ac_c" 1>&6
370  echo "configure:5796: checking for g++ -ffloat-store bug" >&5
371  save_CFLAGS="$CFLAGS"
372 -CFLAGS="-x c++ -O2 -ffloat-store"
373 +CFLAGS="-x c++ -Os -ffloat-store"
374  cat > conftest.$ac_ext <<EOF
375  #line 5800 "configure"
376  #include "confdefs.h"
377 diff -rBub libjava/configure.inlibjava/configure.in
378 --- libjava/configure.in        Mon Mar  1 01:45:59 2004
379 +++ libjava/configure.in        Mon Mar  1 00:28:09 2004
380 @@ -825,7 +825,7 @@
381  dnl Work around a g++ bug.  Reported to gcc-bugs@gcc.gnu.org on Jan 22, 2000.
382  AC_MSG_CHECKING([for g++ -ffloat-store bug])
383  save_CFLAGS="$CFLAGS"
384 -CFLAGS="-x c++ -O2 -ffloat-store"
385 +CFLAGS="-x c++ -Os -ffloat-store"
386  AC_TRY_COMPILE([#include <math.h>], , 
387    [AC_MSG_RESULT(no)],
388    [AC_DEFINE(__NO_MATH_INLINES)
389 diff -rBub libjava/gnu/gcj/convert/BytesToUnicode.javalibjava/gnu/gcj/convert/BytesToUnicode.java
390 --- libjava/gnu/gcj/convert/BytesToUnicode.java Mon Jul 30 13:24:17 2001
391 +++ libjava/gnu/gcj/convert/BytesToUnicode.java Fri Feb 27 04:17:13 2004
392 @@ -65,7 +65,7 @@
393        }
394      catch (Throwable ex)
395        {
396 -       return new Input_8859_1();
397 +          throw new UnsatisfiedLinkError();
398        }
399    }
400  
401 @@ -100,6 +100,7 @@
402        } 
403      catch (Throwable ex) 
404        { 
405 +          /*
406         try
407           {
408             // We pass the original name to iconv and let it handle
409 @@ -108,9 +109,10 @@
410           }
411         catch (Throwable _)
412           {
413 +          */
414             throw new java.io.UnsupportedEncodingException(encoding
415                                                            + " (" + ex + ')');
416 -         }
417 +            //}
418        }
419    }
420  
421 diff -rBub libjava/gnu/gcj/convert/IOConverter.javalibjava/gnu/gcj/convert/IOConverter.java
422 --- libjava/gnu/gcj/convert/IOConverter.java    Sun Sep 16 19:28:53 2001
423 +++ libjava/gnu/gcj/convert/IOConverter.java    Sun Feb 29 01:53:14 2004
424 @@ -20,7 +20,7 @@
425  
426    // True if we have to do byte-order conversions on iconv()
427    // arguments.
428 -  static protected boolean iconv_byte_swap;
429 +  static protected boolean iconv_byte_swap = false;
430  
431    static
432    {
433 @@ -64,7 +64,7 @@
434      hash.put ("cseucpkdfmtjapanese", "EUCJIS");
435      hash.put ("euc-jp", "EUCJIS");
436  
437 -    iconv_byte_swap = iconv_init ();
438 +    //iconv_byte_swap = iconv_init ();
439    }
440  
441    private static native boolean iconv_init ();
442 diff -rBub libjava/gnu/gcj/convert/UnicodeToBytes.javalibjava/gnu/gcj/convert/UnicodeToBytes.java
443 --- libjava/gnu/gcj/convert/UnicodeToBytes.java Fri Aug 17 20:56:01 2001
444 +++ libjava/gnu/gcj/convert/UnicodeToBytes.java Fri Feb 27 04:17:02 2004
445 @@ -63,7 +63,8 @@
446        }
447      catch (Throwable ex)
448        {
449 -       return new Output_8859_1();
450 +          throw new UnsatisfiedLinkError();
451 +          //return new Output_8859_1();
452        }
453    }
454  
455 @@ -97,6 +98,7 @@
456        } 
457      catch (Throwable ex) 
458        { 
459 +          /*
460         try
461           {
462             // We pass the original name to iconv and let it handle
463 @@ -105,10 +107,11 @@
464           }
465         catch (Throwable _)
466           {
467 +          */
468             // Put the original exception in the throwable.
469             throw new java.io.UnsupportedEncodingException(encoding + " ("
470                                                            + ex + ')');
471 -         }
472 +            //}
473        }
474    }
475  
476 diff -rBub libjava/gnu/gcj/runtime/FirstThread.javalibjava/gnu/gcj/runtime/FirstThread.java
477 --- libjava/gnu/gcj/runtime/FirstThread.java    Wed Oct 10 15:25:43 2001
478 +++ libjava/gnu/gcj/runtime/FirstThread.java    Fri Feb 27 05:05:29 2004
479 @@ -90,8 +90,10 @@
480    // classes are linked in.  Otherwise bootstrapping fails.  These
481    // classes are only referred to via Class.forName(), so we add an
482    // explicit mention of them here.
483 +    /*
484    static final Class Kcert = java.security.cert.Certificate.class;
485    static final Class Kfile = gnu.gcj.protocol.file.Handler.class;
486    static final Class Khttp = gnu.gcj.protocol.http.Handler.class;
487    static final Class Kjar  = gnu.gcj.protocol.jar.Handler.class;
488 +    */
489  }
490 diff -rBub libjava/gnu/gcj/runtime/VMClassLoader.javalibjava/gnu/gcj/runtime/VMClassLoader.java
491 --- libjava/gnu/gcj/runtime/VMClassLoader.java  Sun Dec  8 16:03:59 2002
492 +++ libjava/gnu/gcj/runtime/VMClassLoader.java  Fri Feb 27 04:20:56 2004
493 @@ -14,13 +14,15 @@
494  import java.util.StringTokenizer;
495  import java.net.URL;
496  
497 -public final class VMClassLoader extends java.net.URLClassLoader
498 +public final class VMClassLoader extends java.lang.ClassLoader //java.net.URLClassLoader
499  {
500    private VMClassLoader ()
501    {    
502 +      /*
503      super (init());
504 +      */
505    }
506 -
507 +    /*
508    private static URL[] init() 
509    {
510      StringTokenizer st
511 @@ -40,7 +42,7 @@
512           } 
513         catch (java.net.MalformedURLException x)
514           {
515 -           /* Ignore this path element */
516 +           // Ignore this path element
517           }
518        }
519      // Add core:/ to the end of the java.class.path so any resources
520 @@ -58,7 +60,7 @@
521      p.copyInto (urls);
522      return urls;
523    }
524 -
525 +*/
526    /** This is overridden to search the internal hash table, which 
527     * will only search existing linked-in classes.   This will make
528     * the default implementation of loadClass (in ClassLoader) work right.
529 diff -rBub libjava/gnu/gcj/runtime/natVMClassLoader.cclibjava/gnu/gcj/runtime/natVMClassLoader.cc
530 --- libjava/gnu/gcj/runtime/natVMClassLoader.cc Tue Dec 10 19:15:14 2002
531 +++ libjava/gnu/gcj/runtime/natVMClassLoader.cc Fri Feb 27 04:22:00 2004
532 @@ -60,8 +60,9 @@
533      }
534  
535    // Now try loading using the interpreter.
536 +  /*
537    if (! klass)
538      klass = java::net::URLClassLoader::findClass (name);
539 -
540 +  */
541    return klass;
542  }
543 diff -rBub libjava/java/lang/Class.javalibjava/java/lang/Class.java
544 --- libjava/java/lang/Class.java        Tue Sep  3 14:33:46 2002
545 +++ libjava/java/lang/Class.java        Sat Feb 28 22:48:09 2004
546 @@ -241,6 +241,7 @@
547     */
548    public ProtectionDomain getProtectionDomain()
549    {
550 +      /*
551      SecurityManager sm = System.getSecurityManager();
552      if (sm != null)
553        sm.checkPermission(ClassLoader.protectionDomainPermission);
554 @@ -248,9 +249,12 @@
555      ProtectionDomain protectionDomain = getProtectionDomain0();
556  
557      if (protectionDomain == null)
558 +      */
559        return ClassLoader.unknownProtectionDomain;
560 +      /*
561      else
562        return protectionDomain;
563 +      */
564    }
565  
566    public String toString ()
567 diff -rBub libjava/java/lang/ClassLoader.javalibjava/java/lang/ClassLoader.java
568 --- libjava/java/lang/ClassLoader.java  Fri Jan 24 11:38:24 2003
569 +++ libjava/java/lang/ClassLoader.java  Sat Feb 28 21:07:31 2004
570 @@ -345,8 +345,8 @@
571    // FIXME: should there be a special protection domain used for native code?
572    
573    // The permission required to check what a classes protection domain is.
574 -  static final Permission protectionDomainPermission
575 -    = new RuntimePermission("getProtectionDomain");
576 +    //static final Permission protectionDomainPermission;
577 +    //= new RuntimePermission("getProtectionDomain");
578    // The protection domain returned if we cannot determine it. 
579    static ProtectionDomain unknownProtectionDomain;
580    // Protection domain to use when a class is defined without one specified.
581 @@ -355,12 +355,14 @@
582    static
583    {
584      Permissions permissions = new Permissions();
585 -    permissions.add(new AllPermission());
586 -    unknownProtectionDomain = new ProtectionDomain(null, permissions);  
587 +    //permissions.add(new AllPermission());
588 +    //unknownProtectionDomain = new ProtectionDomain(null, permissions);  
589  
590 +    /*
591      CodeSource cs = new CodeSource(null, null);
592      defaultProtectionDomain =
593        new ProtectionDomain(cs, Policy.getPolicy().getPermissions(cs));
594 +    */
595    }
596  
597    /** 
598 diff -rBub libjava/java/lang/SecurityManager.javalibjava/java/lang/SecurityManager.java
599 --- libjava/java/lang/SecurityManager.java      Sun Dec  1 08:16:19 2002
600 +++ libjava/java/lang/SecurityManager.java      Fri Feb 27 02:08:27 2004
601 @@ -297,7 +297,8 @@
602    public Object getSecurityContext()
603    {
604      // XXX Should be: return AccessController.getContext();
605 -    return new SecurityContext(getClassContext());
606 +      //return new SecurityContext(getClassContext());
607 +      return null;
608    }
609  
610    /**
611 diff -rBub libjava/java/lang/natClass.cclibjava/java/lang/natClass.cc
612 --- libjava/java/lang/natClass.cc       Thu May  1 14:52:35 2003
613 +++ libjava/java/lang/natClass.cc       Mon Mar  1 01:00:12 2004
614 @@ -72,8 +72,10 @@
615  
616    _Jv_Utf8Const *name = _Jv_makeUtf8Const (buffer, length);
617  
618 +  /*
619    if (! _Jv_VerifyClassName (name))
620      throw new java::lang::ClassNotFoundException (className);
621 +  */
622  
623    jclass klass = (buffer[0] == '[' 
624                   ? _Jv_FindClassFromSignature (name->data, loader)
625 @@ -1518,7 +1520,7 @@
626      return;
627    
628    klass->otable->state = 1;
629 -
630 +  return;
631    int index = 0;
632    _Jv_MethodSymbol sym = klass->otable_syms[0];
633  
634 diff -rBub libjava/java/lang/natClassLoader.cclibjava/java/lang/natClassLoader.cc
635 --- libjava/java/lang/natClassLoader.cc Thu Dec 19 11:32:17 2002
636 +++ libjava/java/lang/natClassLoader.cc Sun Feb 29 23:55:48 2004
637 @@ -195,6 +195,7 @@
638    _Jv_Constants *pool = &klass->constants;
639    for (int index = 1; index < pool->size; ++index)
640      {
641 +      /*
642        if (pool->tags[index] == JV_CONSTANT_Class)
643         {
644           _Jv_Utf8Const *name = pool->data[index].utf8;
645 @@ -217,12 +218,13 @@
646         }
647        else if (pool->tags[index] == JV_CONSTANT_String)
648         {
649 +      */
650           jstring str;
651  
652           str = _Jv_NewStringUtf8Const (pool->data[index].utf8);
653           pool->data[index].o = str;
654 -         pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
655 -       }
656 +         //pool->tags[index] |= JV_CONSTANT_ResolvedFlag;
657 +          //}
658      }
659  
660  #ifdef INTERPRETER
661 @@ -253,10 +255,10 @@
662  
663    if (klass->vtable == NULL)
664      _Jv_MakeVTable(klass);
665 -
666 +  /*
667    if (klass->otable != NULL && klass->otable->state == 0)
668      _Jv_LinkOffsetTable(klass);
669 -
670 +  */
671    klass->notifyAll ();
672  
673    _Jv_PushClass (klass);
674 diff -rBub libjava/java/security/Security.javalibjava/java/security/Security.java
675 --- libjava/java/security/Security.java Tue Dec 31 14:49:37 2002
676 +++ libjava/java/security/Security.java Sat Feb 28 21:33:32 2004
677 @@ -60,9 +60,11 @@
678  
679    static
680    {
681 +      /*
682      String base = System.getProperty("gnu.classpath.home.url");
683      loadProviders(base, System.getProperty("gnu.classpath.vm.shortname"));
684      loadProviders(base, "classpath");
685 +      */
686    }
687  
688    // This class can't be instantiated.
689 diff -rBub libjava/libgcj.spec.inlibjava/libgcj.spec.in
690 --- libjava/libgcj.spec.in      Wed Feb 12 18:09:27 2003
691 +++ libjava/libgcj.spec.in      Sun Feb 29 17:15:19 2004
692 @@ -4,6 +4,7 @@
693  # to link with libgcj.
694  #
695  %rename lib liborig
696 -*lib: -lgcj -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
697 +*lib: -lm @LIBICONV@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
698 +
699 +*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ -fkeep-inline-functions -fno-omit-frame-pointer -Os -ffunction-sections -fdata-sections
700  
701 -*jc1: @HASH_SYNC_SPEC@ @DIVIDESPEC@ @CHECKREFSPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@ @BACKTRACESPEC@ @IEEESPEC@ -fkeep-inline-functions
702 diff -rBub libjava/prims.cclibjava/prims.cc
703 --- libjava/prims.cc    Fri Apr 25 09:02:21 2003
704 +++ libjava/prims.cc    Sat Feb 28 20:32:25 2004
705 @@ -165,6 +165,7 @@
706  {
707    int len;
708    _Jv_ushort *aptr, *bptr;
709 +  if (a == NULL || b == NULL) return false;
710    if (a == b)
711      return true;
712    if (a->hash != b->hash)
713 @@ -188,6 +189,7 @@
714  jboolean
715  _Jv_equal (Utf8Const* a, jstring str, jint hash)
716  {
717 +  if (a == NULL) return false;
718    if (a->hash != (_Jv_ushort) hash)
719      return false;
720    jint len = str->length();
721 @@ -210,6 +212,7 @@
722  jboolean
723  _Jv_equaln (Utf8Const *a, jstring str, jint n)
724  {
725 +  if (a == NULL) return false;
726    jint len = str->length();
727    jint i = 0;
728    jchar *sptr = _Jv_GetStringChars (str);
729 @@ -936,7 +939,7 @@
730  
731    _Jv_platform_initialize ();
732  
733 -  _Jv_JNI_Init ();
734 +  //  _Jv_JNI_Init ();
735  
736    _Jv_GCInitializeFinalizers (&::gnu::gcj::runtime::FinalizerThread::finalizerReady);
737