e32postlink.mk 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Copyright (c) 2010-2011 Nokia Corporation and/or its subsidiary(-ies).
  2. # All rights reserved.
  3. # This component and the accompanying materials are made available
  4. # under the terms of the License "Eclipse Public License v1.0"
  5. # which accompanies this distribution, and is available
  6. # at the URL "http://www.eclipse.org/legal/epl-v10.html".
  7. #
  8. # Initial Contributors:
  9. # Nokia Corporation - initial contribution.
  10. #
  11. # Contributors:
  12. #
  13. # Description:
  14. # Post-linking macros for supported e32 base architectures
  15. #
  16. #
  17. define e32postlink_arm
  18. $(POSTLINKER) \
  19. --sid=0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
  20. --version=$(VERSION) \
  21. --capability=$(FINAL_CAPABILITIES) \
  22. --linkas=$(call dblquote,$(LINKASVERSIONED)) \
  23. --fpu=$(POSTLINKER_FPU) \
  24. --targettype=$(POSTLINKTARGETTYPE) \
  25. --output=$$(call dblquote,$$@) \
  26. --elfinput=$(call dblquote,$(LINK_TARGET)) \
  27. $(if $(UID1),--uid1=0x$(UID1),) \
  28. $(if $(UID2),--uid2=0x$(UID2),) \
  29. $(if $(UID3),--uid3=0x$(UID3),) \
  30. $(if $(VENDORID),--vid=0x$(VENDORID),) \
  31. $(if $(EXPTARGET),--customdlltarget,) \
  32. $(if $(ARMLIBS),--excludeunwantedexports,) \
  33. $(if $(EPOCALLOWDLLDATA),--dlldata,) \
  34. $(if $(EPOCPROCESSPRIORITY),--priority=$(EPOCPROCESSPRIORITY),) \
  35. $(if $(EPOCSTACKSIZE),--stack=0x$(EPOCSTACKSIZE),) \
  36. $(if $(EPOCHEAPSIZEMIN),--heap=0x$(EPOCHEAPSIZEMIN)$(CHAR_COMMA)0x$(EPOCHEAPSIZEMAX),) \
  37. $(if $(EPOCFIXEDPROCESS),--fixedaddress,) \
  38. $(if $(EPOCDATALINKADDRESS),--datalinkaddress=$(EPOCDATALINKADDRESS),) \
  39. $(if $(NAMEDSYMLKUP),--namedlookup,) \
  40. $(if $(SMPSAFE),--smpsafe,) \
  41. $(if $(POSTLINKDEFFILE),--definput=$(POSTLINKDEFFILE),) \
  42. $(if $(EXPORTUNFROZEN),--unfrozen,) \
  43. $(if $(AUTOEXPORTS),--sysdef=$(call dblquote,$(AUTOEXPORTS)),) \
  44. $(if $(CANIGNORENONCALLABLE), \
  45. $(if $(IMPORTLIBRARYREQUIRED),,--ignorenoncallable),) \
  46. $(if $(CANHAVEEXPORTS), --defoutput=$(call dblquote,$(GENERATED_DEFFILE)) --dso=$(GENERATED_DSO)) \
  47. $(if $(filter $(VARIANTTYPE),$(DEBUGGABLE)),--debuggable,) \
  48. $(if $(POSTLINKER_SUPPORTS_WDP), \
  49. --codepaging=$(PAGEDCODE_OPTION) --datapaging=$(PAGEDDATA_OPTION), \
  50. $(POSTLINKER_PAGEDOPTION)) \
  51. $(if $(NOCOMPRESSTARGET),--uncompressed, \
  52. $(if $(INFLATECOMPRESSTARGET),--compressionmethod=inflate, \
  53. $(if $(BYTEPAIRCOMPRESSTARGET),--compressionmethod=bytepair, \
  54. --compressionmethod=$(POSTLINKER_COMPRESSION_DEFAULT)))) \
  55. --libpath="$(call concat,$(PATHSEP)$(CHAR_SEMIC),$(strip $(RUNTIME_LIBS_PATH) $(STATIC_LIBS_PATH)))"
  56. endef
  57. define e32postlink_x86
  58. $(POSTLINKER) \
  59. -sid 0x$(if $(SID),$(SID),$(if $(UID3),$(UID3),0)) \
  60. -version $(VERSION) \
  61. -capability $(FINAL_CAPABILITIES) \
  62. $(if $(UID1),-uid1 0x$(UID1),) \
  63. $(if $(UID2),-uid2 0x$(UID2),) \
  64. $(if $(UID3),-uid3 0x$(UID3),) \
  65. $(if $(VENDORID),-vid 0x$(VENDORID),) \
  66. $(if $(EPOCALLOWDLLDATA),-allow,) \
  67. $(if $(EPOCPROCESSPRIORITY),-priority $(EPOCPROCESSPRIORITY),) \
  68. $(if $(EPOCSTACKSIZE),-stack 0x$(EPOCSTACKSIZE),) \
  69. $(if $(EPOCHEAPSIZEMIN),-heap 0x$(EPOCHEAPSIZEMIN) 0x$(EPOCHEAPSIZEMAX),) \
  70. $(if $(EPOCFIXEDPROCESS),-fixed,) \
  71. $(if $(EPOCDATALINKADDRESS),-datalinkaddress $(EPOCDATALINKADDRESS),) \
  72. $(if $(SMPSAFE),-smpsafe,) \
  73. $(if $(POSTLINKER_SUPPORTS_WDP), \
  74. -codepaging $(PAGEDCODE_OPTION) -datapaging $(PAGEDDATA_OPTION), \
  75. $(POSTLINKER_PAGEDOPTION)) \
  76. $(if $(NOCOMPRESSTARGET),-uncompressed, \
  77. $(if $(BYTEPAIRCOMPRESSTARGET),-compressionmethod bytepair, \
  78. -compressionmethod $(POSTLINKER_COMPRESSION_DEFAULT))) \
  79. $(call dblquote,$(LINK_TARGET)) \
  80. $$(call dblquote,$$@)
  81. endef
  82. # e32linkerfeedback_*
  83. #
  84. # Currently only implemented for ARM builds using RVCT
  85. #
  86. # The process here amounts to:
  87. # if a feedback file doesn't exist, or exists but is different to the one just
  88. # generated by the linker, then:
  89. # (a) copy the one just generated by the linker to a known location so it can
  90. # be used in the compile stage of later builds and
  91. # (b) explicitly sleep and then update the copied file's time-stamp in order to
  92. # guarantee it is later than existing object files from which the linked
  93. # binary was built (thus ensuring dependency based re-compilation in later
  94. # builds where file system time-stamp granularity is otherwise insufficient).
  95. #
  96. # Note: as linker feedback files contain time-stamps, these are ignored in the diff.
  97. #
  98. define e32linkerfeedback_arm
  99. if [ ! -e $(FEEDBACKFILENAME) ] || [ -n "`$(GNUDIFF) --ignore-matching-lines='.*Last Updated:.*' --brief $(FEEDBACKFILENAME) $(FEEDBACKFILENAME)_temp`" ]; then \
  100. $(GNUCP) $(FEEDBACKFILENAME)_temp $(FEEDBACKFILENAME); \
  101. sleep 1; \
  102. $(GNUTOUCH) $(FEEDBACKFILENAME); \
  103. fi;
  104. endef