[Fixed - but ugly] Re: make bootstrap failure in libjava

Robert Collins robert.collins@itdomain.com.au
Sun Apr 15 17:48:00 GMT 2001


A patch follows. The patch is broken, but it solved the problem...
The issue isn't a strcmp: it's a tree node comparison that fails (f
(!HAS_BEEN_ALREADY_PARSED_P (file))) where the
BULID_FILENAME_IDENTIFIER_NODE function returns different nodes for
different cases filenames. I was rapdily heading into macros of macros
of macros territory, and I didn't know what effect I would have had
elsewhere if I changed things.
The problem with the hack is that it changes the filename that will be
used, rather than making a lowercase copy and passing that to the
BUILD_FILENAME_IDENTIFIER_NODE macro. That change will break on case
sensitive filesystems (cygwin with case_check:strict, all unixes etc).
I'm happy to do it right and submit a patch, but I am unsure whether to
malloc and free the string, or use the ggc_strdup() or...
Doing it right for me is: copy the filename, canonicalise it (which
should handle unix vs dos paths, but thats another problem), and then
pass the canonical version to BUILD_FILENAME_ID... On unix platforms the
canonicalisation should make the path absolute, on cygwin, absolute and
unix (if it was dos) and lowercase.
That way the file open calls still get the unaltered mixed case string.
Also I figured that your knowning where the bug is may point you at the
root cause.
Rob
Index: jcf-parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.76.2.6
diff -u -p -r1.76.2.6 jcf-parse.c
--- jcf-parse.c 2001年03月23日 19:43:44 1.76.2.6
+++ jcf-parse.c 2001年04月16日 00:40:50
@@ -642,6 +642,9 @@ jcf_parse_source ()
 java_parser_context_save_global ();
 java_push_parser_context ();
+ /* This is a hack. A nastry dirty hack. */
+ char * t=current_jcf->filename;
+ while (*t) { *t=tolower(*t);t++;}
 BUILD_FILENAME_IDENTIFIER_NODE (file, current_jcf->filename);
 if (wfl_operator == NULL_TREE)
 wfl_operator = build_expr_wfl (NULL_TREE, NULL, 0, 0);


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /