|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
[Bug java/30570] New: Word "DEBUG" used as a variable in VMAccessController.java breaks buildI don't know if the severity might be a "blocker" but since I have a fix (which
is not so good - but works for me) I did not want to elevate the level and take anyone away from something more important. I'm getting an error during "make bootstrap" that halts the build. In file included from /cygdrive/C/makecygwin/gcc-4_2-branch/libjava/java/security/natVMAccessController.cc:17: ./java/security/VMAccessController.h:35: error: expected unqualified-id before numeric constant make[3]: *** [java/security/natVMAccessController.lo] Error 1 make[3]: Leaving directory `/cygdrive/c/gcc-4_2-branch-build/i686-pc-cygwin/libjava' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/cygdrive/c/gcc-4_2-branch-build/i686-pc-cygwin/libjava' make[1]: *** [all-target-libjava] Error 2 make[1]: Leaving directory `/cygdrive/c/gcc-4_2-branch-build' make: *** [bootstrap] Error 2 The ".java" file is here: gcc-4_2-branch/libjava/java/security/VMAccessController.java The ".cc" file is here: gcc-4_2-branch/libjava/java/security/natVMAccessController.cc The ".h" file is made here: name=`echo classpath/lib/java/security/VMAccessController.class | sed -e 's/\.class$//' -e 's,classpath/lib/,,'`; \ /cygdrive/C/makecygwin/gcc-4_2-branch/mkinstalldirs `dirname $name`; \ ./../.././gcc/gcjh -d . -classpath '' -bootclasspath classpath/lib $name Fix: Alter /cygdrive/c/gcc-4_2-branch-build/i686-pc-cygwin/libjava/java/security/VMAccessController.h (a file built during the compile) by changing the ".h" file as shown below. Now re-type "make bootstrap". Origonal (end of created ".h" file): class java::security::VMAccessController : public ::java::lang::Object { private: static void debug (::java::lang::String *); VMAccessController (); public: // actually package-private static void pushContext (::java::security::AccessControlContext *); static void popContext (); static ::java::security::AccessControlContext *getContext (); private: static JArray< ::java::lang::Object *> *getStack (); static ::java::security::AccessControlContext *DEFAULT_CONTEXT; static const jint DEBUG = 1L; public: static ::java::lang::Class class$; }; New: class java::security::VMAccessController : public ::java::lang::Object { private: static void debug (::java::lang::String *); VMAccessController (); public: // actually package-private static void pushContext (::java::security::AccessControlContext *); static void popContext (); static ::java::security::AccessControlContext *getContext (); private: static JArray< ::java::lang::Object *> *getStack (); static ::java::security::AccessControlContext *DEFAULT_CONTEXT; #define DEBUG_TMP DEBUG #undef DEBUG static const jint DEBUG = 1L; #define DEBUG DEBUG_TMP public: static ::java::lang::Class class$; }; I am reluctant to change the ".java" or ".cc" for fear of breaking something. The file gcc-4_2-branch/libjava/java/security/VMAccessController.java defines the following: private static final boolean DEBUG = gnu.classpath.Configuration.DEBUG; Java wants the name "DEBUG" but so does something else (the compiler) so I get the error "expected unqualified-id before numeric constant". The ".ii" file (without my fix) makes the line in question "static const jint DEBUG = 1L;" change to "static const jint = 1L;". The compiler simply defines the word "DEBUG" to "" (empty string). My 'fix' saves the value (in case it is ever defined) and restores it immediately after it is finished. Unfortunatley my fix requires you to wait until the file is made, and edit it before it is used - there is enough time to do that but you need to be there at the right time. Alternatley I can wait for the make to fail, edit the file and continue. I examined the ".ii" file and there are only two lines with the word "debug/DEBUG" in them: static void debug (::java::lang::String *); and static const jint DEBUG = 1L; Only the capitalized word 'DEBUG' is affected, there are no other occurances of the word "DEBUG" in the ".ii" file so it must be a hidden internal compiler word. If I check the "-D"'s for both my cc1.exe's I get this: gcc/xgcc -g -v test.c /usr/lib/gcc/i686-pc-cygwin/4.2.0/cc1.exe -quiet -v -iprefix /cygdrive/c/gcc-4_2-branch-build/stage3-gcc/../lib/gcc/i686-pc-cygwin/4.2.0/ -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.2.0/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.2.0/../../../../i686-pc-cygwin/lib/../../include/w32api test.c -quiet -dumpbase test.c -mtune=athlon-xp -march=athlon-xp -auxbase test -g -version -o /cygdrive/c/DOCUME~1/HP_ADM~1/LOCALS~1/Temp/ccSrUn2h.s gcc/xgcc -Bgcc -g -v test.c gcc/cc1.exe -quiet -v -iprefix /cygdrive/c/gcc-4_2-branch-build/stage3-gcc/../lib/gcc/i686-pc-cygwin/4.2.0/ -isystem gcc/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.2.0/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/4.2.0/../../../../i686-pc-cygwin/lib/../../include/w32api test.c -quiet -dumpbase test.c -mtune=athlon-xp -march=athlon-xp -auxbase test -g -version -o /cygdrive/c/DOCUME~1/HP_ADM~1/LOCALS~1/Temp/ccu73DRz.s The is no "-DDEBUG" anywhere and only the one "DEBUG" in the ".h" file. The compiler (both version 3.4.4 and 4.2.0) will not accept a ".h" file with the word "DEBUG" in it. I'm not a java expert and I don't want to break the person's work. Even if the fix is to add a sed command to the Makefile (for the cygwin) platform I'd be happy. I can't help but imagine that the word "DEBUG" is a protected word - much like "unix", "__CYGWIN__", "__GNUC__", "WINVER" - and should not be used as a variable. -- Summary: Word "DEBUG" used as a variable in VMAccessController.java breaks build Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: major Priority: P3 Component: java AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rob1weld at aol dot com GCC build triplet: i686-pc-cygwin GCC host triplet: i686-pc-cygwin GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #1 from pinskia at gcc dot gnu dot org 2007-01-24 04:19 ------- DEBUG is NOT in the reserved identifier namespace so it should be ok, so I am thinking this is either a cygwin header bug or a wind32 header bug. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal Component|java |libgcj http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #2 from tromey at gcc dot gnu dot org 2007-01-29 19:03 ------- Hmm, we use "DEBUG" in java-assert.h. That is a bit unfriendly. Anyway if this define is coming from a system header, the traditional fix is to #undef it somewhere. Typically this is done in the platform flavor's header file, e.g., libjava/include/win32.h. We already have "#undef STRICT" there... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #3 from rob1weld at aol dot com 2007-02-08 20:56 ------- I found out exactly what the trouble is - it _likely_ affects ALL platforms. I use a very long set of configure options (to enable as much as possible) but the one that is causing the trouble is: --enable-libgcj-debug . I proved this by altering the file: gcc-4_2-branch/libjava/java/security/natVMAccessController.cc I added this around the "#include <config.h>" statement: static const jint DEBUG = 1L; #include <config.h> static const jint DEBUG = 1L; I then compiled the file using the exact same command that make shows on screen plus I added "-E" to show the error and examined the resulting file: # 11 "/cygdrive/C/makecygwin/gcc-4_2-branch/libjava/java/security/natVMAccessController.cc" static const jint DEBUG = 1L; # 1 "./include/config.h" 1 # 14 "/cygdrive/C/makecygwin/gcc-4_2-branch/libjava/java/security/natVMAccessController.cc" 2 static const jint 1 = 1L; The second 'jint' statement is wrong so that means that the included "config.h" wrecked things. Looking at file: "/gcc-4_2-branch-build/i686-pc-cygwin/libjava/include/config.h" we have this: /* include/config.h. Generated by configure. */ /* include/config.h.in. Generated from configure.ac by autoheader. */ /* Define this if you want runtime debugging enabled. */ #define DEBUG 1 Note: We have the same definition (without causing the error, since _this_ "config.h" is not included) here in "/gcc-4_2-branch-build/i686-pc-cygwin/libjava/classpath/include/config.h". /* include/config.h. Generated by configure. */ /* include/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you want native library runtime debugging code enabled */ #define DEBUG 1 That second one does not cause any trouble but _IF_ you are going to change the word "DEBUG" be sure to change them both if they should both be the same word. This problem comes from the file: /gcc-4_2-branch/libjava/include/config.h.in so this _IS_ a 'gcc problem' and not a problem with either classpath's source or Cygwin's headers. Here is the part of config.h.in at fault: /* include/config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define this if you want runtime debugging enabled. */ #undef DEBUG /* Define if system properties shouldn't be read from getenv("GCJ_PROPERTIES"). */ #undef DISABLE_GETENV_PROPERTIES Now that _MAY_ seem inocent enough but what happens when you run "/gcc-4_2-branch/configure --enable-libgcj-debug" is that "/gcc-4_2-branch/libjava/configure" gets passed the "--enable-libgcj-debug" and creates a "confdefs.h" file (that gets deleted - thus hiding the problem from searching). When the "/gcc-4_2-branch/libjava/configure" script gets near the end it does the "sed script routine" (to substitute variables in the "*.in" files) it uses the confdefs.h file as well. Here is the part of the configure script that says it does this: # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. That tells me that configure is replacing the "#undef DEBUG" in "config.h.in" with "#define DEBUG 1" if configure uses the parameter "--enable-libgcj-debug". This creates the problem in the "java/security/VMAccessController.h" file that is made by gcjh (I hope I explained that correctly). I just got through re-running /gcc-4_2-branch/configure (with all my long list of parameters) without using "--enable-libgcj-debug" and make runs without causing the error (while compiling gcc-4_2-branch/libjava/java/security/natVMAccessController.cc) it still breaks _elsewhere_ ;( . I am not an expert on Java and I will leave it to the experts as how best to fix this. My 2 cents is that the file /gcc-4_2-branch/libjava/configure is wrong since it sets "#define DEBUG 1" ; and in doing so it breaks the file java/security/VMAccessController.h (created by gcjh). I suggest that this is _equally_ applicable to _all_ platforms and would halt the build for anyone who uses "--enable-libgcj-debug" (_AND_ also uses other parameters that cause /gcc-4_2-branch/libjava/java/security/natVMAccessController.cc to be compiled). Since this should happen on any platform can someone else confirm it? (As a point of interest I am using this /gcc-4_2-branch/configure command: /cygdrive/C/makecygwin/gcc-4_2-branch/configure --disable-werror --verbose --target=i686-pc-cygwin --enable-languages=c,ada,c++,fortran,java,objc,obj-c++ --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-static --enable-nls --enable-multilib --with-included-gettext --enable-version-specific-runtime-libs --enable-checking --with-gxx-include-dir=/usr/include/c++/4.2.0 --enable-concept-checks --enable-sjlj-exceptions --enable-libstdcxx-debug --enable-libgcj --enable-libgcj-debug --enable-java-awt=gtk,xlib --enable-java-gc=boehm --enable-gconf-peer --enable-hash-synchronization --enable-gc-debug --enable-interpreter --enable-xmlj --enable-qt-peer --enable-regen-headers --enable-tool-wrappers --enable-objc-gc --with-system-zlib --enable-threads=posix --enable-libada --enable-libssp --enable-libmudflap --enable-win32-registry --with-x --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --with-cpu=athlon-xp --with-arch=athlon-xp --with-tune=athlon-xp ). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #4 from tromey at gcc dot gnu dot org 2007-02-09 00:03 ------- Thanks for analyzing this. I think we ought to rename libgcj's DEBUG to something else. -- tromey at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |tromey at gcc dot gnu dot |dot org |org Status|UNCONFIRMED |ASSIGNED Ever Confirmed|0 |1 Last reconfirmed|0000-00-00 00:00:00 |2007-02-09 00:03:46 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #5 from rob1weld at aol dot com 2007-05-01 09:16 ------- This "make -i check" report shows Java compiled with ZERO errors: http://gcc.gnu.org/ml/gcc-testresults/2007-04/msg01490.html gcc version 4.2.0 20070427 (prerelease) --- === libjava tests === Running target unix === libjava Summary === # of expected passes 7006 # of expected failures 12 # of untested testcases 8 --- Unfortunatly there are problems with the other tests but this is an instance of the SVN (in combination with the correctness of the tests) giving a supposed perfect result for Java (in compination with the many configure flags). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #6 from rob1weld at aol dot com 2007-07-17 00:49 ------- Another "DEBUG" just showed up in "gcc version 4.3.0 20070716": gcc-4_3-trunk/libjava/gnu/classpath/Configuration.h ... static ::java::lang::String * CLASSPATH_VERSION; static jboolean DEBUG; static const jboolean INIT_LOAD_LIBRARY = 0; ... -- rob1weld at aol dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tromey at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #7 from rob1weld at aol dot com 2009-01-11 19:52 ------- (In reply to comment #6) > Another "DEBUG" just showed up in "gcc version 4.3.0 20070716": > ... ping: gcc 4.4.0 20090111 trunk revision 143259 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #8 from rob1weld at aol dot com 2009-01-11 20:11 ------- Another "DEBUG" just showed up in "gcc version 4.3.0 20090111": gcc_trunk/libjava/java/security/VMAccessController.h # gmake ... (hours later) libtool: compile: /usr/share/src/gcc_build/./gcc/xgcc -shared-libgcc -B/usr/share/src/gcc_build/./gcc -nostdinc++ -L/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/src -L/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libstdc++-v3/src/.libs -B/usr/local/i386-pc-solaris2.11/bin/ -B/usr/local/i386-pc-solaris2.11/lib/ -isystem /usr/local/i386-pc-solaris2.11/include -isystem /usr/local/i386-pc-solaris2.11/sys-include -m64 -DHAVE_CONFIG_H -I. -I../../../../gcc_trunk/libjava -I./include -I./gcj -I../../../../gcc_trunk/libjava -Iinclude -I../../../../gcc_trunk/libjava/include -I../../../../gcc_trunk/libjava/classpath/include -Iclasspath/include -I../../../../gcc_trunk/libjava/classpath/native/fdlibm -I../../../../gcc_trunk/libjava/../boehm-gc/include -I../boehm-gc/include -I../../../../gcc_trunk/libjava/libltdl -I../../../../gcc_trunk/libjava/libltdl -I../../../../gcc_trunk/libjava/.././libjava/../gcc -I../../../../gcc_trunk/libjava/../zlib -I../../../../gcc_trunk/libjava/../libffi/include -I../libffi/include -fno-rtti -fnon-call-exceptions -fdollars-in-identifiers -Wswitch-enum -D_FILE_OFFSET_BITS=64 -ffloat-store -fomit-frame-pointer -Usun -Wextra -Wall -D_GNU_SOURCE "-DPREFIX=\"/usr/local\"" "-DTOOLEXECLIBDIR=\"/usr/local/lib/amd64\"" "-DJAVA_HOME=\"/usr/local\"" "-DBOOT_CLASS_PATH=\"/usr/local/share/java/libgcj-4.4.0.jar\"" "-DJAVA_EXT_DIRS=\"/usr/local/share/java/ext\"" "-DGCJ_ENDORSED_DIRS=\"/usr/local/share/java/gcj-endorsed\"" "-DGCJ_VERSIONED_LIBDIR=\"/usr/local/lib/amd64/gcj-4.4.0-10\"" "-DPATH_SEPARATOR=\":\"" "-DECJ_JAR_FILE=\"\"" "-DLIBGCJ_DEFAULT_DATABASE=\"/usr/local/lib/amd64/gcj-4.4.0-10/classmap.db\"" "-DLIBGCJ_DEFAULT_DATABASE_PATH_TAIL=\"gcj-4.4.0-10/classmap.db\"" -g -O2 -m64 -MT java/security/natVMAccessController.lo -MD -MP -MF java/security/.deps/natVMAccessController.Tpo -c ../../../../gcc_trunk/libjava/java/security/natVMAccessController.cc -fPIC -DPIC -o java/security/.libs/natVMAccessController.o In file included from ../../../../gcc_trunk/libjava/java/security/natVMAccessController.cc:17: ../../../../gcc_trunk/libjava/java/security/VMAccessController.h:36: error: expected unqualified-id before numeric constant gmake[5]: *** [java/security/natVMAccessController.lo] Error 1 gmake[5]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libjava' gmake[4]: *** [all-recursive] Error 1 gmake[4]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/amd64/libjava' gmake[3]: *** [multi-do] Error 1 gmake[3]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/libjava' gmake[2]: *** [all-multi] Error 2 gmake[2]: Leaving directory `/usr/share/src/gcc_build/i386-pc-solaris2.11/libjava' gmake[1]: *** [all-target-libjava] Error 2 gmake[1]: Leaving directory `/usr/share/src/gcc_build' gmake: *** [all] Error 2 I'm adding "#undef DEBUG" while I wait for the correct fix. ... private: static JArray< ::java::lang::Object * > * getStack(); static ::java::security::AccessControlContext * DEFAULT_CONTEXT; #undef DEBUG static jboolean DEBUG; public: static ::java::lang::Class class$; ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
|
|
[Bug libgcj/30570] Word "DEBUG" used as a variable in VMAccessController.java breaks build------- Comment #9 from davek at gcc dot gnu dot org 2009-08-21 02:20 ------- *** This bug has been marked as a duplicate of 38892 *** -- davek at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30570 |
| Free embeddable forum powered by Nabble | Forum Help |