[poky] [PATCH 05/25] u-boot: disable -Os option not supported by gcc
Darren Hart
dvhart at linux.intel.com
Thu Jan 20 10:53:20 PST 2011
On 01/17/2011 12:29 PM, Adrian Alonso wrote:
> * Disable -Os optspace option not supported by gcc use insted
> -O2
> * Bump PR
>
I ran into this in the recent u-boot_git.bb recipe I added. Rather than
create a patch to the Makefile, I found it simpler to adding OPTFLAGS to
the EXTRA_OEMAKE variable in the recipe:
EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} OPTFLAGS=''"
This negates the -Os in the Makefile.
--
Darren
> Signed-off-by: Adrian Alonso<aalonso at secretlab.ca>
> ---
> .../uboot/files/uboot-do-not-use-Os-option.patch | 30 ++++++++++++++++++++
> recipes-bsp/uboot/u-boot-xilinx_git.bb | 8 ++++-
> 2 files changed, 36 insertions(+), 2 deletions(-)
> create mode 100644 recipes-bsp/uboot/files/uboot-do-not-use-Os-option.patch
>
> diff --git a/recipes-bsp/uboot/files/uboot-do-not-use-Os-option.patch b/recipes-bsp/uboot/files/uboot-do-not-use-Os-option.patch
> new file mode 100644
> index 0000000..c4153e4
> --- /dev/null
> +++ b/recipes-bsp/uboot/files/uboot-do-not-use-Os-option.patch
> @@ -0,0 +1,30 @@
> +From 8a4e1e92becc3994907f18919e9ee8b51b0f377a Mon Sep 17 00:00:00 2001
> +From: Adrian Alonso<aalonso at secretlab.ca>
> +Date: Mon, 6 Dec 2010 22:59:20 -0600
> +Subject: [PATCH 1/2] uboot: do not use Os option
> +
> +* Fix error: Do not use -Os option if --enable-target-optspace
> + is not set.
> +* Gcc optospace options is disabled for powerpc machines
> +* Use -O2 optimization level instead
> +
> +Signed-off-by: Adrian Alonso<aalonso at secretlab.ca>
> +---
> + config.mk | 2 +-
> + 1 files changed, 1 insertions(+), 1 deletions(-)
> +
> +diff --git a/config.mk b/config.mk
> +index a63e9cd..ba629d1 100644
> +--- a/config.mk
> ++++ b/config.mk
> +@@ -138,7 +138,7 @@ ARFLAGS = crv
> + endif
> + RELFLAGS= $(PLATFORM_RELFLAGS)
> + DBGFLAGS= -g # -DDEBUG
> +-OPTFLAGS= -Os #-fomit-frame-pointer
> ++OPTFLAGS= -O2 #-fomit-frame-pointer
> + ifndef LDSCRIPT
> + #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
> + ifeq ($(CONFIG_NAND_U_BOOT),y)
> +--
> +1.7.2.3
> diff --git a/recipes-bsp/uboot/u-boot-xilinx_git.bb b/recipes-bsp/uboot/u-boot-xilinx_git.bb
> index 50d99e3..3b35ae5 100644
> --- a/recipes-bsp/uboot/u-boot-xilinx_git.bb
> +++ b/recipes-bsp/uboot/u-boot-xilinx_git.bb
> @@ -1,9 +1,13 @@
> require ../meta/recipes-bsp/uboot/u-boot.inc
> -PR = "r2"
> +PR = "r3"
> +THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}"
> +FILESPATH =. "${@base_set_filespath(["${THISDIR}/files"], d)}:"
>
> BRANCH="master"
> TAG="e094f2479ea339d7f48b6826f06f0be4984d9a98"
> -SRC_URI = "git://git.xilinx.com/u-boot-xlnx.git;branch=${BRANCH};protocol=git"
> +SRC_URI = "git://git.xilinx.com/u-boot-xlnx.git;branch=${BRANCH};protocol=git \
> + file://uboot-do-not-use-Os-option.patch \
> + "
> SRCREV = "${TAG}"
>
> inherit xilinx-boot
--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
More information about the poky
mailing list