RFR: JDK-8081692 Configure should verify that -fstack-protector is valid
Tim Bell
tim.bell at oracle.com
Wed Jun 3 14:30:27 UTC 2015
Magnus:
Looks good to me as well.
Tim
On 06/03/15 06:12, Erik Joelsson wrote:
> Looks good to me.
>
> /Erik
>
> On 2015-06-03 14:33, Magnus Ihse Bursie wrote:
>> Not all versions of gcc support -fstack-protector. We should check
>> that it is accepted as an argument before adding it to the flags.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8081692
>> WebRev inline:
>>
>> diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
>> --- a/common/autoconf/flags.m4
>> +++ b/common/autoconf/flags.m4
>> @@ -338,14 +338,16 @@
>> # no adjustment
>> ;;
>> slowdebug )
>> - # Add runtime stack smashing and undefined behavior checks
>> - CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param
>> ssp-buffer-size=1"
>> - CXXFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param
>> ssp-buffer-size=1"
>> + # Add runtime stack smashing and undefined behavior checks.
>> + # Not all versions of gcc support -fstack-protector
>> + STACK_PROTECTOR_CFLAG="-fstack-protector-all"
>> + FLAGS_COMPILER_CHECK_ARGUMENTS([$STACK_PROTECTOR_CFLAG], [],
>> [STACK_PROTECTOR_CFLAG=""])
>> +
>> + CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param
>> ssp-buffer-size=1"
>> + CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param
>> ssp-buffer-size=1"
>> ;;
>> esac
>> fi
>> - AC_SUBST(CFLAGS_DEBUG_OPTIONS)
>> - AC_SUBST(CXXFLAGS_DEBUG_OPTIONS)
>>
>> # Optimization levels
>> if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
>>
>> The AC_SUBST removal is just a bit of cleanup, we didn't use the
>> *_DEBUG_OPTIONS in the spec files, just later on when constructing
>> JDK_CFLAGS.
>>
>> /Magnus
>>
>
More information about the build-dev
mailing list