Index: share/mk/bsd.linker.mk =================================================================== --- share/mk/bsd.linker.mk +++ share/mk/bsd.linker.mk @@ -75,6 +75,7 @@ ${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 Index: sys/conf/kern.pre.mk =================================================================== --- sys/conf/kern.pre.mk +++ sys/conf/kern.pre.mk @@ -121,6 +121,9 @@ .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