blob: d07293925472699e10e615f03273cae62ac8efe0 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001require 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
10SRCREV ?= "044c96f0d5595aeb0bb4e79355081c5a7f4faca5"
11
12SRCBRANCH ?= "release/${PV}/master"
13
14GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
15UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.(?!90)\d+)*)"
16
17SRC_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://0006-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
24 file://0007-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
25 file://0008-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
26 file://0009-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
27 file://0010-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
28 file://0011-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
29 file://0012-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
30 file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
31 file://0014-Add-unused-attribute.patch \
32 file://0015-yes-within-the-path-sets-wrong-config-variables.patch \
33 file://0016-timezone-re-written-tzselect-as-posix-sh.patch \
34 file://0017-Remove-bash-dependency-for-nscd-init-script.patch \
35 file://0018-eglibc-Cross-building-and-testing-instructions.patch \
36 file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \
37 file://0020-eglibc-Clear-cache-lines-on-ppc8xx.patch \
38 file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \
39 file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
40 file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
41 file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \
42 file://0025-locale-fix-hard-coded-reference-to-gcc-E.patch \
43 file://0026-reset-dl_load_write_lock-after-forking.patch \
44 file://0027-Acquire-ld.so-lock-before-switching-to-malloc_atfork.patch \
45 file://0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch \
46 file://0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
47 file://0030-intl-Emit-no-lines-in-bison-generated-files.patch \
48 file://0031-sysdeps-ieee754-prevent-maybe-uninitialized-errors-w.patch \
49 file://0032-sysdeps-ieee754-soft-fp-ignore-maybe-uninitialized-w.patch \
50 file://0033-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \
51 file://0034-inject-file-assembly-directives.patch \
52"
53
54NATIVESDKFIXES ?= ""
55NATIVESDKFIXES_class-nativesdk = "\
56 file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
57 file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
58 file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
59 file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
60 file://0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
61"
62
63S = "${WORKDIR}/git"
64B = "${WORKDIR}/build-${TARGET_SYS}"
65
66PACKAGES_DYNAMIC = ""
67
68# the -isystem in bitbake.conf screws up glibc do_stage
69BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
70TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
71
72GLIBC_BROKEN_LOCALES = ""
73#
74# We will skip parsing glibc when target system C library selection is not glibc
75# this helps in easing out parsing for non-glibc system libraries
76#
77COMPATIBLE_HOST_libc-musl_class-target = "null"
78
79GLIBCPIE ??= ""
80
81EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
82 --disable-profile \
83 --disable-debug --without-gd \
84 --enable-clocale=gnu \
85 --with-headers=${STAGING_INCDIR} \
86 --without-selinux \
87 --enable-tunables \
88 --enable-bind-now \
89 --enable-stack-protector=strong \
90 --enable-stackguard-randomization \
91 --disable-crypt \
92 ${GLIBCPIE} \
93 ${GLIBC_EXTRA_OECONF}"
94
95EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
96EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', '--enable-nscd', '--disable-nscd', d)}"
97
98
99do_patch_append() {
100 bb.build.exec_func('do_fix_readlib_c', d)
101}
102
103do_fix_readlib_c () {
104 sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
105}
106
107do_configure () {
108# override this function to avoid the autoconf/automake/aclocal/autoheader
109# calls for now
110# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
111# version check and doesn't really help with anything
112 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
113 find ${S} -name "configure" | xargs touch
114 CPPFLAGS="" oe_runconf
115}
116
117do_compile () {
118 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
119 unset LDFLAGS
120 base_do_compile
121 echo "Adjust ldd script"
122 if [ -n "${RTLDLIST}" ]
123 then
124 prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
125 if [ "${prevrtld}" != "${RTLDLIST}" ]
126 then
127 sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
128 fi
129 fi
130
131}
132
133require glibc-package.inc
134
135BBCLASSEXTEND = "nativesdk"