Ignore:
Timestamp:
Aug 2, 2011, 4:13:06 PM (14 years ago)
Author:
bird
Message:

tools/G*: split debug info - work in progress.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/tools/GXX3.kmk

    r2431 r2534  
    6464 TOOL_GXX3_LD_SYSMOD_MAP ?=
    6565endif
     66if1of ($(KBUILD_HOST), solaris)
     67 TOOL_GXX3_OBJCOPY ?= gobjcopy$(HOSTSUFF_EXE)
     68else
     69 TOOL_GXX3_OBJCOPY ?= objcopy$(HOSTSUFF_EXE)
     70endif
     71
    6672ifdef SLKRUNS
    6773 TOOL_GXX3_CC  += -fmessage-length=0
     
    257263TOOL_GXX3_LINK_PROGRAM_OUTPUT =
    258264TOOL_GXX3_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
     265TOOL_GXX3_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
     266TOOL_GXX3_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    259267TOOL_GXX3_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
    260268                $(filter %.def, $(othersrc))
     
    266274                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    267275                $(call TOOL_GXX3_LD_MAP,$(outbase).map)
     276 ifeq ($(ld_debug),split)
     277        $(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     278        $(CHMOD) a-x $(outbase).debug
     279        $(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     280 endif
    268281endef
    269282
     
    284297TOOL_GXX3_LINK_DLL_OUTPUT =
    285298TOOL_GXX3_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
     299TOOL_GXX3_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
     300TOOL_GXX3_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    286301TOOL_GXX3_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
    287302                $(filter %.def, $(othersrc))
     
    295310                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    296311                $(call TOOL_GXX3_LD_MAP,$(outbase).map)
     312 ifeq ($(ld_debug),split)
     313        $(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     314        $(CHMOD) a-x $(outbase).debug
     315        $(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     316 endif
    297317endef
    298318
     
    313333TOOL_GXX3_LINK_SYSMOD_OUTPUT =
    314334TOOL_GXX3_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
     335TOOL_GXX3_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
     336TOOL_GXX3_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    315337TOOL_GXX3_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))\
    316338                $(filter %.def, $(othersrc))
     
    322344                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    323345                $(call TOOL_GXX3_LD_SYSMOD_MAP,$(outbase).map)
    324 endef
    325 
     346 ifeq ($(ld_debug),split)
     347        $(TOOL_GXX32_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     348        $(CHMOD) a-x $(outbase).debug
     349        $(TOOL_GXX32_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     350 endif
     351endef
     352
Note: See TracChangeset for help on using the changeset viewer.