Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | require glibc.inc |
| 2 | require glibc-version.inc |
| 3 | |
Andrew Geissler | b7d2861 | 2020-07-24 16:15:54 -0500 | [diff] [blame^] | 4 | CVE_CHECK_WHITELIST += "CVE-2020-10029" |
| 5 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 6 | DEPENDS += "gperf-native bison-native make-native" |
| 7 | |
| 8 | NATIVESDKFIXES ?= "" |
| 9 | NATIVESDKFIXES_class-nativesdk = "\ |
| 10 | file://0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \ |
| 11 | file://0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \ |
| 12 | file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \ |
| 13 | file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \ |
| 14 | file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \ |
| 15 | " |
| 16 | |
| 17 | SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ |
| 18 | file://etc/ld.so.conf \ |
| 19 | file://generate-supported.mk \ |
| 20 | file://makedbs.sh \ |
| 21 | \ |
| 22 | ${NATIVESDKFIXES} \ |
| 23 | file://0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \ |
| 24 | file://0009-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \ |
| 25 | file://0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \ |
| 26 | file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ |
| 27 | file://0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \ |
| 28 | file://0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ |
| 29 | file://0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ |
| 30 | file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ |
| 31 | file://0016-Add-unused-attribute.patch \ |
| 32 | file://0017-yes-within-the-path-sets-wrong-config-variables.patch \ |
| 33 | file://0018-timezone-re-written-tzselect-as-posix-sh.patch \ |
| 34 | file://0019-Remove-bash-dependency-for-nscd-init-script.patch \ |
| 35 | file://0020-eglibc-Cross-building-and-testing-instructions.patch \ |
| 36 | file://0021-eglibc-Help-bootstrap-cross-toolchain.patch \ |
| 37 | file://0022-eglibc-Resolve-__fpscr_values-on-SH4.patch \ |
| 38 | file://0023-eglibc-Forward-port-cross-locale-generation-support.patch \ |
| 39 | file://0024-Define-DUMMY_LOCALE_T-if-not-defined.patch \ |
| 40 | file://0025-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ |
| 41 | file://0026-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ |
| 42 | file://0027-intl-Emit-no-lines-in-bison-generated-files.patch \ |
| 43 | file://0028-inject-file-assembly-directives.patch \ |
| 44 | file://0029-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ |
Andrew Geissler | 1e34c2d | 2020-05-29 16:02:59 -0500 | [diff] [blame] | 45 | file://0030-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 46 | " |
| 47 | S = "${WORKDIR}/git" |
| 48 | B = "${WORKDIR}/build-${TARGET_SYS}" |
| 49 | |
| 50 | PACKAGES_DYNAMIC = "" |
| 51 | |
| 52 | # the -isystem in bitbake.conf screws up glibc do_stage |
| 53 | BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}" |
| 54 | TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}" |
| 55 | |
| 56 | GLIBC_BROKEN_LOCALES = "" |
| 57 | |
| 58 | GLIBCPIE ??= "" |
| 59 | |
| 60 | EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ |
| 61 | --disable-profile \ |
| 62 | --disable-debug --without-gd \ |
| 63 | --enable-clocale=gnu \ |
| 64 | --with-headers=${STAGING_INCDIR} \ |
| 65 | --without-selinux \ |
| 66 | --enable-tunables \ |
| 67 | --enable-bind-now \ |
| 68 | --enable-stack-protector=strong \ |
| 69 | --enable-stackguard-randomization \ |
| 70 | --disable-crypt \ |
| 71 | --with-default-link \ |
| 72 | --enable-nscd \ |
| 73 | ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \ |
| 74 | ${GLIBCPIE} \ |
| 75 | ${GLIBC_EXTRA_OECONF}" |
| 76 | |
| 77 | EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" |
| 78 | |
| 79 | do_patch_append() { |
| 80 | bb.build.exec_func('do_fix_readlib_c', d) |
| 81 | } |
| 82 | |
| 83 | do_fix_readlib_c () { |
| 84 | sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c |
| 85 | } |
| 86 | |
| 87 | do_configure () { |
| 88 | # override this function to avoid the autoconf/automake/aclocal/autoheader |
| 89 | # calls for now |
| 90 | # don't pass CPPFLAGS into configure, since it upsets the kernel-headers |
| 91 | # version check and doesn't really help with anything |
| 92 | (cd ${S} && gnu-configize) || die "failure in running gnu-configize" |
| 93 | find ${S} -name "configure" | xargs touch |
| 94 | CPPFLAGS="" oe_runconf |
| 95 | } |
| 96 | |
| 97 | LDFLAGS += "-fuse-ld=bfd" |
| 98 | do_compile () { |
| 99 | base_do_compile |
| 100 | echo "Adjust ldd script" |
| 101 | if [ -n "${RTLDLIST}" ] |
| 102 | then |
| 103 | prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'` |
| 104 | # remove duplicate entries |
| 105 | newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)` |
| 106 | echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\"" |
| 107 | sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#" |
| 108 | fi |
| 109 | } |
| 110 | |
| 111 | require glibc-package.inc |
| 112 | |
| 113 | BBCLASSEXTEND = "nativesdk" |