[vlc-devel] [PATCH] configure: only add -pie to LDFLAGS
Rémi Denis-Courmont
remi at remlab.net
Wed Mar 11 09:09:10 CET 2020
Le keskiviikkona 11. maaliskuuta 2020, 2.00.09 EET Marvin Scholz a écrit :
> The -pie flag is a linker flag, adding it to compiler flags causes
> a Clang warning
>
> warning: argument unused during compilation: '-pie'
>
> for every compiled object.
I don't really see the point in setting PIE in configure. If the target wants
PIE (as Android and most Linux distros do), the overlying build system should
already set the flags or compiler defaults anyway.
The correct way to pass it would be -Wl,-pie, but AFAIK, it's totally
redundant if you set -fPIE anyway.
> ---
> configure.ac | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index bc1874cb97..182a774d1f 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1098,12 +1098,14 @@ AS_VAR_IF(with_sanitizer, no, [], [
> AX_APPEND_COMPILE_FLAGS([-fsanitize-address-use-after-scope
> -fno-omit-frame-pointer -fsanitize=pointer-compare
> -fsanitize=pointer-subtract], [CXXFLAGS]) ])
> AS_IF([test -z "${with_sanitizer##*memory*}" ], [
> - AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
> - AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
> + AX_APPEND_COMPILE_FLAGS([-fPIE])
> + AX_APPEND_COMPILE_FLAGS([-fPIE], [CXXFLAGS])
> + AX_APPEND_FLAG([-pie], [LDFLAGS])
> ])
> AS_IF([test -z "${with_sanitizer##*thread*}" ], [
> - AX_APPEND_COMPILE_FLAGS([-fPIE -pie])
> - AX_APPEND_COMPILE_FLAGS([-fPIE -pie], [CXXFLAGS])
> + AX_APPEND_COMPILE_FLAGS([-fPIE])
> + AX_APPEND_COMPILE_FLAGS([-fPIE], [CXXFLAGS])
> + AX_APPEND_FLAG([-pie], [LDFLAGS])
> ])
> ])
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list