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)
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to