This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Fix PR38892: "--enable-libgcj-debug" breaks bootstrap.


[ Not subbed, please CC me on replies. ]

    Hello Java team,

  This is the second point at which bootstrap fails for me with libgcj
debug-enabled:

In file included from /gnu/gcc/gcc/libjava/gnu/classpath/natConfiguration.cc:17:
/gnu/gcc/gcc/libjava/gnu/classpath/Configuration.h:32: error: expected
unqualified-id before numeric constant
make[3]: *** [gnu/classpath/natConfiguration.lo] Error 1

  If you look at the relevant source:

    21  class gnu::classpath::Configuration : public ::java::lang::Object
    22  {
    23
    24    Configuration();
    25    static ::java::lang::String * classpath_home();
    26    static jboolean debug();
    27    static ::java::lang::String * toolkit();
    28    static ::java::lang::String * ecj();
    29  public:
    30    static ::java::lang::String * CLASSPATH_HOME;
    31    static ::java::lang::String * CLASSPATH_VERSION;
    32    static jboolean DEBUG;

... you can probably guess immediately what went wrong:

  8592    static jboolean 1;

owing to a "#define DEBUG 1" in include/config.h, autogenerated by configure.

  So there's a preprocessor macro DEBUG that is tested by #ifdefs in
classpath/native and the toplevel intepret*.cc files, and there are a number
of these DEBUG member vars scattered through the java sources.

  One solution that occurred to me was to rename the preprocesser macro to
(e.g.) "__GCJ_DEBUG" throughout.

  Another solution that occurred to me was to rename the java class members to
(e.g.) "JDEBUG" throughout.

  What would the maintainers prefer?  Either, both, or perhaps some other option?

    cheers,
      DaveK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]