[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
[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 #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 #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 #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 #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|-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 #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 " statement: static const jint DEBUG = 1L; #include 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 --e
[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 #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