Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | require glibc-common.inc |
| 2 | require glibc-ld.inc |
| 3 | require glibc-testing.inc |
| 4 | |
| 5 | STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 6 | STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 7 | PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" |
| 8 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 9 | python () { |
| 10 | opt_effective = "-O" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 11 | for opt in d.getVar('SELECTED_OPTIMIZATION').split(): |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 12 | if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"): |
| 13 | opt_effective = opt |
| 14 | if opt_effective == "-O0": |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 15 | bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective)) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 16 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 17 | |
| 18 | # siteconfig.bbclass runs configure which needs a working compiler |
| 19 | # For the compiler to work we need a working libc yet libc isn't |
| 20 | # in the sysroots directory at this point. This means the libc.so |
| 21 | # linker script won't work as the --sysroot setting isn't correct. |
| 22 | # Here we create a hacked up libc linker script and pass in the right |
| 23 | # flags to let configure work. Ugly. |
| 24 | 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}'" |
| 25 | siteconfig_do_siteconfig_gencache_prepend = " \ |
| 26 | mkdir -p ${WORKDIR}/site_config_libc; \ |
| 27 | cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \ |
| 28 | sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \ |
| 29 | " |
| 30 | |
| 31 | # nptl needs unwind support in gcc, which can't be built without glibc. |
| 32 | DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 33 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 34 | PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 35 | PROVIDES += "virtual/libintl virtual/libiconv" |
| 36 | inherit autotools texinfo distro_features_check systemd |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | |
| 38 | LEAD_SONAME = "libc.so" |
| 39 | |
| 40 | CACHED_CONFIGUREVARS += " \ |
| 41 | ac_cv_path_BASH_SHELL=${base_bindir}/bash \ |
| 42 | libc_cv_slibdir=${base_libdir} \ |
| 43 | libc_cv_rootsbindir=${base_sbindir} \ |
| 44 | libc_cv_localedir=${localedir} \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 45 | libc_cv_ssp_strong=no \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 46 | libc_cv_ssp_all=no \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 47 | libc_cv_ssp=no \ |
| 48 | " |
| 49 | |
| 50 | GLIBC_EXTRA_OECONF ?= "" |
| 51 | GLIBC_EXTRA_OECONF_class-nativesdk = "" |
| 52 | INHIBIT_DEFAULT_DEPS = "1" |
| 53 | |
| 54 | # This needs to match with glibc-collateral.inc, otherwise glibc-scripts and glibc-locale |
| 55 | # will fail to find main glibc, for details see |
| 56 | # http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 57 | ARM_INSTRUCTION_SET_armv4 = "arm" |
| 58 | ARM_INSTRUCTION_SET_armv5 = "arm" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 59 | ARM_INSTRUCTION_SET_armv6 = "arm" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 60 | |
| 61 | # glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer |
| 62 | # PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE |
| 63 | EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}"" |
| 64 | EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM" |
| 65 | EXTRA_OEMAKE += "${EGLIBCPARALLELISM}" |
| 66 | PARALLEL_MAKE = "" |
| 67 | |
| 68 | # glibc make-syscalls.sh has a number of issues with /bin/dash and |
| 69 | # it's output which make calls via the SHELL also has issues, so |
| 70 | # ensure make uses /bin/bash |
| 71 | EXTRA_OEMAKE += "SHELL=/bin/bash" |
| 72 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 73 | do_configure_prepend() { |
| 74 | sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | } |
| 76 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 77 | # Enable backtrace from abort() |
| 78 | do_configure_append_arm () { |
| 79 | echo "CFLAGS-abort.c = -fasynchronous-unwind-tables" >> ${B}/configparms |
| 80 | echo "CFLAGS-raise.c = -fasynchronous-unwind-tables" >> ${B}/configparms |
| 81 | } |