Changeset View
Changeset View
Standalone View
Standalone View
share/mk/bsd.linker.mk
Show All 9 Lines | |||||
# 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 | # - retpoline: support for generating PLT with retpoline speculative | ||||
# execution vulnerability mitigation | # execution vulnerability mitigation | ||||
# - gdb-index: support for generating .gdb_index sections | |||||
emaste: Do we have / need to support linkers that don't support this? IMO it's not worth adding support… | |||||
jhbAuthorUnsubmitted Done Inline ActionsI don't know that bfd supports it (it's not listed in --help for current bfd). I also am not sure if gdb_index will go away eventually as I think DWARF 5 might be defining its own version of the same thing? jhb: I don't know that bfd supports it (it's not listed in --help for current bfd). I also am not… | |||||
# | # | ||||
# LINKER_FREEBSD_VERSION is the linker's internal source version. | # LINKER_FREEBSD_VERSION is the linker's internal source version. | ||||
# | # | ||||
# 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. | ||||
# | # | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
${X_}LINKER_FEATURES+= build-id | ${X_}LINKER_FEATURES+= build-id | ||||
${X_}LINKER_FEATURES+= ifunc | ${X_}LINKER_FEATURES+= ifunc | ||||
.endif | .endif | ||||
.if ${${X_}LINKER_TYPE} == "bfd" && ${${X_}LINKER_VERSION} > 21750 | .if ${${X_}LINKER_TYPE} == "bfd" && ${${X_}LINKER_VERSION} > 21750 | ||||
${X_}LINKER_FEATURES+= riscv-relaxations | ${X_}LINKER_FEATURES+= riscv-relaxations | ||||
.endif | .endif | ||||
.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 | .if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 | ||||
${X_}LINKER_FEATURES+= retpoline | ${X_}LINKER_FEATURES+= retpoline | ||||
.endif | |||||
.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 80000 | |||||
${X_}LINKER_FEATURES+= gdb-index | |||||
.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} | ||||
X_LINKER_FREEBSD_VERSION= ${LINKER_FREEBSD_VERSION} | X_LINKER_FREEBSD_VERSION= ${LINKER_FREEBSD_VERSION} | ||||
Show All 15 Lines |
Do we have / need to support linkers that don't support this? IMO it's not worth adding support for e.g. lld versions that are not relevant to contemporary FreeBSD.