Date: Tue, 11 Aug 2020 16:47:00 +0000 (UTC) From: Alex Richardson <arichardson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364125 - in head: share/mk sys/conf Message-ID: <202008111647.07BGl0MO013873@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: arichardson Date: Tue Aug 11 16:47:00 2020 New Revision: 364125 URL: https://svnweb.freebsd.org/changeset/base/364125 Log: Allow linking the kernel with a linker that doesn't support -z ifunc-noplt This can happen when linking with upstream LLD < 9.0. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D25985 Modified: head/share/mk/bsd.linker.mk head/sys/conf/kern.pre.mk Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Tue Aug 11 16:46:54 2020 (r364124) +++ head/share/mk/bsd.linker.mk Tue Aug 11 16:47:00 2020 (r364125) @@ -94,6 +94,9 @@ ${X_}LINKER_FEATURES+= riscv-relaxations .if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 ${X_}LINKER_FEATURES+= retpoline .endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 90000 +${X_}LINKER_FEATURES+= ifunc-noplt +.endif .endif .else # Use LD's values Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Aug 11 16:46:54 2020 (r364124) +++ head/sys/conf/kern.pre.mk Tue Aug 11 16:47:00 2020 (r364125) @@ -166,9 +166,13 @@ LDFLAGS+= -z max-page-size=2097152 .if ${LINKER_TYPE} != "lld" LDFLAGS+= -z common-page-size=4096 .else +.if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt} +.warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized." +.else LDFLAGS+= -z notext -z ifunc-noplt .endif .endif +.endif # ${MACHINE_CPUARCH} == "amd64" .if ${MACHINE_CPUARCH} == "riscv" # Hack: Work around undefined weak symbols being out of range when linking with
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008111647.07BGl0MO013873>