diff mbox series

[oe,meta-initramfs,1/5] klibc: Pass Optimization with KLIBCOPTFLAGS

Message ID 20171002160657.39576-1-raj.khem@gmail.com
State Accepted
Commit c296fb707ae3252b4bf2ffa3bf647a9249f126c4
Headers show
Series [oe,meta-initramfs,1/5] klibc: Pass Optimization with KLIBCOPTFLAGS | expand

Commit Message

Khem Raj Oct. 2, 2017, 4:06 p.m. UTC
Overriding KLIBCOPTFLAGS also meant that -Ox flags
were taken off. Which results in errors like

| usr/dash/shell.h: In function 'max_int_length':
| usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible with floating-point code
|   return (bytes * 8 - 1) * 0.30102999566398119521 + 14;
|          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
| usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible with floating-point argument

Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...arm-Do-not-set-a-fallback-march-and-mtune.patch | 33 ++++++++++++++++++++++
 meta-initramfs/recipes-devtools/klibc/klibc.inc    |  4 ++-
 2 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

-- 
2.14.2

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Comments

Khem Raj Oct. 3, 2017, 7:28 p.m. UTC | #1
Martin

This is missing in master-next

On Mon, Oct 2, 2017 at 9:06 AM, Khem Raj <raj.khem@gmail.com> wrote:
> Overriding KLIBCOPTFLAGS also meant that -Ox flags

> were taken off. Which results in errors like

>

> | usr/dash/shell.h: In function 'max_int_length':

> | usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible with floating-point code

> |   return (bytes * 8 - 1) * 0.30102999566398119521 + 14;

> |          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

> | usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible with floating-point argument

>

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> ---

>  ...arm-Do-not-set-a-fallback-march-and-mtune.patch | 33 ++++++++++++++++++++++

>  meta-initramfs/recipes-devtools/klibc/klibc.inc    |  4 ++-

>  2 files changed, 36 insertions(+), 1 deletion(-)

>  create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

>

> diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

> new file mode 100644

> index 000000000..9c0ea6397

> --- /dev/null

> +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

> @@ -0,0 +1,33 @@

> +From a46a144ac883898d9cedf7a0b13aec6d10116125 Mon Sep 17 00:00:00 2001

> +From: Khem Raj <raj.khem@gmail.com>

> +Date: Fri, 29 Sep 2017 23:11:53 -0700

> +Subject: [PATCH] arm: Do not set a fallback march and mtune

> +

> +In OE we pass the options explicitly, there is

> +no need to set it inside the makefiles, we will

> +need to compute values for CPU_ARCH and CPU_TUNE

> +which is a bit harder in OE

> +

> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

> +---

> +Upstream-Status: Pending

> +

> + usr/klibc/arch/arm/MCONFIG | 2 +-

> + 1 file changed, 1 insertion(+), 1 deletion(-)

> +

> +diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG

> +index 53bc1dc3..857e2f2d 100644

> +--- a/usr/klibc/arch/arm/MCONFIG

> ++++ b/usr/klibc/arch/arm/MCONFIG

> +@@ -10,7 +10,7 @@

> + CPU_ARCH ?= armv4

> + CPU_TUNE ?= strongarm

> +

> +-KLIBCOPTFLAGS += -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)

> ++KLIBCOPTFLAGS += -Os

> + KLIBCBITSIZE  = 32

> + KLIBCREQFLAGS += -fno-exceptions

> + KLIBCSTRIPFLAGS += -R .ARM.exidx

> +--

> +2.14.2

> +

> diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc

> index dec3d3704..30294b19a 100644

> --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc

> +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc

> @@ -19,6 +19,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \

>             file://0001-always-use-bfd-linker.patch \

>             file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \

>             file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \

> +           file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \

>  "

>

>  ARMPATCHES ?= ""

> @@ -40,7 +41,8 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \

>                  'INSTALLDIR=${libdir}/klibc' \

>                  'SHLIBDIR=${libdir}' \

>                  '${KLIBCTHUMB}' \

> -                'KLIBCOPTFLAGS=${TUNE_CCARGS}' \

> +                'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \

> +                 V=1 \

>                  "

>

>  export FIX_ARMV4_EABI_BX = "${FIX_V4BX}"

> --

> 2.14.2

>

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Martin Jansa Oct. 3, 2017, 7:33 p.m. UTC | #2
Thanks, I've moved it back to New state in patchwork, hopefully tomorrow I
won't forget to pick it.

On Tue, Oct 3, 2017 at 9:28 PM, Khem Raj <raj.khem@gmail.com> wrote:

> Martin

>

> This is missing in master-next

>

> On Mon, Oct 2, 2017 at 9:06 AM, Khem Raj <raj.khem@gmail.com> wrote:

> > Overriding KLIBCOPTFLAGS also meant that -Ox flags

> > were taken off. Which results in errors like

> >

> > | usr/dash/shell.h: In function 'max_int_length':

> > | usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible

> with floating-point code

> > |   return (bytes * 8 - 1) * 0.30102999566398119521 + 14;

> > |          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

> > | usr/dash/shell.h:103:25: error: '-mgeneral-regs-only' is incompatible

> with floating-point argument

> >

> > Signed-off-by: Khem Raj <raj.khem@gmail.com>

