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