Merge

Thu, 24 May 2012 12:57:01 -0700

author
dcubed
date
Thu, 24 May 2012 12:57:01 -0700
changeset 3799
fb8f9ab27c14
parent 3797
df84b4a3ebcb
parent 3798
9c1709c4c80c
child 3801
17be2328b50b

Merge

make/solaris/makefiles/defs.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/vm.make file | annotate | diff | comparison | revisions
make/windows/makefiles/defs.make file | annotate | diff | comparison | revisions
     1.1 --- a/make/solaris/makefiles/defs.make	Thu May 24 13:37:47 2012 +0200
     1.2 +++ b/make/solaris/makefiles/defs.make	Thu May 24 12:57:01 2012 -0700
     1.3 @@ -123,25 +123,10 @@
     1.4    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
     1.5      # Default OBJCOPY comes from the SUNWbinutils package:
     1.6      DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
     1.7 -    ifeq ($(VM_PLATFORM),solaris_amd64)
     1.8 -      # On Solaris AMD64/X64, gobjcopy is not happy and fails:
     1.9 -      #
    1.10 -      # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
    1.11 -      # BFD: stKPaiop: Not enough room for program headers, try linking with -N
    1.12 -      # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
    1.13 -      # BFD: stKPaiop: Not enough room for program headers, try linking with -N
    1.14 -      # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
    1.15 -      # BFD: stKPaiop: Not enough room for program headers, try linking with -N
    1.16 -      # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
    1.17 -      _JUNK_ := $(shell \
    1.18 -        echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
    1.19 -      OBJCOPY=
    1.20 -    else
    1.21 -      OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
    1.22 -      ifneq ($(ALT_OBJCOPY),)
    1.23 -        _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
    1.24 -        OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
    1.25 -      endif
    1.26 +    OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
    1.27 +    ifneq ($(ALT_OBJCOPY),)
    1.28 +      _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
    1.29 +      OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
    1.30      endif
    1.31    else
    1.32      OBJCOPY=
     2.1 --- a/make/solaris/makefiles/dtrace.make	Thu May 24 13:37:47 2012 +0200
     2.2 +++ b/make/solaris/makefiles/dtrace.make	Thu May 24 12:57:01 2012 -0700
     2.3 @@ -108,15 +108,24 @@
     2.4  XLIBJVM_DTRACE_G_DEBUGINFO = 64/$(LIBJVM_DTRACE_G_DEBUGINFO)
     2.5  XLIBJVM_DTRACE_G_DIZ       = 64/$(LIBJVM_DTRACE_G_DIZ)
     2.6  
     2.7 -$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
     2.8 +$(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
     2.9  	@echo Making $@
    2.10  	$(QUIETLY) mkdir -p 64/ ; \
    2.11  	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
    2.12  		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
    2.13  	[ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
    2.14  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    2.15 +# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
    2.16 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    2.17 +# An empty section header has sh_addr == 0 and sh_size == 0.
    2.18 +# This problem has only been seen on Solaris X64, but we call this tool
    2.19 +# on all Solaris builds just in case.
    2.20 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    2.21  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
    2.22 -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@
    2.23 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    2.24 +# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
    2.25 +#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@
    2.26 +	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DB_DEBUGINFO) $@
    2.27    ifeq ($(STRIP_POLICY),all_strip)
    2.28  	$(QUIETLY) $(STRIP) $@
    2.29    else
    2.30 @@ -133,15 +142,19 @@
    2.31    endif
    2.32  endif
    2.33  
    2.34 -$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
    2.35 +$(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
    2.36  	@echo Making $@
    2.37  	$(QUIETLY) mkdir -p 64/ ; \
    2.38  	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
    2.39  		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
    2.40  	[ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
    2.41  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    2.42 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    2.43 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    2.44  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
    2.45 -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@
    2.46 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    2.47 +#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@
    2.48 +	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DTRACE_DEBUGINFO) $@
    2.49    ifeq ($(STRIP_POLICY),all_strip)
    2.50  	$(QUIETLY) $(STRIP) $@
    2.51    else
    2.52 @@ -198,14 +211,18 @@
    2.53  $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
    2.54  	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
    2.55  
    2.56 -$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
    2.57 +$(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
    2.58  	@echo Making $@
    2.59  	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
    2.60  		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
    2.61  	[ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
    2.62  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    2.63 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    2.64 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    2.65  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
    2.66 -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
    2.67 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    2.68 +#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
    2.69 +	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@
    2.70    ifeq ($(STRIP_POLICY),all_strip)
    2.71  	$(QUIETLY) $(STRIP) $@
    2.72    else
    2.73 @@ -222,14 +239,18 @@
    2.74    endif
    2.75  endif
    2.76  
    2.77 -$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
    2.78 +$(LIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
    2.79  	@echo Making $@
    2.80  	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
    2.81  		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
    2.82  	[ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
    2.83  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    2.84 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    2.85 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    2.86  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
    2.87 -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
    2.88 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    2.89 +#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
    2.90 +	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@
    2.91    ifeq ($(STRIP_POLICY),all_strip)
    2.92  	$(QUIETLY) $(STRIP) $@
    2.93    else
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/make/solaris/makefiles/fix_empty_sec_hdr_flags.make	Thu May 24 12:57:01 2012 -0700
     3.3 @@ -0,0 +1,51 @@
     3.4 +#
     3.5 +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     3.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 +#
     3.8 +# This code is free software; you can redistribute it and/or modify it
     3.9 +# under the terms of the GNU General Public License version 2 only, as
    3.10 +# published by the Free Software Foundation.
    3.11 +#
    3.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 +# version 2 for more details (a copy is included in the LICENSE file that
    3.16 +# accompanied this code).
    3.17 +#
    3.18 +# You should have received a copy of the GNU General Public License version
    3.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    3.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 +#
    3.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 +# or visit www.oracle.com if you need additional information or have any
    3.24 +# questions.
    3.25 +#  
    3.26 +#
    3.27 +
    3.28 +# Rules to build fix_empty_sec_hdr_flags, used by vm.make on Solaris
    3.29 +
    3.30 +GENERATED                       = ../generated
    3.31 +FIX_EMPTY_SEC_HDR_FLAGS         = $(GENERATED)/fix_empty_sec_hdr_flags
    3.32 +
    3.33 +FIX_EMPTY_SEC_HDR_FLAGS_DIR     = $(GAMMADIR)/src/os/solaris/fix_empty_sec_hdr_flags
    3.34 +FIX_EMPTY_SEC_HDR_FLAGS_SRC     = $(FIX_EMPTY_SEC_HDR_FLAGS_DIR)/fix_empty_sec_hdr_flags.c
    3.35 +FIX_EMPTY_SEC_HDR_FLAGS_FLAGS   = 
    3.36 +LIBS_FIX_EMPTY_SEC_HDR_FLAGS   += -lelf
    3.37 +
    3.38 +ifeq ("${Platform_compiler}", "sparcWorks")
    3.39 +# Enable the following FIX_EMPTY_SEC_HDR_FLAGS_FLAGS addition if you need to
    3.40 +# compare the built ELF objects.
    3.41 +#
    3.42 +# The -g option makes static data global and the "-W0,-noglobal"
    3.43 +# option tells the compiler to not globalize static data using a unique
    3.44 +# globalization prefix. Instead force the use of a static globalization
    3.45 +# prefix based on the source filepath so the objects from two identical
    3.46 +# compilations are the same.
    3.47 +#
    3.48 +# Note: The blog says to use "-W0,-xglobalstatic", but that doesn't
    3.49 +#       seem to work. I got "-W0,-noglobal" from Kelly and that works.
    3.50 +#FIX_EMPTY_SEC_HDR_FLAGS_FLAGS += -W0,-noglobal
    3.51 +endif # Platform_compiler == sparcWorks
    3.52 +
    3.53 +$(FIX_EMPTY_SEC_HDR_FLAGS): $(FIX_EMPTY_SEC_HDR_FLAGS_SRC)
    3.54 +	$(CC) -g -o $@ $< $(FIX_EMPTY_SEC_HDR_FLAGS_FLAGS) $(LIBS_FIX_EMPTY_SEC_HDR_FLAGS)
     4.1 --- a/make/solaris/makefiles/jsig.make	Thu May 24 13:37:47 2012 +0200
     4.2 +++ b/make/solaris/makefiles/jsig.make	Thu May 24 12:57:01 2012 -0700
     4.3 @@ -52,14 +52,23 @@
     4.4  LFLAGS_JSIG += -mt -xnolib
     4.5  endif
     4.6  
     4.7 -$(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
     4.8 +$(LIBJSIG): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
     4.9  	@echo Making signal interposition lib...
    4.10  	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
    4.11 -                         $(LFLAGS_JSIG) -o $@ $< -ldl
    4.12 +                         $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl
    4.13  	[ -f $(LIBJSIG_G) ] || { ln -s $@ $(LIBJSIG_G); }
    4.14  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    4.15 +# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
    4.16 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    4.17 +# An empty section header has sh_addr == 0 and sh_size == 0.
    4.18 +# This problem has only been seen on Solaris X64, but we call this tool
    4.19 +# on all Solaris builds just in case.
    4.20 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    4.21  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
    4.22 -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
    4.23 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    4.24 +# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
    4.25 +#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
    4.26 +	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJSIG_DEBUGINFO) $@
    4.27    ifeq ($(STRIP_POLICY),all_strip)
    4.28  	$(QUIETLY) $(STRIP) $@
    4.29    else
     5.1 --- a/make/solaris/makefiles/saproc.make	Thu May 24 13:37:47 2012 +0200
     5.2 +++ b/make/solaris/makefiles/saproc.make	Thu May 24 12:57:01 2012 -0700
     5.3 @@ -90,7 +90,7 @@
     5.4  # when actually building on Nevada-B158 or earlier:
     5.5  #SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
     5.6  
     5.7 -$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
     5.8 +$(LIBSAPROC): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(SASRCFILES) $(SAMAPFILE)
     5.9  	$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
    5.10  	  echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
    5.11  	  exit 1; \
    5.12 @@ -109,8 +109,17 @@
    5.13  	           -ldl -ldemangle -lthread -lc
    5.14  	[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
    5.15  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    5.16 +# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
    5.17 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    5.18 +# An empty section header has sh_addr == 0 and sh_size == 0.
    5.19 +# This problem has only been seen on Solaris X64, but we call this tool
    5.20 +# on all Solaris builds just in case.
    5.21 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    5.22  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
    5.23 -	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
    5.24 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    5.25 +# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
    5.26 +#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
    5.27 +	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBSAPROC_DEBUGINFO) $@
    5.28    ifeq ($(STRIP_POLICY),all_strip)
    5.29  	$(QUIETLY) $(STRIP) $@
    5.30    else
     6.1 --- a/make/solaris/makefiles/vm.make	Thu May 24 13:37:47 2012 +0200
     6.2 +++ b/make/solaris/makefiles/vm.make	Thu May 24 12:57:01 2012 -0700
     6.3 @@ -149,6 +149,10 @@
     6.4  include $(MAKEFILES_DIR)/add_gnu_debuglink.make
     6.5  
     6.6  #----------------------------------------------------------------------
     6.7 +# fix_empty_sec_hdr_flags tool
     6.8 +include $(MAKEFILES_DIR)/fix_empty_sec_hdr_flags.make
     6.9 +
    6.10 +#----------------------------------------------------------------------
    6.11  # JVM
    6.12  
    6.13  JVM      = jvm
    6.14 @@ -280,7 +284,7 @@
    6.15  LINK_VM = $(LINK_LIB.CXX)
    6.16  endif
    6.17  # making the library:
    6.18 -$(LIBJVM): $(ADD_GNU_DEBUGLINK) $(LIBJVM.o) $(LIBJVM_MAPFILE) 
    6.19 +$(LIBJVM): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(LIBJVM.o) $(LIBJVM_MAPFILE) 
    6.20  ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
    6.21  	@echo Linking vm...
    6.22  	$(QUIETLY) $(LINK_LIB.CXX/PRE_HOOK)
    6.23 @@ -290,10 +294,15 @@
    6.24  	$(QUIETLY) [ -f $(LIBJVM_G) ] || ln -s $@ $(LIBJVM_G)
    6.25  	$(QUIETLY) [ -f $(LIBJVM_G).1 ] || ln -s $@.1 $(LIBJVM_G).1
    6.26  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    6.27 +# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
    6.28 +# Clear the SHF_ALLOC flag (if set) from empty section headers.
    6.29 +# An empty section header has sh_addr == 0 and sh_size == 0.
    6.30 +# This problem has only been seen on Solaris X64, but we call this tool
    6.31 +# on all Solaris builds just in case.
    6.32 +	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
    6.33  	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
    6.34 -# $(OBJCOPY) --add-gnu-debuglink=... corrupts the SUNW_dof section
    6.35 -# in libjvm.so. Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY)
    6.36 -# is available.
    6.37 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
    6.38 +# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
    6.39  #	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
    6.40  	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DEBUGINFO) $@
    6.41    ifeq ($(STRIP_POLICY),all_strip)
     7.1 --- a/make/windows/makefiles/defs.make	Thu May 24 13:37:47 2012 +0200
     7.2 +++ b/make/windows/makefiles/defs.make	Thu May 24 12:57:01 2012 -0700
     7.3 @@ -143,14 +143,7 @@
     7.4  MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
     7.5  
     7.6  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
     7.7 -  # Disable ZIP_DEBUGINFO_FILES by default because various tests are
     7.8 -  # failing in nightly when the debug info files are ZIP'ed.
     7.9 -  #ZIP_DEBUGINFO_FILES ?= 0
    7.10 -  # The above conditional setting logic is unreliable on Windows for
    7.11 -  # unknown reasons. We force ZIP_DEBUGINFO_FILES to be disabled on
    7.12 -  # Windows until we figure out why the various tests are failing
    7.13 -  # AND why the conditional setting logic is unreliable.
    7.14 -  ZIP_DEBUGINFO_FILES=0
    7.15 +  ZIP_DEBUGINFO_FILES ?= 1
    7.16  else
    7.17    ZIP_DEBUGINFO_FILES=0
    7.18  endif
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/os/solaris/fix_empty_sec_hdr_flags/fix_empty_sec_hdr_flags.c	Thu May 24 12:57:01 2012 -0700
     8.3 @@ -0,0 +1,181 @@
     8.4 +/*
     8.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     8.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.7 + *
     8.8 + * This code is free software; you can redistribute it and/or modify it
     8.9 + * under the terms of the GNU General Public License version 2 only, as
    8.10 + * published by the Free Software Foundation.
    8.11 + *
    8.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    8.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    8.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    8.15 + * version 2 for more details (a copy is included in the LICENSE file that
    8.16 + * accompanied this code).
    8.17 + *
    8.18 + * You should have received a copy of the GNU General Public License version
    8.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    8.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    8.21 + *
    8.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    8.23 + * or visit www.oracle.com if you need additional information or have any
    8.24 + * questions.
    8.25 + *
    8.26 + */
    8.27 +
    8.28 +/*
    8.29 + * Name:        fix_empty_sec_hdr_flags.c
    8.30 + *
    8.31 + * Description: Remove the SHF_ALLOC flag from "empty" section headers.
    8.32 + *     An "empty" section header has sh_addr == 0 and sh_size == 0.
    8.33 + *
    8.34 + *     This program is adapted from the example program shown on the
    8.35 + *     elf(3elf) man page and from code from the Solaris compiler
    8.36 + *     driver.
    8.37 + */
    8.38 +
    8.39 +#include <fcntl.h>
    8.40 +#include <stdio.h>
    8.41 +#include <libelf.h>
    8.42 +#include <stdlib.h>
    8.43 +#include <string.h>
    8.44 +#include <unistd.h>
    8.45 +
    8.46 +static void failure(void);
    8.47 +
    8.48 +void
    8.49 +main(int argc, char ** argv) {
    8.50 +    void *        ehdr;           /* ELF header */
    8.51 +    unsigned int  i;              /* section counter */
    8.52 +    int           fd;             /* descriptor for file */
    8.53 +    Elf *         elf;            /* ELF descriptor */
    8.54 +    char *        elf_ident;      /* ELF identity string */
    8.55 +    char *        elf_obj;        /* elf_obj file */
    8.56 +    int           fix_count;      /* number of flags fixed */
    8.57 +    int           is_elfclass64;  /* is an ELFCLASS64 file? */
    8.58 +    Elf_Scn *     scn;            /* ELF section descriptor */
    8.59 +    void *        shdr;           /* ELF section header */
    8.60 +    Elf_Data *    shstrtab;       /* ELF section header string table */
    8.61 +
    8.62 +    if (argc != 2) {
    8.63 +        (void) fprintf(stderr, "Usage: %s elf_obj\n", argv[0]);
    8.64 +        exit(2);
    8.65 +    }
    8.66 +
    8.67 +    /* open the elf_obj */
    8.68 +    elf_obj = argv[1];
    8.69 +    if ((fd = open(elf_obj, O_RDWR)) == -1) {
    8.70 +        (void) fprintf(stderr, "%s: cannot open file.\n", elf_obj);
    8.71 +        exit(3);
    8.72 +    }
    8.73 +
    8.74 +    (void) printf("Opening '%s' for update\n", elf_obj);
    8.75 +    (void) fflush(stdout);
    8.76 +    (void) elf_version(EV_CURRENT);  /* coordinate ELF versions */
    8.77 +
    8.78 +    /* obtain the ELF descriptors from the input file */
    8.79 +    if ((elf = elf_begin(fd, ELF_C_RDWR, NULL)) == NULL) {
    8.80 +        failure();
    8.81 +    }
    8.82 +
    8.83 +    /* determine if ELFCLASS64 or not? */
    8.84 +    elf_ident = elf_getident(elf, NULL);
    8.85 +    is_elfclass64 = (elf_ident[EI_CLASS] == ELFCLASS64);
    8.86 +
    8.87 +    /* get the ELF header */
    8.88 +    if (is_elfclass64) {
    8.89 +        ehdr = elf64_getehdr(elf);
    8.90 +    } else {
    8.91 +        ehdr = elf32_getehdr(elf);
    8.92 +    }
    8.93 +    if (ehdr == NULL) {
    8.94 +        failure();
    8.95 +    }
    8.96 +
    8.97 +    /* get the ELF section descriptor */
    8.98 +    if (is_elfclass64) {
    8.99 +        scn = elf_getscn(elf, ((Elf64_Ehdr *) ehdr)->e_shstrndx);
   8.100 +    } else {
   8.101 +        scn = elf_getscn(elf, ((Elf32_Ehdr *) ehdr)->e_shstrndx);
   8.102 +    }
   8.103 +    if (scn == NULL) {
   8.104 +        failure();
   8.105 +    }
   8.106 +
   8.107 +    /* get the section header string table */
   8.108 +    shstrtab = elf_getdata(scn, NULL);
   8.109 +    if (shstrtab == NULL) {
   8.110 +        failure();
   8.111 +    }
   8.112 +
   8.113 +    fix_count = 0;
   8.114 +
   8.115 +    /* traverse the sections of the input file */
   8.116 +    for (i = 1, scn = NULL; scn = elf_nextscn(elf, scn); i++) {
   8.117 +        int    has_flag_set;  /* is SHF_ALLOC flag set? */
   8.118 +        int    is_empty;      /* is section empty? */
   8.119 +        char * name;          /* short hand pointer */
   8.120 +
   8.121 +        /* get the section header */
   8.122 +        if (is_elfclass64) {
   8.123 +            shdr = elf64_getshdr(scn);
   8.124 +        } else {
   8.125 +            shdr = elf32_getshdr(scn);
   8.126 +        }
   8.127 +        if (shdr == NULL) {
   8.128 +            failure();
   8.129 +        }
   8.130 +
   8.131 +        if (is_elfclass64) {
   8.132 +            name = (char *)shstrtab->d_buf + ((Elf64_Shdr *) shdr)->sh_name;
   8.133 +        } else {
   8.134 +            name = (char *)shstrtab->d_buf + ((Elf32_Shdr *) shdr)->sh_name;
   8.135 +        }
   8.136 +
   8.137 +        if (is_elfclass64) {
   8.138 +            has_flag_set = ((Elf64_Shdr *) shdr)->sh_flags & SHF_ALLOC;
   8.139 +            is_empty = ((Elf64_Shdr *) shdr)->sh_addr == 0 &&
   8.140 +                ((Elf64_Shdr *) shdr)->sh_size == 0;
   8.141 +        } else {
   8.142 +            has_flag_set = ((Elf32_Shdr *) shdr)->sh_flags & SHF_ALLOC;
   8.143 +            is_empty = ((Elf32_Shdr *) shdr)->sh_addr == 0 &&
   8.144 +                ((Elf32_Shdr *) shdr)->sh_size == 0;
   8.145 +        }
   8.146 +
   8.147 +        if (is_empty && has_flag_set) {
   8.148 +            (void) printf("section[%u] '%s' is empty, "
   8.149 +                "but SHF_ALLOC flag is set.\n", i, name);
   8.150 +            (void) printf("Clearing the SHF_ALLOC flag.\n");
   8.151 +
   8.152 +            if (is_elfclass64) {
   8.153 +                ((Elf64_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
   8.154 +            } else {
   8.155 +                ((Elf32_Shdr *) shdr)->sh_flags &= ~SHF_ALLOC;
   8.156 +            }
   8.157 +            fix_count++;
   8.158 +        }
   8.159 +    }  /* end for each ELF section */
   8.160 +
   8.161 +    if (fix_count > 0) {
   8.162 +        (void) printf("Saving %d updates to '%s'\n", fix_count, elf_obj);
   8.163 +        (void) fflush(stdout);
   8.164 +        (void) elf_update(elf, ELF_C_NULL);   /* recalc ELF memory structures */
   8.165 +        (void) elf_update(elf, ELF_C_WRITE);  /* write out changes to ELF obj */
   8.166 +    } else {
   8.167 +        (void) printf("No SHF_ALLOC flags needed to be cleared.\n");
   8.168 +    }
   8.169 +
   8.170 +    (void) elf_end(elf);                  /* done with ELF obj */
   8.171 +    (void) close(fd);
   8.172 +
   8.173 +    (void) printf("Done %s '%s'\n",
   8.174 +               (fix_count > 0) ? "updating" : "with", elf_obj);
   8.175 +    (void) fflush(stdout);
   8.176 +    exit(0);
   8.177 +}  /* end main */
   8.178 +
   8.179 +
   8.180 +static void
   8.181 +failure() {
   8.182 +    (void) fprintf(stderr, "%s\n", elf_errmsg(elf_errno()));
   8.183 +    exit(6);
   8.184 +}

mercurial