aboutsummaryrefslogtreecommitdiffstats
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.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index e673707369..ddf0c6b80e 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -6,6 +6,15 @@ 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