Mac problem(?), new build, --with-debug-level=slowdebug

David Chase david.r.chase at oracle.com
Fri Jan 11 14:54:16 UTC 2013


On 2013-01-10, at 3:56 AM, Staffan Larsen <staffan.larsen at oracle.com> wrote:

> See: http://bugs.sun.com/view_bug.do?bug_id=8004490
> 
> Patch: http://hg.openjdk.java.net/jdk8/build/rev/2d9bb72b4e34
> 
> /Staffan

I tried the workaround in this patch, and it did not seem to result in a debuggable hotspot.

I also tried the steps you recommended with jdk8-build (last night, checked out fresh),
both exactly as you specified (minus closed repositories)
and with the HOTSPOT_MAKE_ARGS=universal_fastdebug workaround
from the bug report mentioned previously
( http://bugs.sun.com/view_bug.do?bug_id=8004490 )

This did not work either.

I did a little looking, and "compile.o" is about 20 times larger in the working
old-build system, and the output of "symbols compile.o" has 6000 lines instead of 1000.
I then did some builds with logging turned on to get a look at the compilation line:

not-debuggable compilation line:
CCACHE_COMPRESS=1  CCACHE_SLOPPINESS=time_macros /opt/local/bin/ccache /Developer/usr/bin/g++-4.2 -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DASSERT -DDEBUG -I. -IROOT/hotspot/src/share/vm/prims -IROOT/hotspot/src/share/vm -IROOT/hotspot/src/share/vm/precompiled -IROOT/hotspot/src/cpu/x86/vm -IROOT/hotspot/src/os_cpu/bsd_x86/vm -IROOT/hotspot/src/os/bsd/vm -IROOT/hotspot/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"25.0-b14\"" -DHOTSPOT_BUILD_TARGET="\"jvmg\"" -DHOTSPOT_BUILD_USER="\"dr2chase\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"OpenJDK\"" -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -fno-strict-aliasing -g -D_NMT_NOINLINE_ -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE -Werror -Wpointer-arith -Wconversion -Wsign-compare    -DDTRACE_ENABLED  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c -fpch-deps -MMD -MP -MF ../generated/dependencies/compile.o.d -o compile.o ROOT/hotspot/src/share/vm/opto/compile.cpp 

debuggable compilation line:
llvm-g++ -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64 -DASSERT -DDEBUG -I. -IROOT/src/closed/share/vm/prims -IROOT/src/share/vm/prims -IROOT/src/closed/share/vm -IROOT/src/share/vm -IROOT/src/share/vm/precompiled -IROOT/src/closed/cpu/x86/vm -IROOT/src/cpu/x86/vm -IROOT/src/os_cpu/bsd_x86/vm -IROOT/src/os/bsd/vm -IROOT/src/closed/os/posix/vm -IROOT/src/os/posix/vm -I../generated -DHOTSPOT_RELEASE_VERSION="\"25.0-b15-internal\"" -DHOTSPOT_BUILD_TARGET="\"jvmg\"" -DHOTSPOT_BUILD_USER="\"dr2chase\"" -DHOTSPOT_LIB_ARCH=\"amd64\" -DHOTSPOT_VM_DISTRO="\"Java HotSpot(TM)\"" -DTARGET_OS_FAMILY_bsd -DTARGET_ARCH_x86 -DTARGET_ARCH_MODEL_x86_64 -DTARGET_OS_ARCH_bsd_x86 -DTARGET_OS_ARCH_MODEL_bsd_x86_64 -DTARGET_COMPILER_gcc -DCOMPILER2 -DCOMPILER1 -fPIC -fno-rtti -fno-exceptions -pthread -fcheck-new -m64 -pipe -fno-strict-aliasing -g -D_NMT_NOINLINE_ -DVM_LITTLE_ENDIAN -D_LP64=1 -fno-omit-frame-pointer -DINCLUDE_TRACE -Werror -Wpointer-arith -Wconversion -Wsign-compare    -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c -fpch-deps -MMD -MP -MF ../generated/dependencies/compile.o.d -o compile.o ROOT/src/share/vm/opto/compile.cpp 

One obvious difference is that a different compiler is used.
I then tried to build using llvm-g++ instead of g++-4.2, but failed to obtain this result three times:

first trial:        make LOG=debug HOSTCXX=llvm-g++ >& modcxx.log
second trial: make LOG=debug HOSTCXX=llvm-g++ BUILD_CXX=llvm-g++ >& modcxx.log
third trial:      CXX=llvm-g++ sh ./configure --with-debug-level=slowdebug

In all three case, the C++ compiler actually used for the build was g++-4.2, not llvm-g++.

I have no idea if this is the cause of my debugging problem, but it seems like
a serious bug that the documented methods for specifying the C++ compiler
don't work as documented.  The output of "sh ./configure help" includes:

Some influential environment variables:
...
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
...
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

I checked the contents of
./build/macosx-x86_64-normal-server-slowdebug/hotspot-spec.gmk
AFTER specifying CXX=llvm-g++ to configure
and the string "llvm" was not contained in it.
In particular:

find . -name *.gmk -exec egrep -n llvm /dev/null {} ;
./jdk/make/common/shared/Compiler-llvm.gmk:34:   CC             = $(COMPILER_PATH)llvm-gcc
./jdk/make/common/shared/Compiler-llvm.gmk:36:  CPP             = $(COMPILER_PATH)llvm-gcc -E
./jdk/make/common/shared/Compiler-llvm.gmk:38:   CXX            = $(COMPILER_PATH)llvm-g++
./jdk/make/common/shared/Compiler-llvm.gmk:52:# Get llvm version
./jdk/make/common/shared/Defs-versions.gmk:49:  override CC_VERSION = llvm


I'll continue poking at this.
Again, this is on Mountain Lion.


Contents of 
./build/macosx-x86_64-normal-server-slowdebug/hotspot-spec.gmk
WITHOUT tweaked configure settings:
===========================
#
# Copyright (c) 2011, 2012, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#


# Chaining of spec files
HOTSPOT_SPEC:=$(dir $(SPEC))hotspot-spec.gmk
override SPEC=$(HOTSPOT_SPEC)
# Now include the base spec.gmk file
include $(BASE_SPEC)

# Additional legacy variables defined for Hotspot

OPENJDK=true

# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
BUILD_HEADLESS:=true

# Legacy setting: OPT or DBG
VARIANT:=DBG
# Legacy setting: true or false
FASTDEBUG:=false
# Legacy setting: debugging the class files?
DEBUG_CLASSFILES:=true

ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,))

# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
# compiler that produces code that can be run on the build platform.
HOSTCC:= /Developer/usr/bin/gcc-4.2
HOSTCXX:= /Developer/usr/bin/g++-4.2

####################################################
#
# Legacy Hotspot support

# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here.


# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
PLATFORM=$(OPENJDK_TARGET_OS)
# 32 or 64 bit
ARCH_DATA_MODEL=$(OPENJDK_TARGET_CPU_BITS)

ALT_BOOTDIR=$(BOOT_JDK)
# Can be /sparcv9 or /amd64 on Solaris
ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR)
# Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of x86 and x86_64.
LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of x86 and x86_64.
ARCH=$(OPENJDK_TARGET_CPU_LEGACY)
# Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64:=1
LP64:=

ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
ALT_EXPORT_PATH=$(HOTSPOT_DIST)

HOTSPOT_MAKE_ARGS:=universal_product 
# This is used from the libjvm build for C/C++ code.
HOTSPOT_BUILD_JOBS:=4
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=false

# For hotspot, override compiler/tools definition to not include FIXPATH prefix.
# Hotspot has its own handling on the Windows path situation.
CXX:=CCACHE_COMPRESS=1  CCACHE_SLOPPINESS=time_macros /opt/local/bin/ccache /Developer/usr/bin/g++-4.2
LD:=/Developer/usr/bin/gcc-4.2
MT:=
RC:=

EXTRA_CFLAGS=
EXTRA_CXXFLAGS=
EXTRA_LDFLAGS=

USE_PRECOMPILED_HEADER=1

# Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols
# creation. 
ifeq ($(ENABLE_DEBUG_SYMBOLS), true) 
  FULL_DEBUG_SYMBOLS=1
  # Ensure hotspot uses the objcopy that configure located 
  ALT_OBJCOPY:=$(OBJCOPY) 
else 
  FULL_DEBUG_SYMBOLS=0
endif

# Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false.
ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue)
  ZIP_DEBUGINFO_FILES:=1
endif
ifeq ($(ZIP_DEBUGINFO_FILES), false)
  ZIP_DEBUGINFO_FILES:=0
endif

# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
# This is needed to get the LOG setting to work properly.
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
===========================




More information about the build-dev mailing list