diff options
author | Michael Biebl <biebl@debian.org> | 2019-01-10 12:58:27 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-01-10 16:00:10 +0100 |
commit | 4e4bbc439eb7f16a608f457d3eaac08c60633212 (patch) | |
tree | 28077bf052a37c5b8cf8af46a5f263f8b2576375 /meson.build | |
parent | c0f34168d4c5691fccb62e81d6d49dd2f730a17b (diff) | |
download | systemd-4e4bbc439eb7f16a608f457d3eaac08c60633212.tar.gz |
meson: stop setting -fPIE globally
Setting -fPIE globally can lead to miscompilations on certain
architectures.
This is caused by both -fPIE and -fPIC options being added to various
compilation commands. Only -fPIC is being recorded in the LTO options
section of the object. The gcc-8 LTO plugin merges -fPIC + -fPIE to
nothing. So, the compilations done by the plugin are not
position-independent and fail to link with -pie.
The simplest solution is to stop setting -fPIE globally and instead
using meson's b_pie=true option. This requires meson 0.49 or later.
Since we don't set this option in meson.build but leave it up to the
distro maintainer to set this option, do not bump the meson version
requirement.
Fixes: #10548
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/meson.build b/meson.build index c23d2b821f..623c1ad6b3 100644 --- a/meson.build +++ b/meson.build @@ -359,13 +359,6 @@ possible_link_flags = [ '-Wl,-z,now', ] -# the oss-fuzz fuzzers are not built with -fPIE, so don't -# enable it when we are linking against them -if not fuzzer_build - possible_cc_flags += '-fPIE' - possible_link_flags += '-pie' -endif - if cc.get_id() == 'clang' possible_cc_flags += [ '-Wno-typedef-redefinition', |