meson: stop setting -fPIE globally

System Internals / systemd - Michael Biebl [] - 10 January 2019 15:00 EST

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 but leave it up to the distro maintainer to set this option, do not bump the meson version requirement.

Fixes: #10548

4e4bbc439 meson: stop setting -fPIE globally | 7 -------
1 file changed, 7 deletions(-)


  • Share