make-rules/shared-macros.mk
changeset 1138 6e1f85fa0151
parent 1124 08534bc6778b
child 1152 96d423311191
equal deleted inserted replaced
1137:5f35de46aa92 1138:6e1f85fa0151
   599 LD_Z_IGNORE =		-z ignore
   599 LD_Z_IGNORE =		-z ignore
   600 
   600 
   601 # use direct binding
   601 # use direct binding
   602 LD_B_DIRECT =		-Bdirect
   602 LD_B_DIRECT =		-Bdirect
   603 
   603 
       
   604 # use generic macro names for enabling/disabling ASLR
       
   605 ASLR_ENABLE = 		-z aslr=enable
       
   606 ASLR_DISABLE = 		-z aslr=disable
       
   607 ASLR_MODE = 		$(ASLR_DISABLE)
       
   608 
       
   609 # by default, turn off Address Space Layout Randomization for ELF executables;
       
   610 # to explicitly enable ASLR, set ASLR_MODE = $(ASLR_ENABLE)
       
   611 # in that component's Makefile
       
   612 LD_Z_ASLR =		$(ASLR_MODE)
       
   613 
   604 #
   614 #
   605 # More Solaris linker flags that we want to be sure that everyone gets.  This
   615 # More Solaris linker flags that we want to be sure that everyone gets.  This
   606 # is automatically added to the calling environment during the 'build' and
   616 # is automatically added to the calling environment during the 'build' and
   607 # 'install' phases of the component build.  Each individual feature can be
   617 # 'install' phases of the component build.  Each individual feature can be
   608 # turned off by adding FEATURE_MACRO= to the component Makefile.
   618 # turned off by adding FEATURE_MACRO= to the component Makefile.
   631 # libraries to this macro, as it will apply to everything linked during the
   641 # libraries to this macro, as it will apply to everything linked during the
   632 # component build.
   642 # component build.
   633 LD_OPTIONS +=	$(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
   643 LD_OPTIONS +=	$(LD_MAP_NOEXSTK.$(MACH)) $(LD_MAP_NOEXDATA.$(MACH)) \
   634 		$(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
   644 		$(LD_MAP_PAGEALIGN) $(LD_B_DIRECT) $(LD_Z_IGNORE)
   635 
   645 
       
   646 # only used on executables
       
   647 LD_EXEC_OPTIONS = $(LD_Z_ASLR)
       
   648 
   636 # Environment variables and arguments passed into the build and install
   649 # Environment variables and arguments passed into the build and install
   637 # environment(s).  These are the initial settings.
   650 # environment(s).  These are the initial settings.
   638 COMPONENT_BUILD_ENV= \
   651 COMPONENT_BUILD_ENV= \
   639     LD_OPTIONS="$(LD_OPTIONS)"
   652     LD_OPTIONS="$(LD_OPTIONS)" \
       
   653     LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)"
   640 COMPONENT_INSTALL_ENV= \
   654 COMPONENT_INSTALL_ENV= \
   641     LD_OPTIONS="$(LD_OPTIONS)"
   655     LD_OPTIONS="$(LD_OPTIONS)" \
       
   656     LD_EXEC_OPTIONS="$(LD_EXEC_OPTIONS)"
   642 
   657 
   643 # Add any bit-specific settings
   658 # Add any bit-specific settings
   644 COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
   659 COMPONENT_BUILD_ENV += $(COMPONENT_BUILD_ENV.$(BITS))
   645 COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
   660 COMPONENT_BUILD_ARGS += $(COMPONENT_BUILD_ARGS.$(BITS))
   646 COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))
   661 COMPONENT_INSTALL_ENV += $(COMPONENT_INSTALL_ENV.$(BITS))