make/common/NativeCompilation.gmk
changeset 32462 f236112ab3d0
parent 32344 0b288e0efcfa
child 32568 fc5205c29b31
equal deleted inserted replaced
32461:e1cfbafc4e9c 32462:f236112ab3d0
   622             $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
   622             $1_EXTRA_LDFLAGS += "-pdb:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb" \
   623                 "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
   623                 "-map:$$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map"
   624             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
   624             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).pdb \
   625                 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
   625                 $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).map
   626 
   626 
   627           else ifeq ($(OPENJDK_TARGET_OS), solaris)
   627           else ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
   628             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
       
   629             # Setup the command line creating debuginfo files, to be run after linking.
       
   630             # It cannot be run separately since it updates the original target file
       
   631             #
       
   632             # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
       
   633             # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
       
   634             # empty section headers until a fixed $(OBJCOPY) is available.
       
   635             # An empty section header has sh_addr == 0 and sh_size == 0.
       
   636             # This problem has only been seen on Solaris X64, but we call this tool
       
   637             # on all Solaris builds just in case.
       
   638             #
       
   639             # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
       
   640             # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
       
   641             $1_CREATE_DEBUGINFO_CMDS := \
       
   642                 $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$($1_TARGET) $$(NEWLINE) \
       
   643                 $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
       
   644                 $(CD) $$($1_OUTPUT_DIR) && \
       
   645                     $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$($1_DEBUGINFO_FILES) $$($1_TARGET)
       
   646             $1_DEBUGINFO_EXTRA_DEPS := $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
       
   647 
       
   648           else ifeq ($(OPENJDK_TARGET_OS), linux)
       
   649             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
   628             $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).debuginfo
   650             # Setup the command line creating debuginfo files, to be run after linking.
   629             # Setup the command line creating debuginfo files, to be run after linking.
   651             # It cannot be run separately since it updates the original target file
   630             # It cannot be run separately since it updates the original target file
   652             $1_CREATE_DEBUGINFO_CMDS := \
   631             $1_CREATE_DEBUGINFO_CMDS := \
   653                 $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
   632                 $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \
   654                 $(CD) $$($1_OUTPUT_DIR) && \
   633                 $(CD) $$($1_OUTPUT_DIR) && \
   655                     $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
   634                     $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET)
   656 
       
   657           endif # No MacOS X support
   635           endif # No MacOS X support
   658 
   636 
   659           # This dependency dance ensures that debug info files get rebuilt
   637           # This dependency dance ensures that debug info files get rebuilt
   660           # properly if deleted.
   638           # properly if deleted.
   661           $$($1_TARGET): $$($1_DEBUGINFO_FILES)
   639           $$($1_TARGET): $$($1_DEBUGINFO_FILES)
   692         $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_CREATE_DEBUGINFO_CMDS)
   670         $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_CREATE_DEBUGINFO_CMDS)
   693     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
   671     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
   694         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
   672         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
   695 
   673 
   696     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
   674     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
   697         $$($1_DEBUGINFO_EXTRA_DEPS) $$($1_VARDEPS_FILE)
   675         $$($1_VARDEPS_FILE)
   698 		$(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)"
   676 		$(ECHO) $(LOG_INFO) "Linking $$($1_BASENAME)"
   699 		$(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \
   677 		$(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \
   700 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
   678 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
   701 		    $(LD_OUT_OPTION)$$@ \
   679 		    $(LD_OUT_OPTION)$$@ \
   702 		    $$($1_EXPECTED_OBJS) $$($1_RES) \
   680 		    $$($1_EXPECTED_OBJS) $$($1_RES) \
   733         $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION)
   711         $$($1_CODESIGN) $$($1_CREATE_DEBUGINFO_CMDS) $$($1_MANIFEST_VERSION)
   734     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
   712     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
   735         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
   713         $$($1_OBJECT_DIR)/$$($1_NOSUFFIX).vardeps)
   736 
   714 
   737     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \
   715     $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_MANIFEST) \
   738         $$($1_DEBUGINFO_EXTRA_DEPS) $$($1_VARDEPS_FILE)
   716         $$($1_VARDEPS_FILE)
   739 		$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)"
   717 		$(ECHO) $(LOG_INFO) "Linking executable $$($1_BASENAME)"
   740 		$(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \
   718 		$(call LogFailures, $$($1_OBJECT_DIR)/$1_link.log, $1_link, \
   741 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
   719 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
   742 		        $(EXE_OUT_OPTION)$$($1_TARGET) \
   720 		        $(EXE_OUT_OPTION)$$($1_TARGET) \
   743 		        $$($1_EXPECTED_OBJS) $$($1_RES) \
   721 		        $$($1_EXPECTED_OBJS) $$($1_RES) \