Error out on attempt to link amd64 kernel with old binutils linker
As of r333461 we require ifunc support to link a working amd64 kernel. The default in-tree bootstrap linker is lld and it has the required support, as does any modern out-of-tree binutils linker. The in-tree GNU ld is from binutils 2.17.50 and it does not have ifunc support, so produce an error rather than a broken kernel. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15378
This commit is contained in:
parent
7bf272a612
commit
ff8f1e8332
@ -71,6 +71,7 @@ ${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \
|
||||
${X_}LINKER_FEATURES=
|
||||
.if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750
|
||||
${X_}LINKER_FEATURES+= build-id
|
||||
${X_}LINKER_FEATURES+= ifunc
|
||||
.endif
|
||||
.if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000
|
||||
${X_}LINKER_FEATURES+= filter
|
||||
|
@ -121,6 +121,9 @@ LDFLAGS+= -Wl,--build-id=sha1
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "amd64"
|
||||
.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == ""
|
||||
.error amd64 kernel requires linker ifunc support
|
||||
.endif
|
||||
LDFLAGS+= -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096
|
||||
.endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user