aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/backends.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2018-10-01 20:48:34 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2018-10-20 00:47:27 +0300
commitc453400d597116954b3bb2a9e2c3d60251dc97a2 (patch)
tree9bfe4e1ad5cf6f0fe05e6ebd4ee34c746ca40eac /mesonbuild/backend/backends.py
parent3ad99d27695c3018cf2449a2478b346a5b069c95 (diff)
downloadmeson-c453400d597116954b3bb2a9e2c3d60251dc97a2.zip
meson-c453400d597116954b3bb2a9e2c3d60251dc97a2.tar.gz
meson-c453400d597116954b3bb2a9e2c3d60251dc97a2.tar.bz2
Add 'b_pie' compiler option
On Android executables must be position independent, many distributions enable it by default too for security reasons.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r--mesonbuild/backend/backends.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 28ef670..f12b357 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -552,6 +552,8 @@ class Backend:
# Set -fPIC for static libraries by default unless explicitly disabled
if isinstance(target, build.StaticLibrary) and target.pic:
commands += compiler.get_pic_args()
+ if isinstance(target, build.Executable) and target.pie:
+ commands += compiler.get_pie_args()
# Add compile args needed to find external dependencies. Link args are
# added while generating the link command.
# NOTE: We must preserve the order in which external deps are