blob: c6b2caad4232981cdc0b87cfb1ad25a9a53b1864 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001require glibc.inc
2
3LIC_FILES_CHKSUM = "file://LICENSES;md5=cfc0ed77a9f62fa62eded042ebe31d72 \
4 file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
5 file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
6 file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
7
8DEPENDS += "gperf-native bison-native make-native"
9
10PV = "2.29"
11
12SRCREV ?= "86013ef5cea322b8f4b9c22f230c22cce369e947"
13
14SRCBRANCH ?= "release/${PV}/master"
15
16GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
17UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
18
19NATIVESDKFIXES ?= ""
20NATIVESDKFIXES_class-nativesdk = "\
21 file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
22 file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
23 file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
24 file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
25 file://0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
26"
27
28SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
29 file://etc/ld.so.conf \
30 file://generate-supported.mk \
31 file://makedbs.sh \
32 \
33 ${NATIVESDKFIXES} \
34 file://0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
35 file://0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
36 file://0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
37 file://0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
38 file://0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
39 file://0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
40 file://0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
41 file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
42 file://0014-Add-unused-attribute.patch \
43 file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
44 file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
45 file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
46 file://0018-eglibc-Cross-building-and-testing-instructions.patch \
47 file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
48 file://0020-eglibc-Clear-cache-lines-on-ppc8xx.patch \
49 file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \
50 file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
51 file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
52 file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
53 file://0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
54 file://0028-intl-Emit-no-lines-in-bison-generated-files.patch \
55 file://0029-inject-file-assembly-directives.patch \
56 file://0030-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
57 file://0001-x86-64-memcmp-Use-unsigned-Jcc-instructions-on-size-.patch \
58 file://CVE-2019-9169.patch \
59"
60
61S = "${WORKDIR}/git"
62B = "${WORKDIR}/build-${TARGET_SYS}"
63
64PACKAGES_DYNAMIC = ""
65
66# the -isystem in bitbake.conf screws up glibc do_stage
67BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
68TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
69
70GLIBC_BROKEN_LOCALES = ""
71
72GLIBCPIE ??= ""
73
74EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
75 --disable-profile \
76 --disable-debug --without-gd \
77 --enable-clocale=gnu \
78 --with-headers=${STAGING_INCDIR} \
79 --without-selinux \
80 --enable-tunables \
81 --enable-bind-now \
82 --enable-stack-protector=strong \
83 --enable-stackguard-randomization \
84 --disable-crypt \
85 --with-default-link \
86 --enable-nscd \
87 ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
88 ${GLIBCPIE} \
89 ${GLIBC_EXTRA_OECONF}"
90
91EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
92
93do_patch_append() {
94 bb.build.exec_func('do_fix_readlib_c', d)
95}
96
97do_fix_readlib_c () {
98 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
99}
100
101do_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
111do_compile () {
112 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
Brad Bishopc342db32019-05-15 21:57:59 -0400113 LDFLAGS="-fuse-ld=bfd"
Brad Bishop19323692019-04-05 15:28:33 -0400114 base_do_compile
115 echo "Adjust ldd script"
116 if [ -n "${RTLDLIST}" ]
117 then
118 prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
119 # remove duplicate entries
120 newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)`
121 echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
122 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
123 fi
Brad Bishop19323692019-04-05 15:28:33 -0400124}
125
126require glibc-package.inc
127
128BBCLASSEXTEND = "nativesdk"