How to add options to the javac build in the JDK 8 repo?
Joe Darcy
joe.darcy at oracle.com
Wed Aug 14 18:47:53 UTC 2013
Hi Erik,
On 08/14/2013 03:08 AM, Erik Joelsson wrote:
> Hello Joe,
>
> On 2013-08-13 23:31, Joe Darcy wrote:
>> A follow-up, the build incantation to embed a comma seems to be
>> "(COMMA)". Therefore, I will upgrade this to a code review request:
>>
> Actually, you need to use $(COMMA) for it to work. Unfortunately FLAGS
> isn't a valid parameter to the SetupJavaCompilation macro and will be
> silently ignored. For a list of valid parameters, see
> common/makefiles/JavaCompilation.gmk. ADD_JAVAC_FLAGS is probably the
> one you are looking for. Using this would result in two -Xlint
> parameters on the javac line however.
>
> Each SetupJavaCompilation call refers to a "SETUP" which is a compiler
> configuration. GENERATE_JDKBYTECODE is defined in
> jdk/makefiles/Setup.gmk and includes an -Xlint line disabling most
> warnings. I tried replacing that with your line for
> GENERATE_JDKBYTECODE. Unfortunately I had to disable fallthrough, try
> and finally to get the build to pass. It looked like only one warning
> per kind so should be easy to fix.
Thanks for the patch. Here is a similar patch I successfully used to
build after pushing a "dep-ann" fix to the TL repo:
--- a/makefiles/Setup.gmk Wed Aug 14 11:26:32 2013 -0700
+++ b/makefiles/Setup.gmk Wed Aug 14 11:45:16 2013 -0700
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights
reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights
reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,7 @@
#
DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
+JAVAC_WARNINGS:=-Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,classfile,dep-ann,divzero,empty,try,varargs
-Werror
# The generate old bytecode javac setup uses the new compiler to
compile for the
# boot jdk to generate tools that need to be run with the boot jdk.
@@ -41,7 +42,7 @@
JVM:=$(JAVA),\
JAVAC:=$(NEW_JAVAC),\
FLAGS:=-bootclasspath $(JDK_OUTPUTDIR)/classes -source 8 -target 8 \
- -encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS) \
+ -encoding ascii -XDignore.symbol.file=true $(JAVAC_WARNINGS) \
$(GENERATE_JDKBYTECODE_EXTRA_FLAGS),\
SERVER_DIR:=$(SJAVAC_SERVER_DIR),\
SERVER_JVM:=$(SJAVAC_SERVER_JAVA)))
Some of the other warning categories only have one or two instances in
the build so should be easy to add.
Thanks,
-Joe
More information about the build-dev
mailing list