During bootstrap on a SMP machine, I got /export/build/gnu/gcc-3.4-ia32e/build-ia32e-linux/gcc/gcj -B/export/build/gnu/gcc-3.4-ia32e/build-ia32e-linux/ia32e-linux/libjava/ -B/export/build/gnu/gcc-3.4-ia32e/build-ia32e-linux/gcc/ --encoding=UTF-8 -Wno-deprecated -C -g -classpath '' -bootclasspath /export/build/gnu/gcc-3.4-ia32e/build-ia32e-linux/ia32e-linux/libjava:/net/gnu/export/gnu/src/gcc-3.4/gcc/libjava -d /export/build/gnu/gcc-3.4-ia32e/build-ia32e-linux/ia32e-linux/libjava /net/gnu/export/gnu/src/gcc-3.4/gcc/libjava/java/util/regex/Pattern.java /net/gnu/export/gnu/src/gcc-3.4/gcc/libjava/java/util/regex/Pattern.java: In class `java.util.regex.Pattern': /net/gnu/export/gnu/src/gcc-3.4/gcc/libjava/java/util/regex/Pattern.java: In method `<clinit>()': /net/gnu/export/gnu/src/gcc-3.4/gcc/libjava/java/util/regex/Pattern.java:1: fatal error: can't create directory /export/build/gnu/gcc-3.4-ia32e/build-ia32e-linux/ia32e-linux/libjava/java/util/regex: File exists compilation terminated. The problem is while (1) { char *s = strchr (dname, sep); if (s == NULL) break; *s = '\0'; if (stat (r, &sb) == -1 /* Try to make it. */ && mkdir (r, 0755) == -1) fatal_error ("can't create directory %s: %m", r); *s = sep; /* Skip consecutive separators. */ for (dname = s + 1; *dname && *dname == sep; ++dname) ; } in jcf-write.c. 'r' can be created between stat and mkdir.
confirmed.
Created attachment 5840 [details] proposed fix Could you try the attached patch?
The proposed patch works for me.
Patch posted here: <http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01935.html>.
Subject: Bug 14315 CVSROOT: /cvs/gcc Module name: gcc Changes by: tromey@gcc.gnu.org 2004-03-23 17:54:03 Modified files: gcc/java : ChangeLog jcf-write.c Log message: PR java/14315: * jcf-write.c (make_class_file_name): Don't report if mkdir failed with EEXIST. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1347&r2=1.1348 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-write.c.diff?cvsroot=gcc&r1=1.141&r2=1.142
Fix checked in on trunk.
Can we backport this patch to 3.4?
Subject: Bug 14315 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: hjl@gcc.gnu.org 2004-05-20 16:06:14 Modified files: gcc/java : ChangeLog jcf-write.c Log message: 2004-05-20 H.J. Lu <hongjiu.lu@intel.com> PR java/14315 Backport from mainline: 2004-03-23 Tom Tromey <tromey@redhat.com> * jcf-write.c (make_class_file_name): Don't report if mkdir failed with EEXIST. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1315.2.15&r2=1.1315.2.16 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-write.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.140&r2=1.140.4.1
Fixed.