diff options
Diffstat (limited to 'meta/recipes-core/eglibc/eglibc.inc')
-rw-r--r-- | meta/recipes-core/eglibc/eglibc.inc | 84 |
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 0000000000..375b9bc116 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc.inc | |||
@@ -0,0 +1,84 @@ | |||
1 | require eglibc-common.inc | ||
2 | require eglibc-ld.inc | ||
3 | require eglibc-testing.inc | ||
4 | |||
5 | STAGINGCC = "gcc-cross-initial" | ||
6 | STAGINGCC_class-nativesdk = "gcc-crosssdk-initial" | ||
7 | PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" | ||
8 | |||
9 | TOOLCHAIN_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. | ||
13 | def 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 | |||
20 | SELECTED_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. | ||
28 | 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}'" | ||
29 | siteconfig_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. | ||
36 | DEPENDS = "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}']}" | ||
39 | PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" | ||
40 | PROVIDES += "virtual/libintl virtual/libiconv" | ||
41 | inherit autotools | ||
42 | require eglibc-options.inc | ||
43 | |||
44 | LEAD_SONAME = "libc.so" | ||
45 | |||
46 | CACHED_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 | |||
52 | GLIBC_EXTRA_OECONF ?= "" | ||
53 | GLIBC_EXTRA_OECONF_class-nativesdk = "" | ||
54 | INHIBIT_DEFAULT_DEPS = "1" | ||
55 | |||
56 | ARM_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 | ||
60 | EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}"" | ||
61 | EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM" | ||
62 | EXTRA_OEMAKE += "${EGLIBCPARALLELISM}" | ||
63 | PARALLEL_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 | ||
68 | EXTRA_OEMAKE += "SHELL=/bin/bash" | ||
69 | |||
70 | OE_FEATURES = "${@features_to_eglibc_settings(d)}" | ||
71 | do_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 | |||
76 | do_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 | |||
84 | GLIBC_ADDONS ?= "ports,nptl,libidn" | ||