summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2018-09-29 13:45:02 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2018-09-30 16:27:49 +0000
commit83da0fdb4e190eaa3fd335bcac5cbf7635c6bb06 (patch)
treed82d0edc7de115708fe0a0a589d3bf58431367b2
parent90b91793dff51e73c296298def72bbfdb60aef4d (diff)
downloadopenembedded-core-contrib-jansa/glibc.tar.gz
openembedded-core-contrib-jansa/glibc.tar.bz2
openembedded-core-contrib-jansa/glibc.zip
glibc: test with O0jansa/glibc
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta/conf/bitbake.conf4
-rw-r--r--meta/recipes-core/glibc/glibc.inc9
-rw-r--r--meta/recipes-core/glibc/glibc/0034-libc-symbols-allow-to-build-with-O0.patch26
-rw-r--r--meta/recipes-core/glibc/glibc_2.28.bb1
-rw-r--r--meta/recipes-kernel/systemtap/systemtap_git.inc7
5 files changed, 29 insertions, 18 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 62362eac48..834263aa7d 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -615,10 +615,10 @@ DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
# Disabled until the option works properly -feliminate-dwarf2-dups
FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
-DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
+DEBUG_OPTIMIZATION = "-O0 -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
-BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"
+BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O0 -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"
##################################################################
# Settings used by bitbake-layers.
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index ddf0c6b80e..e673707369 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -6,15 +6,6 @@ STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
-python () {
- opt_effective = "-O"
- for opt in d.getVar('SELECTED_OPTIMIZATION').split():
- if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
- opt_effective = opt
- if opt_effective == "-O0":
- bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
-}
-
# 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
diff --git a/meta/recipes-core/glibc/glibc/0034-libc-symbols-allow-to-build-with-O0.patch b/meta/recipes-core/glibc/glibc/0034-libc-symbols-allow-to-build-with-O0.patch
new file mode 100644
index 0000000000..a1ed04a790
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0034-libc-symbols-allow-to-build-with-O0.patch
@@ -0,0 +1,26 @@
+From 4f6d016795f974833c6686d14484a82b2562954a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sun, 30 Sep 2018 09:35:44 +0000
+Subject: [PATCH] libc-symbols: allow to build with -O0
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ include/libc-symbols.h | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/include/libc-symbols.h b/include/libc-symbols.h
+index 8b9273c13a..4b85c4455d 100644
+--- a/include/libc-symbols.h
++++ b/include/libc-symbols.h
+@@ -70,11 +70,6 @@
+ itself is being compiled, or just some generator program. */
+ #define _LIBC 1
+
+-/* Some files must be compiled with optimization on. */
+-#if !defined __ASSEMBLER__ && !defined __OPTIMIZE__
+-# error "glibc cannot be compiled without optimization"
+-#endif
+-
+ /* -ffast-math cannot be applied to the C library, as it alters the ABI.
+ Some test components that use -ffast-math are currently not part of
+ IS_IN (testsuite) for technical reasons, so we have a secondary override. */
diff --git a/meta/recipes-core/glibc/glibc_2.28.bb b/meta/recipes-core/glibc/glibc_2.28.bb
index 4ccd74f346..901139a1cf 100644
--- a/meta/recipes-core/glibc/glibc_2.28.bb
+++ b/meta/recipes-core/glibc/glibc_2.28.bb
@@ -48,6 +48,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch \
file://0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch \
file://0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
+ file://0034-libc-symbols-allow-to-build-with-O0.patch \
"
NATIVESDKFIXES ?= ""
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
index 06924fc240..8bf2421c1e 100644
--- a/meta/recipes-kernel/systemtap/systemtap_git.inc
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -18,10 +18,3 @@ COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips).*-linux'
COMPATIBLE_HOST_libc-musl = 'null'
S = "${WORKDIR}/git"
-
-# systemtap can't be built without optimization, if someone tries to compile an
-# entire image as -O0, break with fatal.
-python () {
- if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
- bb.fatal("systemtap can't be built with -O0, using -O1 -Wno-error or -O1 instead.")
-}