Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
On Sat, May 30, 2015 at 8:10 AM, Andreas Schwab <[email protected]> wrote:
> "H.J. Lu" <[email protected]> writes:
>> +# Check if -fno-PIE works.
>> +AC_CACHE_CHECK([for -fno-PIE option],
>> + [gcc_cv_c_no_fpie],
>> + [saved_CFLAGS="$CFLAGS"
>> + CFLAGS="$CFLAGS -fno-PIE"
>> + AC_COMPILE_IFELSE([int main(void) {return 0;}],
>> + [gcc_cv_c_no_fpie=yes],
>> + [gcc_cv_c_no_fpie=no])
>> + CFLAGS="$saved_CFLAGS"])
>> +if test "$gcc_cv_c_no_fpie" = "yes"; then
>> + NO_PIE_CFLAGS="-fno-PIE"
>> +AC_SUBST([NO_PIE_CFLAGS])
> That doesn't work:
> configure:28726: checking for -fno-PIE option
> configure:28737: g++ -c -g conftest.cpp >&5
> configure:28737: $? = 0
> configure:28745: result: yes
>> +# Check if -no-pie works.
>> +AC_CACHE_CHECK([for -no-pie option],
>> + [gcc_cv_no_pie],
>> + [saved_LDFLAGS="$LDFLAGS"
>> + LDFLAGS="$LDFLAGS -no-pie"
>> + AC_LINK_IFELSE([int main(void) {return 0;}],
>> + [gcc_cv_no_pie=yes],
>> + [gcc_cv_no_pie=no])
>> + LDFLAGS="$saved_LDFLAGS"])
>> +if test "$gcc_cv_no_pie" = "yes"; then
>> + NO_PIE_FLAG="-no-pie"
>> +AC_SUBST([NO_PIE_FLAG])
> That doesn't work with gcc 4.3:
> configure:28753: checking for -no-pie option
> configure:28764: g++ -std=c++98 -o conftest -g -no-pie conftest.cpp >&5
> g++: unrecognized option '-no-pie'
> configure:28764: $? = 0
> configure:28773: result: yes
Starting GCC 4.6, the unrecognized option became an error.
Before 4.6, it was ignored. Does it cause any problems for
bootstrap?
Previous message (by thread): Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option
Next message (by thread): Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option
Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]