RFR: JDK-8145115: make JAVAC_FLAGS=-g no longer works

Erik Joelsson erik.joelsson at oracle.com
Thu Dec 10 14:49:42 UTC 2015


I looked closer at your actual command lines and managed to reproduce. 
The problem is JAVAC_FLAGS=-g. We have unfortunately used that name for 
a local variable in make/CompileJavaModules.gmk. Fix is pretty simple, 
just rename that local variable. In the longer term, we need to be able 
to enable -g for javac with a configure argument instead.

Bug: https://bugs.openjdk.java.net/browse/JDK-8145115
Patch:
diff -r a151b3ec17a1 make/CompileJavaModules.gmk
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -556,7 +556,7 @@
    ifneq ($(BUILD_CRYPTO), true)
    CLASSPATH += $(JDK_OUTPUTDIR)/modules/$(MODULE)
    endif
-JAVAC_FLAGS := -bootclasspath $(EMPTY_DIR) -extdirs $(EMPTY_DIR) \
+JAVAC_FLAGS_BOOTCLASSPATH := -bootclasspath $(EMPTY_DIR) -extdirs 
$(EMPTY_DIR) \
      -endorseddirs $(EMPTY_DIR) $($(MODULE)_ADD_JAVAC_FLAGS)

  $(eval $(call SetupJavaCompilation, $(MODULE), \
@@ -566,7 +566,7 @@
      BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), 
$(JDK_OUTPUTDIR)/modules/$(MODULE)), \
      HEADERS := $(SUPPORT_OUTPUTDIR)/headers/$(MODULE), \
      CLASSPATH := $(CLASSPATH), \
-    ADD_JAVAC_FLAGS := $($(MODULE)_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS) \
+    ADD_JAVAC_FLAGS := $($(MODULE)_ADD_JAVAC_FLAGS) 
$(JAVAC_FLAGS_BOOTCLASSPATH) \
  ))
  TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)

/Erik

