summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-03-03 16:58:46 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2017-03-03 16:58:46 +0000
commitf19f943a6699d771ef85402998a56743d6dfa3d9 (patch)
treea0f69fe57b4d185531f2b883b8f7123ec7b2ad0e /src
parent7d58fd3d47d2d69f2b1b9f08325302e4eeff9ebe (diff)
downloadlibepoxy-f19f943a6699d771ef85402998a56743d6dfa3d9.tar.gz
Add z,relro and z,now to the GCC linker flags
These flags are mitigations against memory corruption bugs, and are typically enabled by Linux distributions hardening rules. We only use these flags with GCC, similarly to `-Bsymbolic`. More information on relro is available here: - http://tk-blog.blogspot.co.uk/2009/02/relro-not-so-well-known-memory.html - http://mudongliang.github.io/2016/07/11/relro-a-not-so-well-known-memory-corruption-mitigation-technique.html - https://wiki.debian.org/Hardening#DEB_BUILD_HARDENING_RELRO_.28ld_-z_relro.29
Diffstat (limited to 'src')
-rw-r--r--src/meson.build2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/meson.build b/src/meson.build
index 3610af3..ecd032a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -52,7 +52,7 @@ foreach h: headers
endforeach
if cc.get_id() == 'gcc'
- common_ldflags = [ '-Wl,-Bsymbolic', ]
+ common_ldflags = [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
else
common_ldflags = []
endif