Ignore:
Timestamp:
Aug 3, 2011, 11:51:30 AM (14 years ago)
Author:
bird
Message:

tools/G*: debug splitting.

File:
1 edited

Legend:

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

    r2431 r2541  
    5959TOOL_GCC64_LD_SYSMOD_MAP ?=
    6060endif
     61if1of ($(KBUILD_HOST), solaris)
     62 TOOL_GCC64_OBJCOPY ?= gobjcopy$(HOSTSUFF_EXE)
     63else
     64 TOOL_GCC64_OBJCOPY ?= objcopy$(HOSTSUFF_EXE)
     65endif
     66
    6167ifdef SLKRUNS
    62 TOOL_GCC64_CC  += -fmessage-length=0
    63 TOOL_GCC64_CXX += -fmessage-length=0
     68 TOOL_GCC64_CC  += -fmessage-length=0
     69 TOOL_GCC64_CXX += -fmessage-length=0
    6470endif
    6571
     
    172178endef
    173179else # !KBUILD_USE_KOBJCACHE
    174 
    175180TOOL_GCC64_COMPILE_CXX_OUTPUT =
    176181define TOOL_GCC64_COMPILE_CXX_CMDS
     
    249254TOOL_GCC64_LINK_PROGRAM_OUTPUT =
    250255TOOL_GCC64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).map
     256TOOL_GCC64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).debug
     257TOOL_GCC64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    251258TOOL_GCC64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    252259TOOL_GCC64_LINK_PROGRAM_DEPORD =
     
    256263                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    257264                $(call TOOL_GCC64_LD_MAP,$(outbase).map)
     265 ifeq ($(ld_debug),split)
     266        $(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     267        $(CHMOD) a-x $(outbase).debug
     268        $(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     269 endif
    258270endef
    259271
     
    274286TOOL_GCC64_LINK_DLL_OUTPUT =
    275287TOOL_GCC64_LINK_DLL_OUTPUT_MAYBE = $(outbase).map
     288TOOL_GCC64_LINK_DLL_OUTPUT_DEBUG = $(outbase).debug
     289TOOL_GCC64_LINK_DLL_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    276290TOOL_GCC64_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    277291TOOL_GCC64_LINK_DLL_DEPORD =
     
    283297                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    284298                $(call TOOL_GCC64_LD_MAP,$(outbase).map)
     299 ifeq ($(ld_debug),split)
     300        $(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     301        $(CHMOD) a-x $(outbase).debug
     302        $(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     303 endif
    285304endef
    286305
     
    301320TOOL_GCC64_LINK_SYSMOD_OUTPUT =
    302321TOOL_GCC64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
     322TOOL_GCC64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).debug
     323TOOL_GCC64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).debug=>$(basename $(3)).debug
    303324TOOL_GCC64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
    304325TOOL_GCC64_LINK_SYSMOD_DEPORD =
     
    308329                $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))\
    309330                $(call TOOL_GCC64_LD_SYSMOD_MAP,$(outbase).map)
    310 endef
    311 
     331 ifeq ($(ld_debug),split)
     332        $(TOOL_GCC64_OBJCOPY) --only-keep-debug $(out) $(outbase).debug
     333        $(CHMOD) a-x $(outbase).debug
     334        $(TOOL_GCC64_OBJCOPY) --strip-debug --strip-unneeded --add-gnu-debuglink=$(outbase).debug $(out)
     335 endif
     336endef
     337
Note: See TracChangeset for help on using the changeset viewer.