[vlc-devel] [PATCH] configure: only add -pie to LDFLAGS

Marvin Scholz epirat07 at gmail.com
Wed Mar 11 13:36:37 CET 2020


As it is set only for thread and memory sanitizer enabled builds I 
assumed
this was necessary on some OSes. If not, I would be in favor of removing 
it
too…

On 11 Mar 2020, at 9:09, Rémi Denis-Courmont wrote:

> 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/
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list