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
This commit is contained in:
Ed Maste 2018-11-19 20:48:47 +00:00
parent fd91f85934
commit 1460870880

View File

@ -41,8 +41,11 @@ 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)
CFLAGS+=${CRUNCH_CFLAGS}