> > ---

> >  ...arm-Do-not-set-a-fallback-march-and-mtune.patch | 33

> ++++++++++++++++++++++

> >  meta-initramfs/recipes-devtools/klibc/klibc.inc    |  4 ++-

> >  2 files changed, 36 insertions(+), 1 deletion(-)

> >  create mode 100644 meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/

> 0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

> >

> > diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/

> 0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

> b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-

> fallback-march-and-mtune.patch

> > new file mode 100644

> > index 000000000..9c0ea6397

> > --- /dev/null

> > +++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/

> 0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

> > @@ -0,0 +1,33 @@

> > +From a46a144ac883898d9cedf7a0b13aec6d10116125 Mon Sep 17 00:00:00 2001

> > +From: Khem Raj <raj.khem@gmail.com>

> > +Date: Fri, 29 Sep 2017 23:11:53 -0700

> > +Subject: [PATCH] arm: Do not set a fallback march and mtune

> > +

> > +In OE we pass the options explicitly, there is

> > +no need to set it inside the makefiles, we will

> > +need to compute values for CPU_ARCH and CPU_TUNE

> > +which is a bit harder in OE

> > +

> > +Signed-off-by: Khem Raj <raj.khem@gmail.com>

> > +---

> > +Upstream-Status: Pending

> > +

> > + usr/klibc/arch/arm/MCONFIG | 2 +-

> > + 1 file changed, 1 insertion(+), 1 deletion(-)

> > +

> > +diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG

> > +index 53bc1dc3..857e2f2d 100644

> > +--- a/usr/klibc/arch/arm/MCONFIG

> > ++++ b/usr/klibc/arch/arm/MCONFIG

> > +@@ -10,7 +10,7 @@

> > + CPU_ARCH ?= armv4

> > + CPU_TUNE ?= strongarm

> > +

> > +-KLIBCOPTFLAGS += -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)

> > ++KLIBCOPTFLAGS += -Os

> > + KLIBCBITSIZE  = 32

> > + KLIBCREQFLAGS += -fno-exceptions

> > + KLIBCSTRIPFLAGS += -R .ARM.exidx

> > +--

> > +2.14.2

> > +

> > diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc

> b/meta-initramfs/recipes-devtools/klibc/klibc.inc

> > index dec3d3704..30294b19a 100644

> > --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc

> > +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc

> > @@ -19,6 +19,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/

> libs/klibc/klibc.git \

> >             file://0001-always-use-bfd-linker.patch \

> >             file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch

> \

> >             file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch

> \

> > +           file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch

> \

> >  "

> >

> >  ARMPATCHES ?= ""

> > @@ -40,7 +41,8 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \

> >                  'INSTALLDIR=${libdir}/klibc' \

> >                  'SHLIBDIR=${libdir}' \

> >                  '${KLIBCTHUMB}' \

> > -                'KLIBCOPTFLAGS=${TUNE_CCARGS}' \

> > +                'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \

> > +                 V=1 \

> >                  "

> >

> >  export FIX_ARMV4_EABI_BX = "${FIX_V4BX}"

> > --

> > 2.14.2

> >

>

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch
new file mode 100644
index 000000000..9c0ea6397
--- /dev/null
+++ b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch
@@ -0,0 +1,33 @@ 
+From a46a144ac883898d9cedf7a0b13aec6d10116125 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Sep 2017 23:11:53 -0700
+Subject: [PATCH] arm: Do not set a fallback march and mtune
+
+In OE we pass the options explicitly, there is
+no need to set it inside the makefiles, we will
+need to compute values for CPU_ARCH and CPU_TUNE
+which is a bit harder in OE
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ usr/klibc/arch/arm/MCONFIG | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG
+index 53bc1dc3..857e2f2d 100644
+--- a/usr/klibc/arch/arm/MCONFIG
++++ b/usr/klibc/arch/arm/MCONFIG
+@@ -10,7 +10,7 @@
+ CPU_ARCH ?= armv4
+ CPU_TUNE ?= strongarm
+ 
+-KLIBCOPTFLAGS += -Os -march=$(CPU_ARCH) -mtune=$(CPU_TUNE)
++KLIBCOPTFLAGS += -Os
+ KLIBCBITSIZE  = 32
+ KLIBCREQFLAGS += -fno-exceptions
+ KLIBCSTRIPFLAGS += -R .ARM.exidx
+-- 
+2.14.2
+
diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc
index dec3d3704..30294b19a 100644
--- a/meta-initramfs/recipes-devtools/klibc/klibc.inc
+++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc
@@ -19,6 +19,7 @@  SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \
            file://0001-always-use-bfd-linker.patch \
            file://0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch \
            file://0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch \
+           file://0001-arm-Do-not-set-a-fallback-march-and-mtune.patch \
 "
 
 ARMPATCHES ?= ""
@@ -40,7 +41,8 @@  EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
                 'INSTALLDIR=${libdir}/klibc' \
                 'SHLIBDIR=${libdir}' \
                 '${KLIBCTHUMB}' \
-                'KLIBCOPTFLAGS=${TUNE_CCARGS}' \
+                'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \
+                 V=1 \
                 "
 
 export FIX_ARMV4_EABI_BX = "${FIX_V4BX}"