sbsv2/raptor/lib/flm/e32postlink.mk
changeset 28 b8fa7dfeeaa1
parent 2 39c28ec933dd
equal deleted inserted replaced
27:3a31ca4b29c4 28:b8fa7dfeeaa1
     1 #
     1 # Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
     2 # All rights reserved.
     4 # This component and the accompanying materials are made available
     3 # This component and the accompanying materials are made available
     5 # under the terms of the License "Eclipse Public License v1.0"
     4 # under the terms of the License "Eclipse Public License v1.0"
     6 # which accompanies this distribution, and is available
     5 # which accompanies this distribution, and is available
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 # Initial Contributors:
     8 # Initial Contributors:
    10 # Nokia Corporation - initial contribution.
     9 # Nokia Corporation - initial contribution.
    11 #
    10 #
    12 # Contributors:
    11 # Contributors:
    13 #
    12 #
    14 # Description: 
    13 # Description:
    15 # ARMv5 e32 postlinking FLM
    14 # Post-linking macros for supported e32 base architectures
    16 # Knows how to postlink all possible ABIV2 executables for ARM
    15 #
    17 #
    16 #
    18 
    17 
    19 # Interface
    18 define e32postlink_arm
    20 #
    19 	$(POSTLINKER) \
    21 #  Metadata supplied (or deduced from)
       
    22 #
       
    23 #   BYTEPAIRCOMPRESS
       
    24 #   CAPABILITY
       
    25 #   DEBUGGABLE                     Can be "udeb" or "urel" or "udeb urel" or ""
       
    26 #   E32TARGET
       
    27 #   EPOCALLOWDLLDATA
       
    28 #   EPOCFIXEDPROCESS
       
    29 #   EPOCHEAPSIZEMAX
       
    30 #   EPOCHEAPSIZEMIN
       
    31 #   EPOCPROCESSPRIORITY
       
    32 #   EPOCSTACKSIZE
       
    33 #   EXPORTUNFROZEN
       
    34 #   INFLATECOMPRESS
       
    35 #   POSTLINKFPU
       
    36 #   POSTLINKTARGETTYPE
       
    37 #   SID
       
    38 #   SMPSAFE
       
    39 #   UID2
       
    40 #   UID3
       
    41 #   VERSION
       
    42 #   VENDORID
       
    43 #
       
    44 #  Other
       
    45 #
       
    46 #   ARMLIBS
       
    47 #   AUTOEXPORTS                    Symbols that must be assumed to exist for this TARGETTYPE in the format: export,ordinal;export,ordinal;..
       
    48 #   CANIGNORENONCALLABLE           If the TARGETTYPE allows it, disregard non-callable exports (v-tables, type information, etc.)
       
    49 #   CANHAVEEXPORTS
       
    50 #   CLEANTARGETS
       
    51 #   ELF2E32
       
    52 #   EPOCDATALINKADDRESS            Redundant?
       
    53 #   EPOCROOT
       
    54 #   EXPTARGET
       
    55 #   GENERATED_DEFFILE
       
    56 #   GENERATED_DSO
       
    57 #   HAVE_ORDERONLY
       
    58 #   IMPORTLIBRARYREQUIRED
       
    59 #   INTERMEDIATEPATH
       
    60 #   LINKASVERSIONED
       
    61 #   LINK_TARGET                    Postlinker elf input
       
    62 #   NAMEDSYMLKUP
       
    63 #   PAGEDCODE_OPTION
       
    64 #   POSTLINKDEFFILE
       
    65 #   POSTLINKER_SUPPORTS_WDP
       
    66 #   RUNTIME_LIBS_PATH
       
    67 #   SAVESPACE
       
    68 #   STATIC_LIBS_PATH
       
    69 #   UID1
       
    70 #   VARIANTTYPE
       
    71 
       
    72 
       
    73 # Capabilities
       
    74 ADDED_CAPABILITIES:=$(subst $(CHAR_SPACE),+,$(filter-out -%,$(CAPABILITY)))
       
    75 SUBTRACTED_CAPABILITIES:=$(subst $(CHAR_SPACE),,$(filter -%,$(CAPABILITY)))
       
    76 FINAL_CAPABILITIES:=$(if $(ADDED_CAPABILITIES),$(ADDED_CAPABILITIES)$(SUBTRACTED_CAPABILITIES),NONE)
       
    77 
       
    78 # Paging options for the old postlinker
       
    79 POSTLINKER_PAGEDOPTION:=--defaultpaged
       
    80 ifeq ($(PAGED),1)
       
    81   POSTLINKER_PAGEDOPTION:=--paged
       
    82 endif
       
    83 ifeq ($(PAGED),0)
       
    84   POSTLINKER_PAGEDOPTION:--unpaged
       
    85 endif
       
    86 
       
    87 # Postlink target
       
    88 define e32postlink
       
    89 $(E32TARGET): $(LINK_TARGET) $(POSTLINKDEFFILE) $(ELF2E32) $(if $(HAVE_ORDERONLY),|,) $(EPOCROOT)/epoc32/build/TEM_LIB
       
    90 	$(call startrule,postlink) \
       
    91 	$(ELF2E32) \
       
    92 	  --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
    20 	  --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
    93 	  --version=$(VERSION) \
    21 	  --version=$(VERSION) \
    94 	  --capability=$(FINAL_CAPABILITIES) \
    22 	  --capability=$(FINAL_CAPABILITIES) \
    95 	  --linkas=$(call dblquote,$(LINKASVERSIONED)) \
    23 	  --linkas=$(call dblquote,$(LINKASVERSIONED)) \
    96 	  --fpu=$(POSTLINKFPU) \
    24 	  --fpu=$(POSTLINKER_FPU) \
    97 	  --targettype=$(POSTLINKTARGETTYPE) \
    25 	  --targettype=$(POSTLINKTARGETTYPE) \
    98 	  --output=$$(call dblquote,$$@) \
    26 	  --output=$$(call dblquote,$$@) \
    99 	  --elfinput=$(call dblquote,$(LINK_TARGET)) \
    27 	  --elfinput=$(call dblquote,$(LINK_TARGET)) \
   100 	  $(if $(UID1),--uid1=0x$(UID1),) \
    28 	  $(if $(UID1),--uid1=0x$(UID1),) \
   101 	  $(if $(UID2),--uid2=0x$(UID2),) \
    29 	  $(if $(UID2),--uid2=0x$(UID2),) \
   114 	  $(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \
    42 	  $(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \
   115 	  $(if $(EXPORTUNFROZEN),--unfrozen,) \
    43 	  $(if $(EXPORTUNFROZEN),--unfrozen,) \
   116 	  $(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \
    44 	  $(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \
   117 	  $(if $(CANIGNORENONCALLABLE), \
    45 	  $(if $(CANIGNORENONCALLABLE), \
   118 	    $(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \
    46 	    $(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \
   119 	  $(if $(CANHAVEEXPORTS), --defoutput="$(GENERATED_DEFFILE)" --dso=$(GENERATED_DSO)) \
    47 	  $(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \
   120 	  $(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \
    48 	  $(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \
   121 	  $(if $(POSTLINKER_SUPPORTS_WDP), \
    49 	  $(if $(POSTLINKER_SUPPORTS_WDP), \
   122 	    --codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \
    50 	    --codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \
   123 	    $(POSTLINKER_PAGEDOPTION)) \
    51 	    $(POSTLINKER_PAGEDOPTION)) \
   124 	  $(if $(NOCOMPRESSTARGET), \
    52 	  $(if $(NOCOMPRESSTARGET),--uncompressed, \
   125 	    --uncompressed, \
    53 	    $(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \
   126 	    $(if $(INFLATECOMPRESS),--compressionmethod inflate,$(if $(BYTEPAIRCOMPRESS),--compressionmethod bytepair,))) \
    54 	      $(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \
   127 	  --libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))" \
    55 	        --compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \
   128 	  $(if $(SAVESPACE),$(if $(EXPORTUNFROZEN),,;$(GNURM) -rf $(INTERMEDIATEPATH); true)) \
    56 	  --libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))"
   129 	$(call endrule,postlink)
       
   130 endef
    57 endef
   131 $(eval $(e32postlink))
       
   132 
    58 
   133 CLEANTARGETS:=$(CLEANTARGETS) $(E32TARGET)
    59 define e32postlink_x86
   134 CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DEFFILE)
    60 	$(POSTLINKER) \
   135 CLEANTARGETS:=$(CLEANTARGETS) $(GENERATED_DSO)
    61 	  -sid 0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
       
    62 	  -version $(VERSION) \
       
    63 	  -capability $(FINAL_CAPABILITIES) \
       
    64 	  $(if $(UID1),-uid1 0x$(UID1),) \
       
    65 	  $(if $(UID2),-uid2 0x$(UID2),) \
       
    66 	  $(if $(UID3),-uid3 0x$(UID3),) \
       
    67 	  $(if $(VENDORID),-vid 0x$(VENDORID),) \
       
    68 	  $(if $(EPOCALLOWDLLDATA),-allow,) \
       
    69 	  $(if $(EPOCPROCESSPRIORITY),-priority $(EPOCPROCESSPRIORITY),) \
       
    70 	  $(if $(EPOCSTACKSIZE),-stack 0x$(EPOCSTACKSIZE),) \
       
    71 	  $(if $(EPOCHEAPSIZEMIN),-heap 0x$(EPOCHEAPSIZEMIN) 0x$(EPOCHEAPSIZEMAX),) \
       
    72 	  $(if $(EPOCFIXEDPROCESS),-fixed,) \
       
    73 	  $(if $(EPOCDATALINKADDRESS),-datalinkaddress $(EPOCDATALINKADDRESS),) \
       
    74 	  $(if $(SMPSAFE),-smpsafe,) \
       
    75 	  $(if $(POSTLINKER_SUPPORTS_WDP), \
       
    76 	    -codepaging $(PAGEDCODE_OPTION) -datapaging $(PAGEDDATA_OPTION), \
       
    77 	    $(POSTLINKER_PAGEDOPTION)) \
       
    78 	  $(if $(NOCOMPRESSTARGET),-uncompressed, \
       
    79 	    $(if $(BYTEPAIRCOMPRESSTARGET),-compressionmethod bytepair, \
       
    80 	      -compressionmethod $(POSTLINKER_COMPRESSION_DEFAULT))) \
       
    81 	  $(call dblquote,$(LINK_TARGET)) \
       
    82 	  $$(call dblquote,$$@)
       
    83 endef