Dealing with case insensitivity
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Tue Oct 9 23:32:00 GMT 2001
I wonder if anyone has any ideas on what is the best way to change jc1
so that it can tolerate case insensitive file systems.
On Darwin, the libjava build dies immediately with:
/Users/bryce/cvs/gcc/build/gcc/gcj
-B/Users/bryce/cvs/gcc/build/powerpc-apple-darwin1.4/libjava/
-B/Users/bryce/cvs/gcc/build/gcc/ --encoding=UTF-8 -C -g -classpath
/Users/bryce/cvs/gcc/build/powerpc-apple-
darwin1.4/libjava:../../../libjava -d
/Users/bryce/cvs/gcc/build/powerpc-apple-darwin1.4/libjava
java/lang/ConcreteProcess.java
/Users/bryce/cvs/gcc/libjava/gnu/java/security/provider/gnu.java:31:
Class `gnu.java.security.provider.Gnu' already defined in
/Users/bryce/cvs/gcc/libjava/gnu/java/security/provider/Gnu.java:31.
public final class Gnu extends Provider
^
At some point the compiler tries to load "gnu.java" (because "gnu" is a
package name?), which succeeds unexpectedly, and the compiler thinks
there are two different files defining the same class.
There was a patch posted some time ago which forced everything to
lower-case, but that wouldn't be right for case-sensitive systems, and
doesn't seem to fully work anyway.
I tried to get it to canonicalise all path names using realpath() before
using BUILD_FILENAME_IDENTIFIER_NODE in jcf-parse, but realpath didn't
do what I want - it just returns the filename in the case given to it.
One solution might be to stat() all filenames before we open them, and
keep the file tree nodes in a hashtable indexed by their inode number.
This way we can be sure that the file nodes are unique. Any problems
with that approach? Anyone see better way?
regards
Bryce.
More information about the Java
mailing list