summaryrefslogtreecommitdiffstats
path: root/meta-aspeed/recipes-core/eglibc/eglibc.inc
diff options
context:
space:
mode:
authorTian Fang <tfang@fb.com>2015-12-14 22:08:40 -0800
committerTian Fang <tfang@fb.com>2015-12-15 09:49:21 -0800
commite65a7944211c70f6b5cfb6cedd73cc31105319de (patch)
tree067082251bc52bc6c09ca87feaa1352d0468a5ac /meta-aspeed/recipes-core/eglibc/eglibc.inc
parent8a67fbdd0e251bb34d55992b0771edba1837d589 (diff)
downloadast2050-yocto-openbmc-e65a7944211c70f6b5cfb6cedd73cc31105319de.zip
ast2050-yocto-openbmc-e65a7944211c70f6b5cfb6cedd73cc31105319de.tar.gz
Sync to internal OpenBMC repo f926614
Diffstat (limited to 'meta-aspeed/recipes-core/eglibc/eglibc.inc')
-rw-r--r--meta-aspeed/recipes-core/eglibc/eglibc.inc84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta-aspeed/recipes-core/eglibc/eglibc.inc b/meta-aspeed/recipes-core/eglibc/eglibc.inc
new file mode 100644
index 0000000..c0b2494
--- /dev/null
+++ b/meta-aspeed/recipes-core/eglibc/eglibc.inc
@@ -0,0 +1,84 @@
+require eglibc-common.inc
+require eglibc-ld.inc
+require eglibc-testing.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+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
+# linker script won't work as the --sysroot setting isn't correct.
+# Here we create a hacked up libc linker script and pass in the right
+# flags to let configure work. Ugly.
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
+siteconfig_do_siteconfig_gencache_prepend = " \
+ mkdir -p ${WORKDIR}/site_config_libc; \
+ cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
+ sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
+"
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
+# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
+#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
+PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES += "virtual/libintl virtual/libiconv"
+inherit autotools
+require eglibc-options.inc
+
+LEAD_SONAME = "libc.so"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_KSH=${base_bindir}/bash \
+ ac_cv_path_BASH_SHELL=${base_bindir}/bash \
+ libc_cv_localedir=${localedir} \
+ libc_cv_ssp=no \
+ "
+
+GLIBC_EXTRA_OECONF ?= ""
+GLIBC_EXTRA_OECONF_class-nativesdk = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+ARM_INSTRUCTION_SET = "arm"
+
+# eglibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
+# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
+EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
+EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
+EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
+PARALLEL_MAKE = ""
+
+# eglibc make-syscalls.sh has a number of issues with /bin/dash and
+# it's output which make calls via the SHELL also has issues, so
+# ensure make uses /bin/bash
+EXTRA_OEMAKE += "SHELL=/bin/bash"
+
+OE_FEATURES = "${@features_to_eglibc_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() {
+ 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 ?= "ports,nptl,libidn"
OpenPOWER on IntegriCloud