summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/eglibc/eglibc.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc.inc')
-rw-r--r--meta/recipes-core/eglibc/eglibc.inc84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-core/eglibc/eglibc.inc b/meta/recipes-core/eglibc/eglibc.inc
new file mode 100644
index 0000000..375b9bc
--- /dev/null
+++ b/meta/recipes-core/eglibc/eglibc.inc
@@ -0,0 +1,84 @@
1require eglibc-common.inc
2require eglibc-ld.inc
3require eglibc-testing.inc
4
5STAGINGCC = "gcc-cross-initial"
6STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
7PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
8
9TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
10
11# eglibc can't be built without optimization, if someone tries to compile an
12# entire image as -O0, we override it with -O2 here and give a note about it.
13def get_optimization(d):
14 selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
15 if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
16 bb.note("eglibc can't be built with -O0, -O2 will be used instead.")
17 return selected_optimization.replace("-O0", "-O2")
18 return selected_optimization
19
20SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
21
22# siteconfig.bbclass runs configure which needs a working compiler
23# For the compiler to work we need a working libc yet libc isn't
24# in the sysroots directory at this point. This means the libc.so
25# linker script won't work as the --sysroot setting isn't correct.
26# Here we create a hacked up libc linker script and pass in the right
27# flags to let configure work. Ugly.
28EXTRASITECONFIG = "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}'"
29siteconfig_do_siteconfig_gencache_prepend = " \
30 mkdir -p ${WORKDIR}/site_config_libc; \
31 cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
32 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
33"
34
35# nptl needs unwind support in gcc, which can't be built without glibc.
36DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
37# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
38#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
39PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
40PROVIDES += "virtual/libintl virtual/libiconv"
41inherit autotools
42require eglibc-options.inc
43
44LEAD_SONAME = "libc.so"
45
46CACHED_CONFIGUREVARS += "ac_cv_path_KSH=${base_bindir}/bash \
47 ac_cv_path_BASH_SHELL=${base_bindir}/bash \
48 libc_cv_localedir=${localedir} \
49 libc_cv_ssp=no \
50 "
51
52GLIBC_EXTRA_OECONF ?= ""
53GLIBC_EXTRA_OECONF_class-nativesdk = ""
54INHIBIT_DEFAULT_DEPS = "1"
55
56ARM_INSTRUCTION_SET = "arm"
57
58# eglibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
59# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
60EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
61EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
62EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
63PARALLEL_MAKE = ""
64
65# eglibc make-syscalls.sh has a number of issues with /bin/dash and
66# it's output which make calls via the SHELL also has issues, so
67# ensure make uses /bin/bash
68EXTRA_OEMAKE += "SHELL=/bin/bash"
69
70OE_FEATURES = "${@features_to_eglibc_settings(d)}"
71do_configure_prepend() {
72 sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
73 echo '${OE_FEATURES}' > ${B}/option-groups.config
74}
75
76do_configure_append() {
77 oe_runmake config
78
79 # Remove quotation marks from OPTION_EGLIBC_NSSWITCH_FIXED_*. This will
80 # avoid install error.
81 sed -i 's/^OPTION_EGLIBC_NSSWITCH_FIXED_\(.*\)="\(.*\)"$/OPTION_EGLIBC_NSSWITCH_FIXED_\1=\2/' option-groups.config
82}
83
84GLIBC_ADDONS ?= "ports,nptl,libidn"