meson: stop setting -fPIE globally
authorMichael Biebl <biebl@debian.org>
Thu, 10 Jan 2019 11:58:27 +0000 (12:58 +0100)
committerMartin Pitt <mpitt@debian.org>
Mon, 18 Feb 2019 13:54:04 +0000 (13:54 +0000)
commitf1a45f69a14abee33ea16d6ee2fd9dfdd003a880
treec77a70e9cdbdb2092b59932757f1eb1afd036993
parent1d7f2d9511b413c9dacd920ca5d6b64720fe9c46
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
(cherry picked from commit 4e4bbc439eb7f16a608f457d3eaac08c60633212)

Gbp-Pq: Name meson-stop-setting-fPIE-globally.patch
meson.build