Changeset View
Changeset View
Standalone View
Standalone View
head/share/mk/bsd.linker.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# Setup variables for the linker. | # Setup variables for the linker. | ||||
# | # | ||||
# LINKER_TYPE is the major type of linker. Currently binutils and lld support | # LINKER_TYPE is the major type of linker. Currently binutils and lld support | ||||
# automatic detection. | # automatic detection. | ||||
# | # | ||||
# LINKER_VERSION is a numeric constant equal to: | # LINKER_VERSION is a numeric constant equal to: | ||||
# major * 10000 + minor * 100 + tiny | # major * 10000 + minor * 100 + tiny | ||||
# It too can be overridden on the command line. | # It too can be overridden on the command line. | ||||
# | # | ||||
# LINKER_FEATURES may contain one or more of the following, based on | # LINKER_FEATURES may contain one or more of the following, based on | ||||
# linker support for that feature: | # linker support for that feature: | ||||
# | # | ||||
# - build-id : support for generating a Build-ID note | # - build-id: support for generating a Build-ID note | ||||
# - retpoline: support for generating PLT with retpoline speculative | |||||
# execution vulnerability mitigation | |||||
# | # | ||||
# These variables with an X_ prefix will also be provided if XLD is set. | # These variables with an X_ prefix will also be provided if XLD is set. | ||||
# | # | ||||
# This file may be included multiple times, but only has effect the first time. | # This file may be included multiple times, but only has effect the first time. | ||||
# | # | ||||
.if !target(__<bsd.linker.mk>__) | .if !target(__<bsd.linker.mk>__) | ||||
__<bsd.linker.mk>__: | __<bsd.linker.mk>__: | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
.undef _ld_version | .undef _ld_version | ||||
.undef _v | .undef _v | ||||
${X_}LINKER_FEATURES= | ${X_}LINKER_FEATURES= | ||||
.if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750 | .if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750 | ||||
${X_}LINKER_FEATURES+= build-id | ${X_}LINKER_FEATURES+= build-id | ||||
.endif | .endif | ||||
.if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 | .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 | ||||
${X_}LINKER_FEATURES+= filter | ${X_}LINKER_FEATURES+= filter | ||||
.endif | |||||
.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 | |||||
${X_}LINKER_FEATURES+= retpoline | |||||
.endif | .endif | ||||
.endif | .endif | ||||
.else | .else | ||||
# Use LD's values | # Use LD's values | ||||
X_LINKER_TYPE= ${LINKER_TYPE} | X_LINKER_TYPE= ${LINKER_TYPE} | ||||
X_LINKER_VERSION= ${LINKER_VERSION} | X_LINKER_VERSION= ${LINKER_VERSION} | ||||
X_LINKER_FEATURES= ${LINKER_FEATURES} | X_LINKER_FEATURES= ${LINKER_FEATURES} | ||||
.endif # ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) | .endif # ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) | ||||
Show All 14 Lines |