[poky] [PATCH 3/3] u-boot: compile with -O2 on PowerPC

Adrian Alonso aalonso at secretlab.ca
Wed Feb 9 10:05:11 PST 2011


I observe that with current gcc for powerpc uboot only builds with
OPTFLAGS=-O2, unsetting or using other OPT level the build fails
with undefined symbols.

I override the OPTFLAGS in the dedicated recipe for uboot under meta-xilinx
BSP
but for powerpc targets in main meta layer Ilya approach does the work.

On Wed, Feb 9, 2011 at 11:42 AM, Darren Hart <dvhart at linux.intel.com> wrote:

> On 02/08/2011 12:26 PM, Ilya Yanok wrote:
>
>> gcc on PowerPC is currently compiled with -Os optimization disabled so
>> we have to use -O2 on PowerPC instead.
>>
>> Signed-off-by: Ilya Yanok<yanok at emcraft.com>
>> ---
>>  meta/recipes-bsp/uboot/u-boot.inc |    7 ++++++-
>>  1 files changed, 6 insertions(+), 1 deletions(-)
>>
>> diff --git a/meta/recipes-bsp/uboot/u-boot.inc
>> b/meta/recipes-bsp/uboot/u-boot.inc
>> index 6492016..7694c77 100644
>> --- a/meta/recipes-bsp/uboot/u-boot.inc
>> +++ b/meta/recipes-bsp/uboot/u-boot.inc
>> @@ -22,7 +22,12 @@ do_compile () {
>>        unset CFLAGS
>>        unset CPPFLAGS
>>        oe_runmake ${UBOOT_MACHINE}
>> -       oe_runmake all
>> +       # -Os is disabled on PowerPC
>> +       if [ ${TARGET_ARCH} == "powerpc" ] ; then
>> +               oe_runmake OPTFLAGS=-O2 all
>> +       else
>> +               oe_runmake all
>> +       fi
>>
>
>
> This is already disabled in u-boot.inc with the following line:
>
> # GCC 4.5.1 builds unusable binaries using -Os, remove it from OPTFLAGS
> EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS=''"
>
> Resetting OPTFLAGS to '' removes the -Os from the variable in the Makefile.
> This isn't just a PowerPC problem, it also manifested on ARM, I believe it
> is a GCC 4.5.1 issue.
>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Linux Kernel
>
> _______________________________________________
> poky mailing list
> poky at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/poky
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/poky/attachments/20110209/3297c0b1/attachment.html>


More information about the poky mailing list