glibc_2.36.bb 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. # This has been integrated into the 2.36 branch as of c399271 so is now fixed
  16. CVE_CHECK_IGNORE += "CVE-2022-39046"
  17. DEPENDS += "gperf-native bison-native"
  18. NATIVESDKFIXES ?= ""
  19. NATIVESDKFIXES:class-nativesdk = "\
  20. file://0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
  21. file://0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
  22. file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
  23. file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
  24. file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
  25. file://0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch \
  26. file://1f34a2328890aa192141f96449d25b77f666bf47.patch \
  27. "
  28. SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
  29. file://etc/ld.so.conf \
  30. file://generate-supported.mk \
  31. file://makedbs.sh \
  32. ${NATIVESDKFIXES} \
  33. file://0009-yes-within-the-path-sets-wrong-config-variables.patch \
  34. file://0010-eglibc-Cross-building-and-testing-instructions.patch \
  35. file://0011-eglibc-Help-bootstrap-cross-toolchain.patch \
  36. file://0012-eglibc-Resolve-__fpscr_values-on-SH4.patch \
  37. file://0013-eglibc-Forward-port-cross-locale-generation-support.patch \
  38. file://0014-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
  39. file://0015-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
  40. file://0016-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
  41. file://0017-powerpc-Do-not-ask-compiler-for-finding-arch.patch \
  42. file://0018-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \
  43. file://0019-Replace-echo-with-printf-builtin-in-nscd-init-script.patch \
  44. file://0020-sysdeps-gnu-configure.ac-Set-libc_cv_rootsbindir-onl.patch \
  45. file://0021-timezone-Make-shell-interpreter-overridable-in-tzsel.patch \
  46. file://0022-tzselect.ksh-Use-bin-sh-default-shell-interpreter.patch \
  47. file://0023-fix-create-thread-failed-in-unprivileged-process-BZ-.patch \
  48. file://0024-Avoid-hardcoded-build-time-paths-in-the-output-binar.patch \
  49. file://0025-startup-Force-O2.patch \
  50. file://0001-Linux-Add-ppoll-fortify-symbol-for-64-bit-time_t-BZ-.patch \
  51. file://0001-modify-and-merge-sifive-patches-to-support-V.patch \
  52. file://0002-add-vector-support-for-memset-memcmp-memmove-memcpy-.patch \
  53. file://0003-add-NT_RISCV_VECTOR-macro-definition-to-align-with-l.patch \
  54. file://0004-fix-the-bcmp-unrecognized-issue.patch \
  55. file://0005-riscv-Resolve-symbols-directly-for-symbols-with-STO_.patch \
  56. file://0006-change-memcpy_vector-LMUL-to-m8.patch \
  57. file://0007-add-header-files-for-vector-support.patch \
  58. file://0008-prohibit-from-generating-plt-table-when-static-linki.patch \
  59. file://0009-resolve-__memcmpeq-aliased-to-undefined-symbol-memcm.patch \
  60. file://0010-merge-demin-s-mem_xxx-optimization.patch \
  61. file://0011-add-alias-to-bcmp.patch \
  62. file://0012-remove-unnecessary-changes-to-support-v.patch \
  63. file://0013-fix-compiling-error-when-march-not-include-b-ext.patch \
  64. file://0014-fix-memcmp-bug-relate-to-use-jmp-table.patch \
  65. file://0015-memxxx-align-version-with-merge-tech-or-B-ext.patch \
  66. file://0016-strxxx-B-ext-opt-version.patch \
  67. file://0017-fix-strchr-missing-index-weak-alias.patch \
  68. file://0018-fix-memmove-align-fail-because-of-typo.patch \
  69. file://0019-fix-missing-alias-functions.patch \
  70. file://0001-RISCV-enable-align-loops-8-for-optimized-func.patch \
  71. file://0002-RISCV-revert-strchrnul-strncmp-strnlen.patch \
  72. "
  73. S = "${WORKDIR}/git"
  74. B = "${WORKDIR}/build-${TARGET_SYS}"
  75. PACKAGES_DYNAMIC = ""
  76. # the -isystem in bitbake.conf screws up glibc do_stage
  77. BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
  78. TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
  79. EXTRA_OEMAKE:class-target += "CFLAGS+=' -march=rv64gc_zba_zbb_zbc_zbs' ASFLAGS+=' -march=rv64gc_zba_zbb_zbc_zbs'"
  80. GLIBC_BROKEN_LOCALES = ""
  81. GLIBCPIE ??= ""
  82. EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
  83. --disable-profile \
  84. --disable-debug --without-gd \
  85. --enable-clocale=gnu \
  86. --with-headers=${STAGING_INCDIR} \
  87. --without-selinux \
  88. --enable-tunables \
  89. --enable-bind-now \
  90. --enable-stack-protector=strong \
  91. --disable-crypt \
  92. --with-default-link \
  93. ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
  94. ${GLIBCPIE} \
  95. ${GLIBC_EXTRA_OECONF}"
  96. EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
  97. EXTRA_OECONF:append:x86 = " ${@bb.utils.contains_any('TUNE_FEATURES', 'i586 c3', '--disable-cet', '--enable-cet', d)}"
  98. EXTRA_OECONF:append:x86-64 = " --enable-cet"
  99. PACKAGECONFIG ??= "nscd memory-tagging"
  100. PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd"
  101. PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging"
  102. do_patch:append() {
  103. bb.build.exec_func('do_fix_readlib_c', d)
  104. }
  105. do_fix_readlib_c () {
  106. sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
  107. }
  108. do_configure () {
  109. # override this function to avoid the autoconf/automake/aclocal/autoheader
  110. # calls for now
  111. # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
  112. # version check and doesn't really help with anything
  113. (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
  114. find ${S} -name "configure" | xargs touch
  115. CPPFLAGS="" oe_runconf
  116. }
  117. LDFLAGS += "-fuse-ld=bfd"
  118. do_compile () {
  119. base_do_compile
  120. echo "Adjust ldd script"
  121. if [ -n "${RTLDLIST}" ]
  122. then
  123. prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
  124. # remove duplicate entries
  125. newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)`
  126. echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
  127. sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
  128. fi
  129. }
  130. require glibc-package.inc
  131. BBCLASSEXTEND = "nativesdk"