Use of -Werror in langtools/make and ${warnings.fatal}
Andrew Hughes
gnu.andrew at redhat.com
Thu Apr 11 05:55:45 PDT 2013
----- Original Message -----
> Ping. Andrew, I sent you a bug report with fix, for IcedTea, not OpenJDK!
> (my first IcedTea patch)
>
> Martin
>
> On Fri, Mar 1, 2013 at 4:11 PM, Martin Buchholz <martinrb at google.com> wrote:
>
> > ant can no longer be invoked directly (i.e. not via makefile) in
> > langtools/make because ${warnings.fatal} is undefined.
> >
> > cd langtools/make
> > ant -Djavac.warnings.fatal= -Dboot.java.home=$jdk6
> > -Dtarget.java.home=$jdk7 build
> > ...
> > [javac] Compiling 295 source files to
> > /usr/local/google/home/martinrb/ws/icedtea7-forest/langtools/build/bootstrap/classes
> > [javac] javac: invalid flag: ${warnings.fatal}
> >
> > Caused by this icedtea-only patch:
> >
> > # HG changeset patch
> > # User andrew
> > # Date 1345649970 -3600
> > # Node ID 26f5c80eb792e8536e15c82670dc38a140bb1ec3
> > # Parent b19919b8e86d7f17317d7cf6ca440ee4d3d4e14d
> > PR1095: Allow -Werror to be turned off.
> >
> > diff --git a/make/Makefile b/make/Makefile
> > --- a/make/Makefile
> > +++ b/make/Makefile
> > @@ -111,6 +111,12 @@
> > ANT_OPTIONS += -Ddebug.classfiles=true
> > endif
> >
> > +ifeq ($(JAVAC_WARNINGS_FATAL), true)
> > + ANT_OPTIONS += -Dwarnings.fatal=-Werror
> > +else
> > + ANT_OPTIONS += -Dwarnings.fatal=
> > +endif
> > +
> > # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
> > # and the somewhat misnamed CLASS_VERSION (-target NN)
> > ifdef TARGET_CLASS_VERSION
> > diff --git a/make/build.properties b/make/build.properties
> > --- a/make/build.properties
> > +++ b/make/build.properties
> > @@ -68,7 +68,7 @@
> > # set the following to -version to verify the versions of javac being used
> > javac.version.opt =
> > # in time, there should be no exceptions to -Xlint:all
> > -javac.lint.opts = -Xlint:all,-deprecation -Werror
> > +javac.lint.opts = -Xlint:all,-deprecation ${warnings.fatal}
> >
> > # options for the <javadoc> task for javac
> > #javadoc.jls3.url=http://java.sun.com/docs/books/jls/
> >
> >
> > Here's a possible fix, that preserves the openjdk default of -Werror,
> > renames warnings.fatal to javac.warnings.fatal, and allows escape via
> > JAVAC_WARNINGS_FATAL=false
> >
> >
> > diff --git a/make/Makefile b/make/Makefile
> > --- a/make/Makefile
> > +++ b/make/Makefile
> > @@ -111,10 +111,8 @@
> > ANT_OPTIONS += -Ddebug.classfiles=true
> > endif
> >
> > -ifeq ($(JAVAC_WARNINGS_FATAL), true)
> > - ANT_OPTIONS += -Dwarnings.fatal=-Werror
> > -else
> > - ANT_OPTIONS += -Dwarnings.fatal=
> > +ifeq ($(JAVAC_WARNINGS_FATAL), false)
> > + ANT_OPTIONS += -Djavac.warnings.fatal=
> > endif
> >
> > # Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN)
> > diff --git a/make/build.properties b/make/build.properties
> > --- a/make/build.properties
> > +++ b/make/build.properties
> > @@ -68,7 +68,8 @@
> > # set the following to -version to verify the versions of javac being used
> > javac.version.opt =
> > # in time, there should be no exceptions to -Xlint:all
> > -javac.lint.opts = -Xlint:all,-deprecation ${warnings.fatal}
> > +javac.warnings.fatal = -Werror
> > +javac.lint.opts = -Xlint:all,-deprecation ${javac.warnings.fatal}
> >
> > # options for the <javadoc> task for javac
> > #javadoc.jls3.url=http://java.sun.com/docs/books/jls/
> >
> >
>
Thanks, Martin! Sorry for the delay in replying. I'm getting as bad as Oracle... :-)
I remember seeing this but went straight into doing the security update when I came back.
I'll try and roll your fix into the release next week.
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07
More information about the distro-pkg-dev
mailing list