On 2015-12-09 18:53, Severin Gehwolf wrote:
> Hi Erik,
>
> On Wed, 2015-12-09 at 17:35 +0100, Erik Joelsson wrote:
>> I'm not able to reproduce with either OracleJDK 8 or 8u66.
> The simplified reproducer is (extracted from build.log):
> ( (/usr/bin/bash /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/common/bin/logger.sh  /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging/_the.java.logging_batch.log /usr/lib/jvm/java-1.8.0-openjdk/bin/java -XX:+UseSerialGC -Xms32M -Xmx512M "-Xbootclasspath/p:/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/buildtools/interim_langtools.jar" -cp /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/buildtools/interim_langtools.jar com.sun.tools.sjavac.Main --server:portfile=/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/make-support/javacservers/server.port,id=java.logging,sjavac=/usr/lib/jvm/java-1.8.0-openjdk/bin/java%20-d64%20-Xms512M%20-Xmx2048M%20"-Xbootclasspath/p:/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/buildtools/interim_langtools.jar"%20-cp%20/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/buildtools/interim_langtools.jar%20com.sun.tools.sjavac.Main -source 9 -target 9 -encoding ascii -XDignore.symbol.file=true -Xlint:all -Werror -g -Xdoclint:all/protected,-reference '-Xdoclint/package:java.*,javax.*' -g -cp "/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.base:/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging" -implicit:none -d /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging -h /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/support/headers/java.logging.java.logging.tmp @/home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging/_the.java.logging_batch.tmp && /usr/bin/rm -f  /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging/_the.java.logging_batch.log) || (exitcode=$? && /usr/bin/mv  /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging/_the.java.logging_batch.log /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/make-support/failure-logs/java.logging.log && exit $exitcode) ) && /usr/bin/mv /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging/_the.java.logging_batch.tmp /home/sgehwolf/Documents/openjdk/upstream-sources/openjdk-9-hs-rt-testclone/build/linux-x86_64-normal-server-release/jdk/modules/java.logging/_the.java.logging_batch
>
> I'm also attaching the failing command invocation as a file (Putting
> this into a file and re-executing it reproduces the problem for me. Of
> course, your paths may differ :)
>
> Cheers,
> Severin
>
>> /Erik
>>
>> On 2015-12-09 13:33, Severin Gehwolf wrote:
>>> Hi,
>>>
>>> On Wed, 2015-12-09 at 12:15 +0100, Severin Gehwolf wrote:
>>>> Hi Mikael,
>>>>
>>>> On Wed, 2015-12-09 at 11:41 +0100, Mikael Gerdin wrote:
>>>>> Hi Severin,
>>>>>
>>>>> On 2015-12-09 11:23, Severin Gehwolf wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I'm trying to build an OpenJDK 9, hs-rt tree which fails to
>>>>>> build for
>>>>>> me with:
>>>>>>
>>>>>> jdk/src/java.logging/share/classes/sun/util/logging/internal/
>>>>>> LoggingProviderImpl.java:33: error: cannot find symbol
>>>>>> import java.lang.System.LoggerFinder;
>>>>>>                           ^
>>>>>>      symbol:   class LoggerFinder
>>>>>>      location: class System
>>>>> http://hg.openjdk.java.net/jdk9/hs-rt/jdk/file/7a67f71d3645/src
>>>>> /java.base/share/classes/java/lang/System.java#l1377
>>>>> the LoggerFinder inner class appears to exist on the hg server
>>>>> at least.
>>>> I have it in the local copy too, yet I get:
>>>> CompileJavaModules.gmk:562: recipe for target 'hs-rt/build/linux-
>>>> x86_64-normal-server-
>>>> release/jdk/modules/java.logging/_the.java.logging_batch' failed
>>>> make/Main.gmk:150: recipe for target 'java.logging-java' failed
>>>>
>>>> With the above root-cause. I'll try with a fresh clone...
>>> Same failure with fresh clone :( Here is how I configure and invoke
>>> make:
>>> bash configure \
>>>    --with-boot-jdk="$JDK_TO_BUILD_WITH" \
>>>    --with-debug-level="release" \
>>>    --disable-zip-debug-info \
>>>    --enable-unlimited-crypto \
>>>    --with-stdc++lib=dynamic \
>>>    --disable-warnings-as-errors \
>>>    --with-num-cores=8
>>>
>>> make \
>>>    DEBUG_BINARIES=true \
>>>    JAVAC_FLAGS=-g \
>>>    STRIP_POLICY=no_strip \
>>>    STRIP="" \
>>>    DISABLE_INTREE_EC=true \
>>>    ALT_OBJCOPY=none \
>>>    LOG=debug \
>>>    images
>>>
>>> Thanks,
>>> Severin
>>>
>>>>>> $ hg paths
>>>>>> default = http://hg.openjdk.java.net/jdk9/hs-rt/
>>>>>>
>>>>>> Do I need to use a different tree these days? What am I
>>>>>> missing?
>>>>> No, it should work.
>>>>> Are you sure you've updated all the sub-trees?
>>>>>
>>>>> http://hg.openjdk.java.net/code-tools/trees/
>>>>> Is a helpful hg extension to keep track of things.
>>>>>
>>>>> I've noticed that sometimes "bash get_source.sh" does not
>>>>> correctly "hg
>>>>> update" the entire forest.
>>>> I should have an updated tree, though I usually use:
>>>> $ hg pull -u
>>>> $ for i in hotspot corba jaxp jaxws jdk langtools nashorn; do
>>>> pushd $i; hg pull -u; popd; done
>>>>
>>>> I've checked just now and all repos seem to have updated
>>>> correctly. The
>>>> CI builder for Zero seems to agree[1]. Note: The above build
>>>> failure is
>>>> for a regular server JVM. Not sure what's wrong. I keep looking,
>>>> thanks!
>>>>
>>>> Cheers,
>>>> Severin
>>>>
>>>> [1] http://builder.classpath.org/jenkins/job/OpenJDK9_hs_rt_Zero/
>>>> 191/console
>>>>
>>>>> /Mikael
>>>>>
>>>>>> Thanks,
>>>>>> Severin
>>>>>>





More information about the build-dev mailing list