5 #add the hosts that are confirmed to be working to COMPATIBLE_HOSTi
6 COMPATIBLE_HOST = '(i.86.*-linux|sh.*-linux)'
7 DEFAULT_PREFERENCE_arm = "-1"
9 # the -isystem in bitbake.conf screws up glibc do_stage
10 BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
11 TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${layout_includedir}"
14 FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/glibc-2.4"
16 GLIBC_ADDONS ?= "ports,nptl,libidn"
18 GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN"
21 # For now, we will skip building of a gcc package if it is a uclibc one
22 # and our build is not a uclibc one, and we skip a glibc one if our build
25 # See the note in gcc/gcc_3.4.0.oe
28 python __anonymous () {
30 uc_os = (re.match('.*uclibc$', bb.data.getVar('TARGET_OS', d, 1)) != None)
32 raise bb.parse.SkipPackage("incompatible with target %s" %
33 bb.data.getVar('TARGET_OS', d, 1))
36 RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
37 RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
39 # file://noinfo.patch;patch=1
40 # file://ldconfig.patch;patch=1;pnum=0
41 # file://arm-machine-gmon.patch;patch=1;pnum=0 \
43 # file://arm-ioperm.patch;patch=1;pnum=0 \
44 # file://ldd.patch;patch=1;pnum=0 \
45 SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.4.tar.bz2 \
46 ftp://ftp.gnu.org/pub/gnu/glibc/glibc-ports-2.4.tar.bz2 \
47 ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-2.4.tar.bz2 \
48 file://arm-memcpy.patch;patch=1 \
49 file://arm-longlong.patch;patch=1 \
50 file://fhs-linux-paths.patch;patch=1 \
51 file://dl-cache-libcmp.patch;patch=1 \
52 file://ldsocache-varrun.patch;patch=1 \
53 file://nptl-crosscompile.patch;patch=1 \
54 file://glibc-2.4-compile.patch;patch=1 \
55 file://glibc-2.4-openat-3.patch;patch=1 \
56 file://fixup-aeabi-syscalls.patch;patch=1 \
57 file://zecke-sane-readelf.patch;patch=1 \
58 file://arm_eabi_ipc_fix.patch;patch=1 \
59 file://generic-bits_select.h \
60 file://generic-bits_types.h \
61 file://generic-bits_typesizes.h \
62 file://generic-bits_time.h \
63 file://etc/ld.so.conf \
64 file://generate-supported.mk"
67 # Build fails on sh3 and sh4 without additional patches
68 SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
69 SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
71 S = "${WORKDIR}/glibc-2.4"
72 B = "${WORKDIR}/build-${TARGET_SYS}"
74 EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
75 --without-cvs --disable-profile --disable-debug --without-gd \
76 --enable-clocale=gnu \
77 --enable-add-ons=${GLIBC_ADDONS} \
78 --with-headers=${STAGING_INCDIR} \
80 ${GLIBC_EXTRA_OECONF}"
82 EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
85 # Integrate ports and libidn into tree
86 mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports
87 mv ${WORKDIR}/glibc-libidn-${PV} ${S}/libidn
89 # Ports isn't really working... Fix it
90 # Some of this is rather dirty, but it seems to be the only
91 # quick way to get this cruft to compile
92 rm -rf ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
93 ln -s nptl ${S}/ports/sysdeps/unix/sysv/linux/arm/linuxthreads
94 cp ${S}/sysdeps/unix/sysv/linux/i386/bits/wchar.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
95 cp ${S}/sysdeps/wordsize-32/bits/wordsize.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
96 cp ${WORKDIR}/generic-bits_select.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/select.h
97 cp ${WORKDIR}/generic-bits_types.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/types.h
98 cp ${WORKDIR}/generic-bits_typesizes.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/typesizes.h
99 cp ${WORKDIR}/generic-bits_time.h ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/time.h
100 # Copy in generic stuff for not yet implemented headers
101 for i in ${S}/bits/*.h; do
103 [ "$F" = "local_lim.h" ] && continue
104 [ "$F" = "errno.h" ] && continue
105 test -e ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/$F || test -e ${S}/ports/sysdeps/arm/bits/$F || test -e ${S}/sysdeps/unix/sysv/linux/bits/$F || test -e ${S}/sysdeps/ieee754/bits/$F || cp $i ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/
107 # This is harmful; we need to get the one from nptl/sysdeps/pthreads
108 rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/libc-lock.h
109 # Obsoleted by sysdeps/arm/{fpu,eabi}/bits/fenv.h
110 rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/fenv.h
111 # Obsoleted by sysdeps/gnu/bits/utmp.h
112 rm -f ${S}/ports/sysdeps/unix/sysv/linux/arm/bits/utmp.h
115 addtask munge before do_patch after do_unpack
118 # override this function to avoid the autoconf/automake/aclocal/autoheader
120 # don't pass CPPFLAGS into configure, since it upsets the kernel-headers
121 # version check and doesn't really help with anything
122 if [ -z "`which rpcgen`" ]; then
123 echo "rpcgen not found. Install glibc-devel."
126 (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
127 CPPFLAGS="" oe_runconf
130 rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
131 yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
132 rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
135 # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
139 cd ${S}/sunrpc/rpcsvc
140 for r in ${rpcsvc}; do
141 h=`echo $r|sed -e's,\.x$,.h,'`
142 rpcgen -h $r -o $h || oewarn "unable to generate header for $r"
147 require glibc-stage.inc
149 require glibc-package.inc