diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-05-22 12:02:12 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-23 15:53:16 +0100 |
commit | ac60a936e737680c16b287a3dab6aa285d87c5c0 (patch) | |
tree | 3ba87af4e38641def4f2ec974cc28c196c50f50e /meta/recipes-core/uclibc/uclibc.inc | |
parent | 65f1109faf9548c5d083089561d5b9d99dbacc83 (diff) | |
download | openembedded-core-ac60a936e737680c16b287a3dab6aa285d87c5c0.tar.gz openembedded-core-ac60a936e737680c16b287a3dab6aa285d87c5c0.tar.bz2 openembedded-core-ac60a936e737680c16b287a3dab6aa285d87c5c0.zip |
uclibc: Upgrade to 0.9.32-rc3
Bring in the uclibc recipes from meta-oe they have been well
tested by now.
Delete 0.9.30.1 recipes
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta/recipes-core/uclibc/uclibc.inc')
-rw-r--r-- | meta/recipes-core/uclibc/uclibc.inc | 284 |
1 files changed, 154 insertions, 130 deletions
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc index 5e87cf9550..e7d8846738 100644 --- a/meta/recipes-core/uclibc/uclibc.inc +++ b/meta/recipes-core/uclibc/uclibc.inc @@ -1,6 +1,6 @@ SUMMARY = "C library for embedded systems" -DESCRIPTION = "The name uClibc is an abbreviation for 'the \ -microcontroller C library'. For simplicity, uClibc is pronounced \ +DESCRIPTION = "The name uClibc is an abbreviation for 'the \ +microcontroller C library'. For simplicity, uClibc is pronounced \ 'yew-see-lib-see'. The goal of uClibc is to provide as much \ functionality as possible in a small amount of space, and it is intended \ primarily for embedded use. It is also highly configurable in supported \ @@ -11,6 +11,30 @@ embedded Linux. It is NOT compatible with binaries linked against glibc." LICENSE = "LGPL" SECTION = "libs" PRIORITY = "required" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \ + file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \ +file://${S}/test/regex/testregex.c;startline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960" +INC_PR = "r2" + +require uclibc-config.inc +STAGINGCC = "gcc-cross-intermediate" +STAGINGCC_virtclass-nativesdk = "gcc-crosssdk-intermediate" +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:" + +TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}" + +# siteconfig.bbclass runs configure which needs a working compiler +# For the compiler to work we need a working libc yet libc isn't +# in the sysroots directory at this point. This means the libc.so +# linker script won't work as the --sysroot setting isn't correct. +# Here we create a hacked up libc linker script and pass in the right +# flags to let configure work. Ugly. +EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'" +siteconfig_do_siteconfig_gencache_prepend = " \ +mkdir -p ${WORKDIR}/site_config_libc; \ +cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \ +sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \ +" # # For now, we will skip building of a gcc package if it is a uclibc one @@ -27,165 +51,165 @@ python __anonymous () { raise bb.parse.SkipPackage("incompatible with target %s" % bb.data.getVar('TARGET_OS', d, 1)) } - PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc" -PROVIDES += "${@['virtual/libiconv', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']}" DEPENDS = "virtual/${TARGET_PREFIX}binutils \ - virtual/${TARGET_PREFIX}gcc-intermediate linux-libc-headers ncurses-native pax-utils-native" + virtual/${TARGET_PREFIX}gcc-intermediate \ + linux-libc-headers ncurses-native" RDEPENDS_${PN}-dev = "linux-libc-headers-dev" -# Blackfin needs a wrapper around ld -#DEPENDS_append_bfin = " elf2flt " - INHIBIT_DEFAULT_DEPS = "1" -PARALLEL_MAKE = "" -PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db" +PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace" LEAD_SONAME = "libc.so" -# The last line (gdb and lib1) is for uclinux-uclibc builds +# The last line (gdb and lib1) is for uclinux-uclibc builds uclibc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so \ - ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \ - ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \ - ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \ - ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so \ - ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \ + ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \ + ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \ + ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \ + ${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \ + ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \ ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so \ - ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \ + ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \ ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so \ - ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so \ + ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so \ ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so \ ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \ - " + " FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \ - ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale" + ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale" FILES_ldd = "${bindir}/ldd" -FILES_uclibc-dev += "${libdir}/*.o" +FILES_uclibc-dev_append = "\ + ${libdir}/lib*.so \ + ${libdir}/*_nonshared.a \ + ${libdir}/[S]*crt[1in].o \ + ${libdir}/crtreloc*.o \ + ${libdir}/lib*.a \ + ${includedir}/*.h ${includedir}/*/*.h \ + " FILES_uclibc-utils = "${bindir} ${sbindir}" FILES_uclibc-utils-dbg += "${bindir}/.debug ${sbindir}/.debug" FILES_uclibc-gconv = "${libdir}/gconv" -FILES_uclibc-thread-db = "/lib/libthread_db*" -RPROVIDES_uclibc-dev += "libc-dev" +FILES_uclibc-thread-db = "${base_libdir}/libthread_db*" +FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*" +FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*" + +RPROVIDES_uclibc-dev += "libc-dev virtual-libc-dev" +# uclibc does not really have libsegfault but then using the one from glibc is also not +# going to work. So we pretend that we have it to make bitbake not pull other recipes +# to satisfy this dependency for the images/tasks +RPROVIDES_${PN} += "libsegfault" + +SRC_URI = "\ + http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2;name=uClibc-${PV} \ + " + +# do_stage barfs on a CC with whitespace, therefore put the 'HOST_CC_ARCH' in +# the CFLAGS (when building the utils). +OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}'" +EXTRA_OEMAKE = "${OEMAKE_NO_CC} \ + 'HOSTCC=${BUILD_CC}' \ + 'HOST_CFLAGS=${BUILD_CFLAGS}' \ + 'CC=${CC}' \ + ARCH=${UCLIBC_ARCH}" -# -# This locale file gets copied into uClibc-${PV}/extra/locale/ prior to -# build, it does not need to be unpacked, but we can't inhibit the unpacking -# in the current build system. -# -UCLIBC_LOCALE_FILE = "uClibc-locale-030818.tgz" -UCLIBC_LOCALE_FILE_arm = "uClibc-locale-030818.arm.tgz" -UCLIBC_LOCALE_URI = "http://www.uclibc.org/downloads/${UCLIBC_LOCALE_FILE}" -UCLIBC_LOCALE_URI_arm = "http://wiki.openembedded.net/dl/uclibc-locale/${UCLIBC_LOCALE_FILE}" - -SRC_URI = "${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \ - file://uClibc.config \ - http://www.uclibc.org/downloads/uClibc-${PV}.tar.bz2 \ - " - -# do_stage barfs on a CC with whitepspace, therefore put the 'HOST_CC_ARCH' in -# the CFLAGS (for when building the utils). -OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}' \ - 'LOCALE_DATA_FILENAME=${UCLIBC_LOCALE_FILE}'" -EXTRA_OEMAKE = "${OEMAKE_NO_CC} 'CC=${CC}' \ - 'HOSTCFLAGS=-I${STAGING_INCDIR_NATIVE}' \ - ARCH=`grep TARGET_ARCH ${S}/.config|sed -e 's/TARGET_ARCH=//g'`" EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}" -KERNEL_SOURCE = "${STAGING_INCDIR}" -KERNEL_HEADERS = "${STAGING_INCDIR}" - -# Lets munge this via siteinfo.bbclass as well: -# ARCH_BIG_ENDIAN=y -# ARCH_WANTS_BIG_ENDIAN=y -# ARCH_WANTS_LITTLE_ENDIAN is not set - -# How to enable verbose logs: -#export VERBOSE="1" - -configmangle = 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE="${KERNEL_SOURCE}",g; \ - s,^KERNEL_HEADERS=.*,KERNEL_HEADERS="${KERNEL_HEADERS}",g; \ - s,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX="/",g; \ - s,^DEVEL_PREFIX=.*,DEVEL_PREFIX="/${prefix}",g; \ - s,^SHARED_LIB_LOADER_PATH=.*,SHARED_LIB_LOADER_PATH="/lib",; \ - s,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX="/lib",; \ - s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ - ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][bb.data.getVar("USE_NLS", d, 1) == "yes"]} \ - ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][bb.data.getVar("TARGET_ARCH", d, 1) in ['mips', 'mipsel', 'avr32']]} \ - ' - -CFLAGS := "${@oe_filter_out('-I\S+', '${CFLAGS}', d)}" +# enable verbose output: +export V="2" -python () { - if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]: - bb.data.setVar('configmangle_append', ' s,^HAS_FPU=y,# HAS_FPU is not set,;', d) +# -O<n> -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860 +# +CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}" +UCLIBC_EXTRA_CFLAGS := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}" +UCLIBC_EXTRA_LDFLAGS := "${@oe_filter_out('(-L\S+|-l\S+)', '${LDFLAGS}', d)}" +do_compile_prepend () { + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS } -uclibcbuild_do_patch() { - ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux - ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm - - ${@['cp %s/%s extra/locale' % (bb.data.getVar('DL_DIR', d, 1) or '', bb.data.getVar('UCLIBC_LOCALE_FILE', d, 1) or ''), ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} +configmangle = '/^KERNEL_HEADERS/d; \ + /^RUNTIME_PREFIX/d; \ + /^DEVEL_PREFIX/d; \ + /^SHARED_LIB_LOADER_PREFIX/d; \ + /^UCLIBC_EXTRA_CFLAGS/d; \ + s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \ + ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][bb.data.getVar("USE_NLS", d, 1) == "yes"]} \ + ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][bb.data.getVar("TARGET_ARCH", d, 1) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \ + /^CROSS/d; \ + /^TARGET_ARCH=/d; \ + /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \ + s,^DOSTRIP.*,# DOSTRIP is not set,g; \ + /_[EO]*ABI/d; \ + /HAS_FPU/d; \ + ' +OE_FEATURES := "${@features_to_uclibc_conf(d)}" +OE_DEL := "${@features_to_uclibc_del(d)}" +python () { + if "${OE_DEL}": + bb.data.setVar('configmangle_append', "${OE_DEL}" + "\n", d) + if "${OE_FEATURES}": + bb.data.setVar('configmangle_append', + "/^### DISTRO FEATURES$/a\\\n%s\n\n" % + ("\\n".join((bb.data.expand("${OE_FEATURES}", d).split("\n")))), + d) + bb.data.setVar('configmangle_append', + "/^### CROSS$/a\\\n%s\n" % + ("\\n".join(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"", + "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"", + "KERNEL_HEADERS=\"${STAGING_INCDIR}\"", + "RUNTIME_PREFIX=\"/\"", + "DEVEL_PREFIX=\"/${prefix}\"", + "SHARED_LIB_LOADER_PREFIX=\"/lib\"", + ]) + ), + d) + bb.data.setVar('configmangle_append', + "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" % + ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"), + d) + bb.data.setVar('configmangle_append', + "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]]), d) + if "${UCLIBC_ENDIAN}": + bb.data.setVar('configmangle_append', + "/^### ABI$/a\\\nARCH_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"), + d) + if "${UCLIBC_ABI}": + bb.data.setVar('configmangle_append', + "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}"), + d) } -python do_patch () { - bb.build.exec_func('base_do_patch', d) - bb.build.exec_func('uclibcbuild_do_patch', d) +do_patch_append() { + os.system("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux") + os.system("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm") } do_configure() { - rm -f ${S}/.config - - # For uClibc 0.9.29, OpenEmbedded splits the uClibc.config in two parts: - # uClibc.machine and uClibc.distro. So, if they exist use them, otherwise - # use a uClibc.config - if [ -f ${WORKDIR}/uClibc.machine -a -f ${WORKDIR}/uClibc.distro ]; then - echo "### uClibc.machine ###" >${S}/merged.config - cat ${WORKDIR}/uClibc.machine >>${S}/merged.config - echo "### uClibc.distro ###" >>${S}/merged.config - cat ${WORKDIR}/uClibc.distro >>${S}/merged.config - else - echo "### uClibc.config ###" >${S}/merged.config - cat ${WORKDIR}/uClibc.config >>${S}/merged.config - fi - cp ${S}/merged.config ${S}/.config - - # Mangle the resulting .config depending on OE variables - perl -i -p -e 's,^CROSS=.*,TARGET_ARCH=${TARGET_ARCH}\nCROSS=${TARGET_PREFIX},g' ${S}/Rules.mak - sed -i -e s:'$(CROSS)strip':true: ${S}/Rules.mak - perl -i -p -e '${configmangle}' ${S}/.config - - sed -i -e '/CONFIG_ARM_EABI/d' ${S}/.config - - if [ `echo ${TARGET_ARCH} | grep -e '^arm'` ]; then - if [ `echo ${TARGET_OS} | grep -e 'eabi$'` ]; then - echo "CONFIG_ARM_EABI=y" >> ${S}/.config - else - echo "# CONFIG_ARM_EABI is not set" >> ${S}/.config - fi - fi - yes '' | oe_runmake oldconfig + rm -f ${S}/.config + + # OpenEmbedded splits the uClibc.config in two parts: + # uClibc.machine, uClibc.distro + echo "### uClibc.machine ###" >${S}/merged.config + cat ${WORKDIR}/uClibc.machine >>${S}/merged.config + echo "### uClibc.distro ###" >>${S}/merged.config + cat ${WORKDIR}/uClibc.distro >>${S}/merged.config + echo "### CROSS" >>${S}/merged.config + echo "### TGT" >>${S}/merged.config + echo "### MMU" >>${S}/merged.config + echo "### FPU" >>${S}/merged.config + echo "### ABI" >>${S}/merged.config + echo "### DISTRO FEATURES" >>${S}/merged.config + cp ${S}/merged.config ${S}/.config + + # Mangle the resulting .config depending on OE variables + sed -i -e '${configmangle}' ${S}/.config + + oe_runmake oldconfig } do_install() { - oe_runmake PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ - install_dev install_runtime - - # Need to overwrite the version from -initial - if [ ! -e ${D}${libdir}/libc.so ]; then - ln -s ../../lib/libc.so.0 ${D}${libdir}/libc.so - fi - - # We don't really need this in ${includedir} - rm -f ${D}${prefix}/include/.cvsignore - - # This conflicts with the c++ version of this header - rm -f ${D}${prefix}/include/bits/atomicity.h - - oe_runmake "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" utils - oe_runmake STRIPTOOL=true PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ - install_utils - - # oe_runstrip needs +x on files - chmod +x ${D}/${base_libdir}/* + oe_runmake PREFIX=${D} install + oe_runmake PREFIX=${D} "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" install_utils } |