Build with the "read-only relocation" hardening linker flag
authorVincent Cheng <vcheng@debian.org>
Sun, 13 Nov 2016 06:57:56 +0000 (06:57 +0000)
committerVincent Cheng <vcheng@debian.org>
Sun, 13 Nov 2016 06:57:56 +0000 (06:57 +0000)
Forwarded: http://trac.wildfiregames.com/ticket/1416
Last-Update: 2016-11-12

Pass "-Wl,-z,relro" to the linker. This fixes lintian warning
"hardening-no-relro".

Gbp-Pq: Name enable-hardening-relro.patch

build/premake/premake4.lua

index 847367983f65b6ed51b1d784e6eb727c0705be4c..44af3a50bf78f9d38391ba09ab59a5ba6059042a 100644 (file)
@@ -283,7 +283,7 @@ function project_set_build_flags()
 
                                if os.is("linux") or os.is("bsd") then
                                        buildoptions { "-fPIC" }
-                                       linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed" }
+                                       linkoptions { "-Wl,--no-undefined", "-Wl,--as-needed", "-Wl,-z,relro" }
                                end
 
                                if arch == "x86" then