Skip to contentSkip to conversation

eglibc: move the fix code for optimization isssue to .inc

PATCH Applied [email protected] 2 participants 4 messages Nov 28, 2012

lore
Share & tools
lore
#0 lore raw

cover eglibc: move the fix code for optimization isssue to .inc

From: Jackie Huang <[email protected]>

I made a patch against the eglibc_2.16.bb for the optimization issue two weeks ago, but it's not a version specific issue and we still keep the versions 2.13 and 2.15 (and not having the 2.16 yet), so it would be more appropriate to move the code to the .inc file.
And we also want to cherry-pick this commit to our oe-core branch so I revert the previous one and make a new commit against the .inc file but I'm not sure if it is proper to do that. Please correct me if it is not, thanks!

* Test info:
1) MACHINE=qemux86-64/qemuppc/qemumips

$ bitbake core-image-sato 
$ bitbake eglibc

2) MACHINE=qemux86-64/qemuppc/qemumips
DEBUG_OPTIMIZATION = "-O0 -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe" DEBUG_BUILD = "1" or SELECTED_OPTIMIZATION = "${DEBUG_OPTIMIZATION}"

$ bitbake core-image-sato
$ bitbake eglibc

The following changes since commit 764cc1eb3043c84121f597d2271108b91052095e:

bitbake.conf: Change build output message to list BUILD_SYS, TARGET_SYS and NATIVELSBSTRING (2012-11-27 08:57:39 +0000)

are available in the git repository at:
git://git.pokylinux.org/poky-contrib jhuang0/d_eglibc_1128_1
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jhuang0/d_eglibc_1128_1

Jackie Huang (2):
Revert "eglibc: always compile with optimization."
eglibc: always compile with optimization.

 meta/recipes-core/eglibc/eglibc.inc     |   11 +++++++++++
 meta/recipes-core/eglibc/eglibc_2.16.bb |   11 -----------
 2 files changed, 11 insertions(+), 11 deletions(-)
Signature · 1 line
1.7.4
#1 lore raw

PATCH 1/2 Revert "eglibc: always compile with optimization."

From: Jackie Huang <[email protected]>

This reverts commit 9ca1c6120fad5dcae1694e8e37331c1b903f1fd0. The fix is not version specific, so revert it and move the fix code to the .inc in the following commit.

---
 meta/recipes-core/eglibc/eglibc_2.16.bb |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)
meta/recipes-core/eglibc/eglibc_2.16.bb +0 -11
index 71bcc30..aa9256c 100644
@@ -87,17 +87,6 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
 
 EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
 
-# eglibc can't be built without optimization, if someone tries to compile an
-# entire image as -O0, we override it with -O2 here and give a note about it.
-def get_optimization(d):
-    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
-    if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
-        bb.note("eglibc can't be built with -O0, -O2 will be used instead.")
-        return selected_optimization.replace("-O0", "-O2")
-    return selected_optimization
-
-SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
-
 do_unpack_append() {
     bb.build.exec_func('do_move_ports', d)
 }
Signature · 1 line
1.7.4
#2 lore raw

PATCH 2/2 eglibc: always compile with optimization.

In reply to [email protected]

From: Jackie Huang <[email protected]>

eglibc fails to compile if someone tries to compile an entire image as -O0:
error "glibc cannot be compiled without optimization"
so in this case, force to use -O2 and give a note about it.

[YOCTO #3405]

---
 meta/recipes-core/eglibc/eglibc.inc |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
meta/recipes-core/eglibc/eglibc.inc +11 -0
index 3d136bf..1e04197 100644
@@ -8,6 +8,17 @@ PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
 
 TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
 
+# eglibc can't be built without optimization, if someone tries to compile an
+# entire image as -O0, we override it with -O2 here and give a note about it.
+def get_optimization(d):
+    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
+    if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+        bb.note("eglibc can't be built with -O0, -O2 will be used instead.")
+        return selected_optimization.replace("-O0", "-O2")
+    return selected_optimization
+
+SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
+
 # siteconfig.bbclass runs configure which needs a working compiler
 # For the compiler to work we need a working libc yet libc isn't 
 # in the sysroots directory at this point. This means the libc.so
Signature · 1 line
1.7.4
#3 lore raw
In reply to [email protected]
Quoted 25 lines · On Wed, 2012-11-28 at 14:11 +0800, [email protected] wrote:

From: Jackie Huang <[email protected]>

I made a patch against the eglibc_2.16.bb for the optimization issue two weeks ago, but it's not a version specific issue and we still keep the versions 2.13 and 2.15 (and not having the 2.16 yet), so it would be more appropriate to move the code to the .inc file.
And we also want to cherry-pick this commit to our oe-core branch so I revert the previous one and make a new commit against the .inc file but I'm not sure if it is proper to do that. Please correct me if it is not, thanks!

* Test info:
1) MACHINE=qemux86-64/qemuppc/qemumips

$ bitbake core-image-sato 
$ bitbake eglibc

2) MACHINE=qemux86-64/qemuppc/qemumips
DEBUG_OPTIMIZATION = "-O0 -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe" DEBUG_BUILD = "1" or SELECTED_OPTIMIZATION = "${DEBUG_OPTIMIZATION}"

$ bitbake core-image-sato
$ bitbake eglibc

The following changes since commit 764cc1eb3043c84121f597d2271108b91052095e:

bitbake.conf: Change build output message to list BUILD_SYS, TARGET_SYS and NATIVELSBSTRING (2012-11-27 08:57:39 +0000)

Quoted 7 lines

are available in the git repository at:
git://git.pokylinux.org/poky-contrib jhuang0/d_eglibc_1128_1
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=jhuang0/d_eglibc_1128_1

Jackie Huang (2):
Revert "eglibc: always compile with optimization."
eglibc: always compile with optimization.

I've queued this on master-next. I changed it from two commits to one commit which just moves the code for the reason you describe.

Cheers,

Richard