From 39785177e2261b509baf292530fe5739b2a5dc3e Mon Sep 17 00:00:00 2001 From: Pentarctagon Date: Sun, 10 Jun 2018 20:23:27 -0500 Subject: [PATCH] Fix stack protection with LTO. (cherry-picked from commit 5a2d1bc992a4527eeee60f8624880a34d84be57c) --- SConstruct | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SConstruct b/SConstruct index 484581104da..b470e2dadb3 100755 --- a/SConstruct +++ b/SConstruct @@ -504,6 +504,9 @@ for env in [test_env, client_env, env]: env.AppendUnique(LINKFLAGS = ["-fPIE", "-pie", "-Wl,-z,now,-z,relro"]) env.AppendUnique(CPPDEFINES = ["_FORTIFY_SOURCE=2"]) + if env["enable_lto"] == True: + env.AppendUnique(LINKFLAGS = ["-fstack-protector-strong"]) + # # # Start determining options for debug build # #