diff options
Diffstat (limited to 'yocto-poky/meta/recipes-core/glibc/glibc.inc')
-rw-r--r-- | yocto-poky/meta/recipes-core/glibc/glibc.inc | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/yocto-poky/meta/recipes-core/glibc/glibc.inc b/yocto-poky/meta/recipes-core/glibc/glibc.inc index 17fa2d52a..bf1dccdeb 100644 --- a/yocto-poky/meta/recipes-core/glibc/glibc.inc +++ b/yocto-poky/meta/recipes-core/glibc/glibc.inc @@ -8,27 +8,17 @@ PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" -# glibc 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 bb.utils.contains("SELECTED_OPTIMIZATION", "-O2", "x", "", d) == "x": - return selected_optimization - elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O", "x", "", d) == "x": - bb.note("glibc can't be built with -O, -O -Wno-error will be used instead.") - return selected_optimization.replace("-O", "-O -Wno-error") - elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": - bb.note("glibc can't be built with -O0, -O2 will be used instead.") - return selected_optimization.replace("-O0", "-O2") - elif bb.utils.contains("SELECTED_OPTIMIZATION", "-Os", "x", "", d) == "x": - bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.") - return selected_optimization.replace("-Os", "-Os -Wno-error") - elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O1", "x", "", d) == "x": - bb.note("glibc can't be built with -O1, -O1 -Wno-error will be used instead.") - return selected_optimization.replace("-O1", "-O1 -Wno-error") - return selected_optimization - -SELECTED_OPTIMIZATION := "${@get_optimization(d)}" +python () { + opt_effective = "-O" + for opt in d.getVar('SELECTED_OPTIMIZATION', True).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', True), opt_effective)) + if opt_effective in ("-O", "-O1", "-Os"): + bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" % (d.getVar('PN', True), opt_effective)) + d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error") +} # siteconfig.bbclass runs configure which needs a working compiler # For the compiler to work we need a working libc yet libc isn't @@ -50,12 +40,6 @@ DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" PROVIDES += "virtual/libintl virtual/libiconv" inherit autotools texinfo distro_features_check systemd -require glibc-options.inc - -# The main purpose of setting this variable is to prevent users from accidently -# overriding DISTRO_FEATRUES, causing obscure build failures because of lack -# of libc functions. -REQUIRED_DISTRO_FEATURES = "${DISTRO_FEATURES_LIBC}" LEAD_SONAME = "libc.so" @@ -64,6 +48,7 @@ CACHED_CONFIGUREVARS += " \ libc_cv_slibdir=${base_libdir} \ libc_cv_rootsbindir=${base_sbindir} \ libc_cv_localedir=${localedir} \ + libc_cv_ssp_strong=no \ libc_cv_ssp=no \ " @@ -88,18 +73,8 @@ PARALLEL_MAKE = "" # ensure make uses /bin/bash EXTRA_OEMAKE += "SHELL=/bin/bash" -OE_FEATURES = "${@features_to_glibc_settings(d)}" do_configure_prepend() { sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in - echo '${OE_FEATURES}' > ${B}/option-groups.config -} - -do_configure_append() { - yes '' | oe_runmake config - - # Remove quotation marks from OPTION_EGLIBC_NSSWITCH_FIXED_*. This will - # avoid install error. - sed -i 's/^OPTION_EGLIBC_NSSWITCH_FIXED_\(.*\)="\(.*\)"$/OPTION_EGLIBC_NSSWITCH_FIXED_\1=\2/' option-groups.config } GLIBC_ADDONS ?= "nptl,libidn" |