All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc-utils: set the optimization to -O2
@ 2015-01-22  8:29 Yue Tao
  2015-01-22  8:35 ` Mike Looijmans
  0 siblings, 1 reply; 3+ messages in thread
From: Yue Tao @ 2015-01-22  8:29 UTC (permalink / raw)
  To: openembedded-core; +Cc: yue.tao

From: Yue Tao <yue.tao@windriver.com>

The _FORTIFY_SOURCE > 0 must be used with optimization > 0, so force
the optimization 2.

The build error (_FORTIFY_SOURCE=2 with -O0)

"warning _FORTIFY_SOURCE requires compiling with optimization (-O)"

(LOCAL REV: NOT UPSTREAM) -- Sent to oe-core on 2015-01-22

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
---
 .../mmc/mmc-utils/0001-mmc-utils-force-O2.patch    |   42 ++++++++++++++++++++
 meta/recipes-devtools/mmc/mmc-utils_git.bb         |    3 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch

diff --git a/meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch b/meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch
new file mode 100644
index 0000000..07dfa78
--- /dev/null
+++ b/meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch
@@ -0,0 +1,42 @@
+From 77d73c3ac400d44e3e59283856152916d87ab055 Mon Sep 17 00:00:00 2001
+From: wrlbuild <wrlbuild@57965124ebf1.(none)>
+Date: Thu, 22 Jan 2015 05:57:10 +0000
+Subject: [PATCH] mmc-utils: set the optimization to -O2
+
+The _FORTIFY_SOURCE > 0 must be used with optimization > 0, so force
+the optimization 2.
+
+The build error (_FORTIFY_SOURCE=2 with -O0)
+
+"warning _FORTIFY_SOURCE requires compiling with optimization (-O)"
+
+Upstream-Status: Pending
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+---
+ Makefile |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index ae846e2..120d422 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,13 +1,13 @@
+ CC ?= gcc
+ AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
+-CFLAGS ?= -g -O2
++CFLAGS_append = -g -O2
+ objects = mmc.o mmc_cmds.o
+ 
+ CHECKFLAGS = -Wall -Werror -Wuninitialized -Wundef
+ 
+ DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
+ 
+-override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS)
++override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS_append)
+ 
+ INSTALL = install
+ prefix ?= /usr/local
+-- 
+1.7.1
+
diff --git a/meta/recipes-devtools/mmc/mmc-utils_git.bb b/meta/recipes-devtools/mmc/mmc-utils_git.bb
index d88520c..771eede 100644
--- a/meta/recipes-devtools/mmc/mmc-utils_git.bb
+++ b/meta/recipes-devtools/mmc/mmc-utils_git.bb
@@ -9,7 +9,8 @@ SRCREV = "11f2ceabc4ad3f0dd568e0ce68166e4803e0615b"
 PV = "0.1"
 
 SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;protocol=git;branch=${BRANCH} \
-           file://0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch"
+           file://0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch \
+           file://0001-mmc-utils-force-O2.patch"
 
 S = "${WORKDIR}/git"
 
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc-utils: set the optimization to -O2
  2015-01-22  8:29 [PATCH] mmc-utils: set the optimization to -O2 Yue Tao
@ 2015-01-22  8:35 ` Mike Looijmans
  2015-01-22 10:45   ` Otavio Salvador
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Looijmans @ 2015-01-22  8:35 UTC (permalink / raw)
  To: openembedded-core

Wouldn't this cause build that use "-Os" (or -O3) to be forced to use "-O2" 
for this package?

Using -Os makes for serious flash space savings on the MIPS settop boxes, we 
found that the code generated with -Os isn't just smaller, but it compresses 
into a much smaller filesystem than -O2 generated files. There appears to be 
some synergy there between the compression algorithm (gzip or lzo) and the 
code as generated with that option.

On 22-01-15 09:29, Yue Tao wrote:
> From: Yue Tao <yue.tao@windriver.com>
>
> The _FORTIFY_SOURCE > 0 must be used with optimization > 0, so force
> the optimization 2.
>
> The build error (_FORTIFY_SOURCE=2 with -O0)
>
> "warning _FORTIFY_SOURCE requires compiling with optimization (-O)"
>
> (LOCAL REV: NOT UPSTREAM) -- Sent to oe-core on 2015-01-22
>
> Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
> ---
>   .../mmc/mmc-utils/0001-mmc-utils-force-O2.patch    |   42 ++++++++++++++++++++
>   meta/recipes-devtools/mmc/mmc-utils_git.bb         |    3 +-
>   2 files changed, 44 insertions(+), 1 deletion(-)
>   create mode 100644 meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch
>
> diff --git a/meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch b/meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch
> new file mode 100644
> index 0000000..07dfa78
> --- /dev/null
> +++ b/meta/recipes-devtools/mmc/mmc-utils/0001-mmc-utils-force-O2.patch
> @@ -0,0 +1,42 @@
> +From 77d73c3ac400d44e3e59283856152916d87ab055 Mon Sep 17 00:00:00 2001
> +From: wrlbuild <wrlbuild@57965124ebf1.(none)>
> +Date: Thu, 22 Jan 2015 05:57:10 +0000
> +Subject: [PATCH] mmc-utils: set the optimization to -O2
> +
> +The _FORTIFY_SOURCE > 0 must be used with optimization > 0, so force
> +the optimization 2.
> +
> +The build error (_FORTIFY_SOURCE=2 with -O0)
> +
> +"warning _FORTIFY_SOURCE requires compiling with optimization (-O)"
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Yue Tao <yue.tao@windriver.com>
> +---
> + Makefile |    4 ++--
> + 1 files changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index ae846e2..120d422 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -1,13 +1,13 @@
> + CC ?= gcc
> + AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
> +-CFLAGS ?= -g -O2
> ++CFLAGS_append = -g -O2
> + objects = mmc.o mmc_cmds.o
> +
> + CHECKFLAGS = -Wall -Werror -Wuninitialized -Wundef
> +
> + DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
> +
> +-override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS)
> ++override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS_append)
> +
> + INSTALL = install
> + prefix ?= /usr/local
> +--
> +1.7.1
> +
> diff --git a/meta/recipes-devtools/mmc/mmc-utils_git.bb b/meta/recipes-devtools/mmc/mmc-utils_git.bb
> index d88520c..771eede 100644
> --- a/meta/recipes-devtools/mmc/mmc-utils_git.bb
> +++ b/meta/recipes-devtools/mmc/mmc-utils_git.bb
> @@ -9,7 +9,8 @@ SRCREV = "11f2ceabc4ad3f0dd568e0ce68166e4803e0615b"
>   PV = "0.1"
>
>   SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;protocol=git;branch=${BRANCH} \
> -           file://0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch"
> +           file://0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch \
> +           file://0001-mmc-utils-force-O2.patch"
>
>   S = "${WORKDIR}/git"
>
>



Met vriendelijke groet / kind regards,

Mike Looijmans
System Expert


TOPIC Embedded Systems
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: (+31) (0) 499 33 69 79
Telefax:  (+31) (0) 499 33 69 70
E-mail: mike.looijmans@topic.nl
Website: www.topic.nl

Please consider the environment before printing this e-mail

Visit us at Embedded World 2015 Nuernberg, 24.02.2015 till 26.02.2015, Hall 1, stand number 136.
https://www.embedded-world.de/de/ausstellerprodukte/?focus=edb3exhibitor&focus2=14017667&focus3=embwld15&highlight=topic



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc-utils: set the optimization to -O2
  2015-01-22  8:35 ` Mike Looijmans
@ 2015-01-22 10:45   ` Otavio Salvador
  0 siblings, 0 replies; 3+ messages in thread
From: Otavio Salvador @ 2015-01-22 10:45 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: Patches and discussions about the oe-core layer

On Thu, Jan 22, 2015 at 6:35 AM, Mike Looijmans <mike.looijmans@topic.nl> wrote:
> Wouldn't this cause build that use "-Os" (or -O3) to be forced to use "-O2"
> for this package?
>
> Using -Os makes for serious flash space savings on the MIPS settop boxes, we
> found that the code generated with -Os isn't just smaller, but it compresses
> into a much smaller filesystem than -O2 generated files. There appears to be
> some synergy there between the compression algorithm (gzip or lzo) and the
> code as generated with that option.

Agreed and this is not the right path it seems.

I think this will be used when security_flags.inc is in place. So the
fix should be there, not in a patch.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-22 10:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22  8:29 [PATCH] mmc-utils: set the optimization to -O2 Yue Tao
2015-01-22  8:35 ` Mike Looijmans
2015-01-22 10:45   ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.