summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/glibc/glibc.inc')
-rw-r--r--meta/recipes-core/glibc/glibc.inc20
1 files changed, 8 insertions, 12 deletions
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 5711209c71..bf1dccdeb8 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -8,19 +8,15 @@ PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
8 8
9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" 9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
10 10
11# glibc can't be built without optimization, if someone tries to compile an
12# entire image as -O0, break with fatal.
13python () { 11python () {
14 if bb.utils.contains("SELECTED_OPTIMIZATION", "-O", "x", "", d) == "x": 12 opt_effective = "-O"
15 bb.note("glibc can't be built with -O, -O -Wno-error will be used instead.") 13 for opt in d.getVar('SELECTED_OPTIMIZATION', True).split():
16 d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error") 14 if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
17 elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": 15 opt_effective = opt
18 bb.fatal("glibc can't be built with -O0, using -O1 -Wno-error or -O1 instead.") 16 if opt_effective == "-O0":
19 elif bb.utils.contains("SELECTED_OPTIMIZATION", "-Os", "x", "", d) == "x": 17 bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN', True), opt_effective))
20 bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.") 18 if opt_effective in ("-O", "-O1", "-Os"):
21 d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error") 19 bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" % (d.getVar('PN', True), opt_effective))
22 elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O1", "x", "", d) == "x":
23 bb.note("glibc can't be built with -O1, -O1 -Wno-error will be used instead.")
24 d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error") 20 d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")
25} 21}
26 22