[PATCH][configure] Make sure CFLAGS_FOR_TARGET And CXXFLAGS_FOR_TARGET contain -O2
Christophe Lyon
christophe.lyon@st.com
Mon Jun 25 15:45:00 GMT 2012
Ping?
This patch was tested successfully on cross GCC x86 -> arm-none-eabi, to make sure that target libs are built with "-O2 -g" as stated in a comment in configure.
It fixes what looks like a cut & paste error.
Without this patch, overriding CFLAGS not including -O2 leads to CFLAGS_FOR_TARGET lacking -O2, which results in target libs such as libstdc++ being compiled without -O2.
OK?
Christophe.
On 16.04.2012 14:51, Christophe Lyon wrote:
> Ping?
>
> On 29.03.2012 13:48, Christophe Lyon wrote:
>> Hello,
>>
>> According to a comment in configure/configure.ac:
>> # We want to ensure that TARGET libraries (which we know are built with
>> # gcc) are built with "-O2 -g", so include those options when setting
>> # CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
>>
>> but the current code does not ensure this.
>>
>> I propose the patch below to fix this.
>>
>> 2012-03-29 Christophe Lyon<christophe.lyon@st.com>
>>
>> * configure.ac (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Make sure
>> they contain -O2.
>> * configure: Regenerate.
>>
>> Index: configure.ac
>> ===================================================================
>> --- configure.ac (revision 2515)
>> +++ configure.ac (working copy)
>> @@ -2223,7 +2223,7 @@ if test "x$CFLAGS_FOR_TARGET" = x; then
>> esac
>> case " $CFLAGS " in
>> *" -g "* | *" -g3 "*) ;;
>> - *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
>> + *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
>> esac
>> fi
>> AC_SUBST(CFLAGS_FOR_TARGET)
>> @@ -2236,7 +2236,7 @@ if test "x$CXXFLAGS_FOR_TARGET" = x; the
>> esac
>> case " $CXXFLAGS " in
>> *" -g "* | *" -g3 "*) ;;
>> - *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
>> + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
>> esac
>> fi
>> AC_SUBST(CXXFLAGS_FOR_TARGET)
>> Index: configure
>> ===================================================================
>> --- configure (revision 2515)
>> +++ configure (working copy)
>> @@ -6739,7 +6739,7 @@ if test "x$CFLAGS_FOR_TARGET" = x; then
>> esac
>> case " $CFLAGS " in
>> *" -g "* | *" -g3 "*) ;;
>> - *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
>> + *) CFLAGS_FOR_TARGET="-g $CFLAGS_FOR_TARGET" ;;
>> esac
>> fi
>>
>> @@ -6752,7 +6751,7 @@ if test "x$CXXFLAGS_FOR_TARGET" = x; the
>> esac
>> case " $CXXFLAGS " in
>> *" -g "* | *" -g3 "*) ;;
>> - *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
>> + *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS_FOR_TARGET" ;;
>> esac
>> fi
>>
>>
>> .
>>
> .
>
More information about the Gcc-patches
mailing list