svn commit: r340650 - head/share/mk
Ed Maste
emaste at FreeBSD.org
Mon Nov 19 20:48:48 UTC 2018
Author: emaste
Date: Mon Nov 19 20:48:47 2018
New Revision: 340650
URL: https://svnweb.freebsd.org/changeset/base/340650
Log:
Avoid retpolineplt with static linking
Statically linked binaries linked with -zretpolineplt crash at startup
as lld produces a broken PLT.
PR: 233336
Sponsored by: The FreeBSD Foundation
Modified:
head/share/mk/bsd.prog.mk
Modified: head/share/mk/bsd.prog.mk
==============================================================================
--- head/share/mk/bsd.prog.mk Mon Nov 19 20:45:49 2018 (r340649)
+++ head/share/mk/bsd.prog.mk Mon Nov 19 20:48:47 2018 (r340650)
@@ -41,7 +41,10 @@ LDFLAGS+= -Wl,-znow
.if ${MK_RETPOLINE} != "no"
CFLAGS+= -mretpoline
CXXFLAGS+= -mretpoline
+# retpolineplt is broken with static linking (PR 233336)
+.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO"
LDFLAGS+= -Wl,-zretpolineplt
+.endif
.endif
.if defined(CRUNCH_CFLAGS)
More information about the svn-src-all
mailing list