glibc_2.35.bb 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. require glibc.inc
  2. require glibc-version.inc
  3. CVE_CHECK_IGNORE += "CVE-2020-10029 CVE-2021-27645"
  4. # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010022
  5. # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010023
  6. # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010024
  7. # Upstream glibc maintainers dispute there is any issue and have no plans to address it further.
  8. # "this is being treated as a non-security bug and no real threat."
  9. CVE_CHECK_IGNORE += "CVE-2019-1010022 CVE-2019-1010023 CVE-2019-1010024"
  10. # glibc https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2019-1010025
  11. # Allows for ASLR bypass so can bypass some hardening, not an exploit in itself, may allow
  12. # easier access for another. "ASLR bypass itself is not a vulnerability."
  13. # Potential patch at https://sourceware.org/bugzilla/show_bug.cgi?id=22853
  14. CVE_CHECK_IGNORE += "CVE-2019-1010025"
  15. DEPENDS += "gperf-native bison-native make-native"
  16. NATIVESDKFIXES ?= ""
  17. NATIVESDKFIXES:class-nativesdk = "\
  18. file://0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
  19. file://0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
  20. file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
  21. file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
  22. file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
  23. file://0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch \
  24. "
  25. SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
  26. file://etc/ld.so.conf \
  27. file://generate-supported.mk \
  28. file://makedbs.sh \
  29. \
  30. ${NATIVESDKFIXES} \
  31. file://0009-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
  32. file://0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
  33. file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
  34. file://0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
  35. file://0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
  36. file://0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
  37. file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
  38. file://0016-yes-within-the-path-sets-wrong-config-variables.patch \
  39. file://0017-timezone-re-written-tzselect-as-posix-sh.patch \
  40. file://0018-Remove-bash-dependency-for-nscd-init-script.patch \
  41. file://0019-eglibc-Cross-building-and-testing-instructions.patch \
  42. file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \
  43. file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \
  44. file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
  45. file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
  46. file://0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
  47. file://0026-intl-Emit-no-lines-in-bison-generated-files.patch \
  48. file://0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
  49. file://0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
  50. file://0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \
  51. file://0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch \
  52. file://0001-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
  53. file://0001-RISC-V-Remove-riscv-specific-sigcontext.h.patch \
  54. file://0002-RISC-V-Reserve-about-5K-space-in-mcontext_t-to-suppo.patch \
  55. file://0003-RISC-V-Save-and-restore-VCSR-when-doing-user-context.patch \
  56. file://0004-RISC-V-Extend-MINSIGSTKSZ-and-SIGSTKSZ-to-backup-RVV.patch \
  57. file://0005-RISC-V-Expand-PTHREAD_STACK_MIN-to-support-RVV-envir.patch \
  58. file://0006-add-vector-support-for-memset-memcmp-memmove-memcpy-.patch \
  59. file://0007-add-NT_RISCV_VECTOR-macro-definition-to-align-with-l.patch \
  60. file://0008-fix-the-bcmp-unrecognized-issue.patch \
  61. file://0009-Revert-RISC-V-Reserve-about-5K-space-in-mcontext_t-t.patch \
  62. file://0010-Revert-RISC-V-Save-and-restore-VCSR-when-doing-user-.patch \
  63. file://0011-riscv-Resolve-symbols-directly-for-symbols-with-STO_.patch \
  64. file://0012-add-hwcap.h-header-file.patch \
  65. file://0013-change-memcpy_vector-LMUL-to-m8.patch \
  66. "
  67. S = "${WORKDIR}/git"
  68. B = "${WORKDIR}/build-${TARGET_SYS}"
  69. PACKAGES_DYNAMIC = ""
  70. # the -isystem in bitbake.conf screws up glibc do_stage
  71. BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
  72. TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
  73. GLIBC_BROKEN_LOCALES = ""
  74. GLIBCPIE ??= ""
  75. EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
  76. --disable-profile \
  77. --disable-debug --without-gd \
  78. --enable-clocale=gnu \
  79. --with-headers=${STAGING_INCDIR} \
  80. --without-selinux \
  81. --enable-tunables \
  82. --enable-bind-now \
  83. --enable-stack-protector=strong \
  84. --disable-crypt \
  85. --with-default-link \
  86. ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
  87. ${GLIBCPIE} \
  88. ${GLIBC_EXTRA_OECONF}"
  89. EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
  90. EXTRA_OECONF:append:x86 = " --enable-cet"
  91. EXTRA_OECONF:append:x86-64 = " --enable-cet"
  92. PACKAGECONFIG ??= "nscd memory-tagging"
  93. PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
  94. PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging"
  95. do_patch:append() {
  96. bb.build.exec_func('do_fix_readlib_c', d)
  97. }
  98. do_fix_readlib_c () {
  99. sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
  100. }
  101. do_configure () {
  102. # override this function to avoid the autoconf/automake/aclocal/autoheader
  103. # calls for now
  104. # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
  105. # version check and doesn't really help with anything
  106. (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
  107. find ${S} -name "configure" | xargs touch
  108. CPPFLAGS="" oe_runconf
  109. }
  110. LDFLAGS += "-fuse-ld=bfd"
  111. do_compile () {
  112. base_do_compile
  113. echo "Adjust ldd script"
  114. if [ -n "${RTLDLIST}" ]
  115. then
  116. prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
  117. # remove duplicate entries
  118. newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)`
  119. echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
  120. sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
  121. fi
  122. }
  123. require glibc-package.inc
  124. BBCLASSEXTEND = "nativesdk"