glibc: adapt from Yocto Project eglibc recipes
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 15 Feb 2013 08:55:52 +0000 (08:55 +0000)
committerPaul Eggleton <paul.eggleton@linux.intel.com>
Fri, 15 Feb 2013 10:24:28 +0000 (10:24 +0000)
27 files changed:
meta-tizen/recipes-BaseSystem/glibc/cross-localedef-native_git.bb [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glib-extraconf.inc [deleted file]
meta-tizen/recipes-BaseSystem/glibc/glibc-collateral.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-common.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-extraconf.inc [deleted file]
meta-tizen/recipes-BaseSystem/glibc/glibc-initial.inc
meta-tizen/recipes-BaseSystem/glibc/glibc-initial_git.bb
meta-tizen/recipes-BaseSystem/glibc/glibc-ld.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-locale.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-locale_git.bb [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-options.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-package.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc-testing.inc [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/glibc.inc
meta-tizen/recipes-BaseSystem/glibc/glibc_git.bb
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/32and64bit.patch [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/README [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/endianess-header.patch [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/flag_fix.patch [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig.patch [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch [deleted file]
meta-tizen/recipes-BaseSystem/glibc/ldconfig-native_2.12.1.bb [deleted file]
meta-tizen/recipes-BaseSystem/glibc/site_config/funcs [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/site_config/headers [new file with mode: 0644]
meta-tizen/recipes-BaseSystem/glibc/site_config/types [new file with mode: 0644]

diff --git a/meta-tizen/recipes-BaseSystem/glibc/cross-localedef-native_git.bb b/meta-tizen/recipes-BaseSystem/glibc/cross-localedef-native_git.bb
new file mode 100644 (file)
index 0000000..f92680f
--- /dev/null
@@ -0,0 +1,49 @@
+DESCRIPTION = "Cross locale generation tool for glibc"
+HOMEPAGE = "http://www.glibc.org/home"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+
+LIC_DIR = "${WORKDIR}/glibc-${PV}/libc"
+LIC_FILES_CHKSUM = "file://${LIC_DIR}/LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+      file://${LIC_DIR}/COPYING;md5=393a5ca445f6965873eca0259a17f833 \
+      file://${LIC_DIR}/posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://${LIC_DIR}/COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
+
+
+inherit native
+inherit autotools
+
+# pick up an glibc patch
+FILESPATH = "${FILE_DIRNAME}/glibc-${PV}"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/glibc/glibc-${PV}-svnr22064.tar.bz2 \
+          file://fix_for_centos_5.8.patch;patchdir=.. \
+         "
+SRC_URI[md5sum] = "1464af54779c2c7d1078df9ce2e41791"
+SRC_URI[sha256sum] = "97c3991a3772f513cf704841d20c275ac48895fad2e27802dda557c0196cba6b"
+
+S = "${WORKDIR}/glibc-${PV}/localedef"
+
+do_unpack_append() {
+    bb.build.exec_func('do_move_ports', d)
+}
+
+do_move_ports() {
+        if test -d ${WORKDIR}/glibc-${PV}/ports ; then
+           rm -rf ${WORKDIR}/libc/ports
+           mv ${WORKDIR}/glibc-${PV}/ports ${WORKDIR}/libc/
+       fi
+}
+
+EXTRA_OECONF = "--with-glibc=${WORKDIR}/glibc-${PV}/libc"
+CFLAGS += "-DNOT_IN_libc=1"
+
+do_configure () {
+       ./configure ${EXTRA_OECONF}
+}
+
+
+do_install() {
+       install -d ${D}${bindir} 
+       install -m 0755 ${S}/localedef ${D}${bindir}/cross-localedef
+}
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glib-extraconf.inc b/meta-tizen/recipes-BaseSystem/glibc/glib-extraconf.inc
deleted file mode 100644 (file)
index 3b75edf..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-inherit insane
-inherit package
-#inherit autotools
-inherit libc-common
-
-DEPENDS += "linux-libc-headers"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc-initial"
-
-STAGINGCC = "gcc-cross-initial"
-PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
-
-
-DEPENDS += "linux-libc-headers"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-
-base_libdir = "/lib64"
-
-
-# to test
-PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
-PROVIDES += "virtual/libintl virtual/libiconv"
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-collateral.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-collateral.inc
new file mode 100644 (file)
index 0000000..b770bb0
--- /dev/null
@@ -0,0 +1,11 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "GPLv2 & LGPLv2.1"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
+
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-common.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-common.inc
new file mode 100644 (file)
index 0000000..e99603f
--- /dev/null
@@ -0,0 +1,9 @@
+SUMMARY = "Embedded GLIBC (GNU C Library)"
+DESCRIPTION = "Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC) that is designed to work well on embedded systems. EGLIBC strives to be source and binary compatible with GLIBC. EGLIBC's goals include reduced footprint, configurable components, better support for cross-compilation and cross-testing."
+HOMEPAGE = "http://www.glibc.org/home"
+SECTION = "libs"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
+      file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-extraconf.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-extraconf.inc
deleted file mode 100644 (file)
index 3a8e9d5..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-inherit insane
-inherit package
-#inherit autotools
-inherit libc-common
-
-DEPENDS += "linux-libc-headers"
-DEPENDS += "virtual/${TARGET_PREFIX}gcc-initial"
-
-STAGINGCC = "gcc-cross-initial"
-PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
-
-
-DEPENDS += "linux-libc-headers"
-
-RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
-
-base_libdir = "/lib64"
-
-
-# to test
-PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
-PROVIDES += "virtual/libintl virtual/libiconv"
-
-LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
-
-INHIBIT_DEFAULT_DEPS = "1"
-
-# default to disabled until qemu works for everyone
-ENABLE_BINARY_LOCALE_GENERATION ?= "0"
-ENABLE_BINARY_LOCALE_GENERATION_pn-glibc-nativesdk = "0"
-
-PKGSUFFIX = ""
-PKGSUFFIX_virtclass-nativesdk = "-nativesdk"
-
-BBCLASSEXTEND =+ "nativesdk"
-
-RPROVIDES += "libsegfault"
-RPROVIDES += "glibc-dbg"
-RPROVIDES += "glibc-dev"
-RPROVIDES += 'glibc-thread-db'
-RPROVIDES += 'glibc-localedata-i18n'
-RPROVIDES += 'glibc-gconv-ibm850'
-RPROVIDES += 'glibc-gconv-cp1252'
-RPROVIDES += 'glibc-gconv-iso8859-1'
-RPROVIDES += 'glibc-gconv-iso8859-15'
-
-DEPENDS = ""
-#DEPENDS of glibc 
-DEPENDS += "fdupes-native"
-DEPENDS += "makeinfo-native"
-DEPENDS += "xz-native"
-DEPENDS += "gcc-cross"
-DEPENDS += "gettext-tools-native"
-DEPENDS += "libstdc++"
index d3dcdc4..0695b89 100644 (file)
@@ -1,52 +1,80 @@
-SECTION = "libs"
-DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers"
+require glibc-common.inc
+
+DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial"
 PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
 
 PACKAGES = ""
 PACKAGES_DYNAMIC = ""
 
+STAGINGCC = "gcc-cross-initial"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
+
 do_configure () {
-        sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure
-        chmod +x ${S}/configure
+       sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure
+       chmod +x ${S}/configure
+        (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
         find ${S} -name "configure" | xargs touch
-        ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
-                --without-cvs --disable-sanity-checks \
-                --with-headers=${STAGING_DIR_TARGET}${includedir} \
-                --enable-hacker-mode
-        if grep -q GLIBC_2.3 ${S}/ChangeLog; then
-                # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c, which fails without a real cross-compiler.
-                # Fortunately, we don't need errlist-compat.c, since we just need .h files,
-                # so work around this by creating a fake errlist-compat.c and satisfying its dependencies.
-                # Another workaround might be to tell configure to not use any cross options to $(CC).
-                # The real fix would be to get install-headers to not generate errlist-compat.c.
-                make sysdeps/gnu/errlist.c
-                mkdir -p stdio-common
-                touch stdio-common/errlist-compat.c
-        fi
+       ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
+               --prefix=/usr \
+               --without-cvs --disable-sanity-checks \
+               --with-headers=${STAGING_DIR_TARGET}${includedir} \
+               --with-kconfig=${STAGING_BINDIR_NATIVE} \
+               --enable-hacker-mode --enable-addons
 }
 
 do_compile () {
-        :
+       :
 }
 
 do_install () {
-        oe_runmake cross-compiling=yes install_root=${D} \
-        includedir='${includedir}' prefix='${prefix}' \
-        install-bootstrap-headers=yes install-headers
-
-        oe_runmake csu/subdir_lib
-        # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
-        # so do them by hand.  We can tolerate an empty stubs.h for the moment.
-        # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
-        mkdir -p ${D}${includedir}/gnu/
-        touch ${D}${includedir}/gnu/stubs.h
-        cp ${S}/include/features.h ${D}${includedir}/features.h
-
-        if [ -e ${B}/bits/stdio_lim.h ]; then
-                cp ${B}/bits/stdio_lim.h  ${D}${includedir}/bits/
-        fi
-        mkdir -p ${D}${libdir}/
-        install -m 644 csu/crt[1in].o ${D}${libdir}
-        ${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
-                -o ${D}${libdir}/libc.so
+       oe_runmake cross-compiling=yes install_root=${D} \
+       includedir='${includedir}' prefix='${prefix}' \
+       install-bootstrap-headers=yes install-headers
+
+       oe_runmake csu/subdir_lib
+       mkdir -p ${D}${libdir}/
+       install -m 644 csu/crt[1in].o ${D}${libdir}
+
+       # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
+       # so do them by hand.  We can tolerate an empty stubs.h for the moment.
+       # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
+       mkdir -p ${D}${includedir}/gnu/
+       touch ${D}${includedir}/gnu/stubs.h
+       cp ${S}/include/features.h ${D}${includedir}/features.h
+
+       if [ -e ${B}/bits/stdio_lim.h ]; then
+               cp ${B}/bits/stdio_lim.h  ${D}${includedir}/bits/
+       fi
+       # add links to linux-libc-headers: final glibc build need this.
+       for t in linux asm asm-generic; do
+               ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
+       done
+}
+
+do_install_locale() {
+       :
+}
+
+do_siteconfig () {
+       :
+}
+
+SSTATEPOSTINSTFUNCS += "glibcinitial_sstate_postinst"
+glibcinitial_sstate_postinst() {
+       if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+       then
+               # Recreate the symlinks to ensure they point to the correct location
+               for t in linux asm asm-generic; do
+                       rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t
+                       ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/
+               done
+       fi
+}
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+
+# We don't install any scripts so there is nothing to evacuate
+do_evacuate_scripts () {
+       :
 }
index d662970..8ab01dc 100644 (file)
@@ -1,6 +1,11 @@
 require glibc_${PV}.bb
 require glibc-initial.inc
 
-do_configure_prepend () {
-       unset CFLAGS
-}
+DEPENDS += "kconfig-frontends-native"
+
+# main glibc recipes muck with TARGET_CPPFLAGS to point into
+# final target sysroot but we
+# are not there when building glibc-initial
+# so reset it here
+
+TARGET_CPPFLAGS = ""
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-ld.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-ld.inc
new file mode 100644 (file)
index 0000000..a9f039b
--- /dev/null
@@ -0,0 +1,54 @@
+def glibc_ld_append_if_tune_exists(d, infos, dict):
+    tune = d.getVar("DEFAULTTUNE", True) or ""
+    libdir = d.getVar("base_libdir", True) or ""
+    if dict.has_key(tune):
+        infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
+        infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
+
+def glibc_dl_info(d):
+    ld_info_all = {
+        "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
+        "core2": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+        "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+        "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+        "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+        "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+    }
+
+    infos = {'ldconfig':set(), 'lddrewrite':set()}
+    glibc_ld_append_if_tune_exists(d, infos, ld_info_all)
+
+    #DEFAULTTUNE_MULTILIB_ORIGINAL
+    original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
+    if original_tune:
+        localdata = bb.data.createCopy(d)
+        localdata.setVar("DEFAULTTUNE", original_tune)
+        glibc_ld_append_if_tune_exists(localdata, infos, ld_info_all)
+
+    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    for item in variants.split():
+        localdata = bb.data.createCopy(d)
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+        localdata.setVar("OVERRIDES", overrides)
+        bb.data.update_data(localdata)
+        glibc_ld_append_if_tune_exists(localdata, infos, ld_info_all)
+    infos['ldconfig'] = ','.join(infos['ldconfig'])
+    infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
+    return infos
+
+EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}"
+RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}"
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-locale.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-locale.inc
new file mode 100644 (file)
index 0000000..825302f
--- /dev/null
@@ -0,0 +1,84 @@
+include glibc-collateral.inc
+
+BPN = "glibc"
+LOCALEBASEPN = "${MLPREFIX}glibc"
+
+# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
+# is set. The idea is to avoid running localedef on the target (at first boot)
+# to decrease initial boot time and avoid localedef being killed by the OOM
+# killer which used to effectively break i18n on machines with < 128MB RAM.
+
+# default to disabled 
+ENABLE_BINARY_LOCALE_GENERATION ?= "0"
+ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "0"
+
+#enable locale generation on these arches
+# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
+BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64 powerpc mips mips64"
+
+# set "1" to use cross-localedef for locale generation
+# set "0" for qemu emulation of native localedef for locale generation
+LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
+
+PROVIDES = "virtual/libc-locale"
+
+PACKAGES = "localedef ${PN}-dbg"
+
+PACKAGES_DYNAMIC = "^locale-base-.* \
+                    ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
+                    ^glibc-gconv-.*  ^glibc-charmap-.*  ^glibc-localedata-.*  ^glibc-binary-localedata-.*"
+
+# Create a glibc-binaries package
+ALLOW_EMPTY_${BPN}-binaries = "1"
+PACKAGES += "${BPN}-binaries"
+RRECOMMENDS_${BPN}-binaries =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-binary") != -1])}"
+
+# Create a glibc-charmaps package
+ALLOW_EMPTY_${BPN}-charmaps = "1"
+PACKAGES += "${BPN}-charmaps"
+RRECOMMENDS_${BPN}-charmaps =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-charmap") != -1])}"
+
+# Create a glibc-gconvs package
+ALLOW_EMPTY_${BPN}-gconvs = "1"
+PACKAGES += "${BPN}-gconvs"
+RRECOMMENDS_${BPN}-gconvs =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-gconv") != -1])}"
+
+# Create a glibc-localedatas package
+ALLOW_EMPTY_${BPN}-localedatas = "1"
+PACKAGES += "${BPN}-localedatas"
+RRECOMMENDS_${BPN}-localedatas =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-localedata") != -1])}"
+
+DESCRIPTION_localedef = "glibc: compile locale definition files"
+
+# glibc-gconv is dynamically added into PACKAGES, thus
+# FILES_glibc-gconv will not be automatically extended in multilib.
+# Explicitly add ${MLPREFIX} for FILES_glibc-gconv.
+FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
+FILES_${PN}-dbg += "${libdir}/gconv/.debug/*"
+FILES_localedef = "${bindir}/localedef"
+
+LOCALETREESRC = "${STAGING_INCDIR}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}"
+
+do_install () {
+       mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir} ${D}${localedir}
+       if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
+               cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
+       fi
+       if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then
+               cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
+       fi
+       if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
+               cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
+       fi
+       if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
+               cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
+       fi
+       if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
+               cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
+       fi
+       cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
+}
+
+inherit libc-package
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-locale_git.bb b/meta-tizen/recipes-BaseSystem/glibc/glibc-locale_git.bb
new file mode 100644 (file)
index 0000000..f7702e0
--- /dev/null
@@ -0,0 +1 @@
+require glibc-locale.inc
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-options.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-options.inc
new file mode 100644 (file)
index 0000000..a17a255
--- /dev/null
@@ -0,0 +1,129 @@
+def glibc_cfg(feature, features, tokens, cnf):
+    if type(tokens) == type(""):
+        tokens = [tokens]
+    if type(features) == type([]) and feature in features:
+        cnf.extend([token + '=y' for token in tokens])
+    else:
+        for token in tokens:
+            cnf.extend([token + '=n'])
+            if token == 'OPTION_EGLIBC_NSSWITCH':
+                cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf"])
+                cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions"])
+
+# arrange the dependencies among glibc configuable options according to file option-groups.def from glibc source code
+def glibc_distro_features_check_deps(distro_features):
+    new_dep = True
+    while new_dep:
+        new_dep = False
+
+        if 'ipv6' in distro_features and 'ipv4' not in distro_features:
+            new_dep = True
+            distro_features.extend(['ipv4'])
+
+        if 'ipv4' in distro_features and 'libc-nsswitch' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-nsswitch'])
+
+        if 'libc-cxx-tests' in distro_features:
+            if 'libc-posix-wchar-io' not in distro_features:
+                new_dep = True
+                distro_features.extend(['libc-posix-wchar-io'])
+            if 'libc-libm' not in distro_features:
+                new_dep = True
+                distro_features.extend(['libc-libm'])
+
+        if 'libc-catgets' in distro_features and 'libc-locale-code' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-locale-code'])
+
+        if 'libc-crypt-ufc' in distro_features and 'libc-crypt' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-crypt'])
+
+        if 'libc-getlogin' in distro_features and 'libc-utmp' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-utmp'])
+
+        if 'libc-inet-anl' in distro_features and 'ipv4' not in distro_features:
+            new_dep = True
+            distro_features.extend(['ipv4'])
+
+        if 'libc-locale-code' in distro_features and 'libc-posix-clang-wchar' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-posix-clang-wchar'])
+
+        if 'libc-nis' in distro_features:
+            if 'ipv4' not in distro_features:
+                new_dep = True
+                distro_features.extend(['ipv4'])
+            if 'libc-sunrpc' not in distro_features:
+                new_dep = True
+                distro_features.extend(['libc-sunrpc'])
+
+        if 'libc-rcmd' in distro_features and 'ipv4' not in distro_features:
+            new_dep = True
+            distro_features.extend(['ipv4'])
+
+        if 'libc-sunrpc' in distro_features and 'ipv4' not in distro_features:
+            new_dep = True
+            distro_features.extend(['ipv4'])
+
+        if 'libc-utmpx' in distro_features and 'libc-utmp' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-utmp'])
+
+        if 'libc-posix-regexp-glibc' in distro_features and 'libc-posix-regexp' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-posix-regexp'])
+
+        if 'libc-posix-wchar-io' in distro_features and 'libc-posix-clang-wchar' not in distro_features:
+            new_dep = True
+            distro_features.extend(['libc-posix-clang-wchar'])
+
+# Map distro features to glibc options settings
+def features_to_glibc_settings(d):
+        cnf = ([])
+        distro_features = (d.getVar('DISTRO_FEATURES', True) or '').split()
+
+        glibc_distro_features_check_deps(distro_features)
+
+        glibc_cfg('ipv6',      distro_features, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
+        glibc_cfg('libc-backtrace',      distro_features, 'OPTION_EGLIBC_BACKTRACE', cnf)
+        glibc_cfg('libc-big-macros',      distro_features, 'OPTION_EGLIBC_BIG_MACROS', cnf)
+        glibc_cfg('libc-bsd',      distro_features, 'OPTION_EGLIBC_BSD', cnf)
+        glibc_cfg('libc-cxx-tests',      distro_features, 'OPTION_EGLIBC_CXX_TESTS', cnf)
+        glibc_cfg('libc-catgets',      distro_features, 'OPTION_EGLIBC_CATGETS', cnf)
+        glibc_cfg('libc-charsets',      distro_features, 'OPTION_EGLIBC_CHARSETS', cnf)
+        glibc_cfg('libc-crypt',      distro_features, 'OPTION_EGLIBC_CRYPT', cnf)
+        glibc_cfg('libc-crypt-ufc',      distro_features, 'OPTION_EGLIBC_CRYPT_UFC', cnf)
+        glibc_cfg('libc-db-aliases',      distro_features, 'OPTION_EGLIBC_DB_ALIASES', cnf)
+        glibc_cfg('libc-envz',      distro_features, 'OPTION_EGLIBC_ENVZ', cnf)
+        glibc_cfg('libc-fcvt',      distro_features, 'OPTION_EGLIBC_FCVT', cnf)
+        glibc_cfg('libc-fmtmsg',      distro_features, 'OPTION_EGLIBC_FMTMSG', cnf)
+        glibc_cfg('libc-fstab',      distro_features, 'OPTION_EGLIBC_FSTAB', cnf)
+        glibc_cfg('libc-ftraverse',      distro_features, 'OPTION_EGLIBC_FTRAVERSE', cnf)
+        glibc_cfg('libc-getlogin',      distro_features, 'OPTION_EGLIBC_GETLOGIN', cnf)
+        glibc_cfg('libc-idn',      distro_features, 'OPTION_EGLIBC_IDN', cnf)
+        glibc_cfg('ipv4',      distro_features, 'OPTION_EGLIBC_INET', cnf)
+        glibc_cfg('libc-inet-anl',      distro_features, 'OPTION_EGLIBC_INET_ANL', cnf)
+        glibc_cfg('libc-libm',      distro_features, 'OPTION_EGLIBC_LIBM', cnf)
+        glibc_cfg('libc-libm-big',      distro_features, 'OPTION_EGLIBC_LIBM_BIG', cnf)
+        glibc_cfg('libc-locales',      distro_features, 'OPTION_EGLIBC_LOCALES', cnf)
+        glibc_cfg('libc-locale-code',      distro_features, 'OPTION_EGLIBC_LOCALE_CODE', cnf)
+        glibc_cfg('libc-memusage',      distro_features, 'OPTION_EGLIBC_MEMUSAGE', cnf)
+        glibc_cfg('libc-nis',      distro_features, 'OPTION_EGLIBC_NIS', cnf)
+        glibc_cfg('libc-nsswitch',      distro_features, 'OPTION_EGLIBC_NSSWITCH', cnf)
+        glibc_cfg('libc-rcmd',      distro_features, 'OPTION_EGLIBC_RCMD', cnf)
+        glibc_cfg('libc-rtld-debug',      distro_features, 'OPTION_EGLIBC_RTLD_DEBUG', cnf)
+        glibc_cfg('libc-spawn',      distro_features, 'OPTION_EGLIBC_SPAWN', cnf)
+        glibc_cfg('libc-streams',      distro_features, 'OPTION_EGLIBC_STREAMS', cnf)
+        glibc_cfg('libc-sunrpc',      distro_features, 'OPTION_EGLIBC_SUNRPC', cnf)
+        glibc_cfg('libc-utmp',      distro_features, 'OPTION_EGLIBC_UTMP', cnf)
+        glibc_cfg('libc-utmpx',      distro_features, 'OPTION_EGLIBC_UTMPX', cnf)
+        glibc_cfg('libc-wordexp',      distro_features, 'OPTION_EGLIBC_WORDEXP', cnf)
+        glibc_cfg('libc-posix-clang-wchar',      distro_features, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf)
+        glibc_cfg('libc-posix-regexp',      distro_features, 'OPTION_POSIX_REGEXP', cnf)
+        glibc_cfg('libc-posix-regexp-glibc',      distro_features, 'OPTION_POSIX_REGEXP_GLIBC', cnf)
+        glibc_cfg('libc-posix-wchar-io',      distro_features, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf)
+
+        return "\n".join(cnf)
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-package.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-package.inc
new file mode 100644 (file)
index 0000000..b01c618
--- /dev/null
@@ -0,0 +1,132 @@
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+    import bb, re
+    uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
+    if uc_os:
+        raise bb.parse.SkipPackage("incompatible with target %s" %
+                                   d.getVar('TARGET_OS', True))
+}
+
+# Set this to zero if you don't want ldconfig in the output package
+USE_LDCONFIG ?= "1"
+
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+
+# The ld.so in this glibc supports the GNU_HASH
+RPROVIDES_${PN} += "rtld(GNU_HASH)"
+RPROVIDES_${PN}-mtrace += "libc-mtrace"
+libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
+
+FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}"
+FILES_ldd = "${bindir}/ldd"
+FILES_libsegfault = "${base_libdir}/libSegFault*"
+FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
+FILES_libmemusage = "${base_libdir}/libmemusage.so"
+FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
+FILES_sln = "/sbin/sln"
+FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
+FILES_libsotruss = "${libdir}/audit/sotruss-lib.so"
+FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev += "${bindir}/rpcgen ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
+FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
+FILES_nscd = "${sbindir}/nscd*"
+FILES_${PN}-mtrace = "${bindir}/mtrace"
+FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
+FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/audit/.debug"
+FILES_catchsegv = "${bindir}/catchsegv"
+RDEPENDS_catchsegv = "libsegfault"
+FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
+FILES_glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
+RPROVIDES_${PN}-dev += "libc-dev"
+RPROVIDES_${PN}-staticdev += "libc-staticdev"
+
+SUMMARY_sln = "The static ln."
+DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked.  sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
+SUMMARY_nscd = "Name service cache daemon"
+DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information.  It can damatically improvide performance with remote, such as NIS or NIS+, name services."
+SUMMARY_glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
+DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services."
+SUMMARY_ldd = "print shared library dependencies"
+DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
+SUMMARY_${PN}-utils = "Miscellaneous utilities provided by glibc"
+DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconf, locale, gencat, tzselect, zic, rpcinfo, ..."
+DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
+
+inherit libc-common multilib_header
+
+do_install_append () {
+       rm -f ${D}${sysconfdir}/localtime
+       rm -rf ${D}${localstatedir}
+
+       oe_multilib_header bits/syscall.h
+
+       if [ -f ${D}${bindir}/mtrace ]; then
+               sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
+       fi
+       rm -rf ${D}${includedir}/rpcsvc/rquota*
+       # Info dir listing isn't interesting at this point so remove it if it exists.
+       if [ -e "${D}${infodir}/dir" ]; then
+               rm -f ${D}${infodir}/dir
+       fi
+}
+
+do_install_locale () {
+       dest=${D}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+       install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
+       if [ "${base_libdir}" != "${libdir}" ]; then
+               cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
+       fi
+       if [ -e ${D}${bindir}/localedef ]; then
+               mv -f ${D}${bindir}/localedef ${dest}${bindir}
+       fi
+       if [ -e ${D}${libdir}/gconv ]; then
+               mv -f ${D}${libdir}/gconv ${dest}${libdir}
+       fi
+       if [ -e ${D}${exec_prefix}/lib ]; then
+               cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix}
+       fi
+       if [ -e ${D}${datadir}/i18n ]; then
+               mv ${D}${datadir}/i18n ${dest}${datadir}
+       fi
+       cp -fpPR ${D}${datadir}/* ${dest}${datadir}
+       rm -rf ${D}${datadir}/locale/
+       cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
+}
+
+addtask do_install_locale after do_install before do_populate_sysroot do_package
+
+bashscripts = "mtrace sotruss xtrace"
+
+do_evacuate_scripts () {
+       target=${D}${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+       mkdir -p $target
+       for i in ${bashscripts}; do
+               if [ -f ${D}${bindir}/$i ]; then
+                       cp ${D}${bindir}/$i $target/
+               fi
+       done
+}
+
+addtask evacuate_scripts after do_install before do_populate_sysroot do_package
+
+PACKAGE_PREPROCESS_FUNCS += "glibc_package_preprocess"
+
+glibc_package_preprocess () {
+       rm -rf ${PKGD}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+       rm -rf ${PKGD}/${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+       for i in ${bashscripts}; do
+           rm -f ${PKGD}${bindir}/$i
+       done
+       rm -rf ${PKGD}/${localedir}
+       if [ "${libdir}" != "${exec_prefix}/lib" ]; then
+               # This dir only exists to hold locales
+               rm -rf ${PKGD}${exec_prefix}/lib
+       fi
+}
diff --git a/meta-tizen/recipes-BaseSystem/glibc/glibc-testing.inc b/meta-tizen/recipes-BaseSystem/glibc/glibc-testing.inc
new file mode 100644 (file)
index 0000000..ec16fe1
--- /dev/null
@@ -0,0 +1,79 @@
+do_compile_append () {
+       # now generate script to drive testing
+       echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testglibc
+       set >> ${B}/${HOST_PREFIX}testglibc
+       # prune out the unneeded vars
+       sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^PATCH_GET/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testglibc
+       sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testglibc
+
+       # point to real sysroot not the toolchain bootstrap sysroot
+       sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testglibc
+
+       # use the final cross-gcc to test since some tests need libstdc++
+       sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testglibc
+
+       # append execution part script
+cat >> ${B}/${HOST_PREFIX}testglibc << STOP
+target="\$1"
+if [ "x\$target" = "x" ]
+then
+       echo "Please specify the target machine and remote user in form of user@target"
+       exit 1;
+fi
+ssh \$target ls \$PWD\  2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+       echo "Failed connecting to \$target it could be because of:"
+       echo "1. You dont have passwordless ssh setup to access \$target"
+       echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
+       echo "   The tree should be accessible at same location on build host and target"
+       echo "   You can add nfs-server to IMAGE_FEATURES to get the nfs client on target"
+       echo "3. nfs server on build host is not running."
+       echo "   Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
+       echo "   to test as root user on target (usually its recommended to create a non"
+       echo "   root user."
+       echo "   As a sanity check make sure that target can read/write to the glibc build tree"
+       echo "   Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
+       exit 1
+fi
+       echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
+       echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
+
+       fgrep tcbootstrap ${B}/config.make > ${B}/configparms
+       sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
+wrapper="${S}/scripts/cross-test-ssh.sh \$target"
+localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
+make tests-clean
+make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
+rm -rf ${B}/configparms
+STOP
+
+       chmod +x ${B}/${HOST_PREFIX}testglibc
+}
index b956009..ab34aed 100644 (file)
-DESCRIPTION = "Standard Shared Libraries (from the GNU C Library)"
-HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
-SECTION = "System/Libraries"
-PRIORITY = ""
-LICENSE = "LGPL-2.1+ and SUSE-LGPL-2.1+-with-GCC-exception and GPL-2.0+"
-
-PROVIDES = ""
-#PROVIDES by glibc-devel 
-PROVIDES += "glibc-devel"
-RPROVIDES_glibc-devel += "glibc-devel"
-
-#PROVIDES by glibc-locale 
-PROVIDES += "glibc-locale"
-RPROVIDES_glibc-locale += "glibc-locale"
-
-#PROVIDES by glibc-utils 
-PROVIDES += "glibc-utils"
-RPROVIDES_glibc-utils += "glibc-utils"
-
-#PROVIDES by glibc-devel-static 
-PROVIDES += "glibc-devel-static"
-RPROVIDES_glibc-devel-static += "glibc-devel-static"
-# the PROVIDES rules is ignore "glibc-static = 2.17"
-PROVIDES += "glibc-static"
-RPROVIDES_glibc-devel-static += "glibc-static"
-
-#PROVIDES by glibc-extra 
-PROVIDES += "glibc-extra"
-RPROVIDES_glibc-extra += "glibc-extra"
-
-#PROVIDES by glibc 
-PROVIDES += "glibc"
-RPROVIDES_glibc += "glibc"
-PROVIDES += "rtld(GNU_HASH)"
-RPROVIDES_glibc += "rtld(GNU_HASH)"
-
-#PROVIDES by glibc-obsolete 
-PROVIDES += "glibc-obsolete"
-RPROVIDES_glibc-obsolete += "glibc-obsolete"
-
-#PROVIDES by glibc-info 
-PROVIDES += "glibc-info"
-RPROVIDES_glibc-info += "glibc-info"
-
-#PROVIDES by nscd 
-PROVIDES += "nscd"
-RPROVIDES_nscd += "nscd"
-PROVIDES += "glibc:/usr/sbin/nscd"
-RPROVIDES_nscd += "glibc:/usr/sbin/nscd"
-
-#PROVIDES by glibc-i18ndata 
-PROVIDES += "glibc-i18ndata"
-RPROVIDES_glibc-i18ndata += "glibc-i18ndata"
-
-#PROVIDES by glibc-html 
-PROVIDES += "glibc-html"
-RPROVIDES_glibc-html += "glibc-html"
-
-#PROVIDES by glibc-profile 
-PROVIDES += "glibc-profile"
-RPROVIDES_glibc-profile += "glibc-profile"
-
-
-RDEPENDS = ""
-#RDEPENDS of glibc-devel 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_glibc-devel += "glibc"
-RDEPENDS_glibc-devel += "linux-kernel-headers"
-
-#RDEPENDS of glibc-locale 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_glibc-locale += "glibc"
-
-#RDEPENDS of glibc-utils 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_glibc-utils += "glibc"
-
-#RDEPENDS of glibc-devel-static 
-# the RDEPENDS rules is ignore "glibc-devel = 2.17"
-RDEPENDS_glibc-devel-static += "glibc-devel"
-
-#RDEPENDS of glibc-extra 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_glibc-extra += "glibc"
-
-#RDEPENDS of glibc-profile 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_glibc-profile += "glibc"
-
-#RDEPENDS of glibc-obsolete 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_glibc-obsolete += "glibc"
-
-#RDEPENDS of nscd 
-# the RDEPENDS rules is ignore "glibc = 2.17"
-RDEPENDS_nscd += "glibc"
-
-
-PACKAGES = ""
-PACKAGES += "glibc-devel"
-PACKAGES += "glibc-locale"
-PACKAGES += "glibc-utils"
-PACKAGES += "glibc-"
-PACKAGES += "glibc-devel-static"
-PACKAGES += "glibc-extra"
-PACKAGES += "glibc-profile"
-PACKAGES += "glibc-info"
-PACKAGES += "nscd"
-PACKAGES += "glibc-i18ndata"
-PACKAGES += "glibc-html"
-
-glibc-develfiles = "/usr/bin/catchsegv /usr/bin/rpcgen /usr/bin/sprof /usr/include/* /usr/lib64/*.o /usr/lib64/*.so /usr/lib64/libbsd-compat.a /usr/lib64/libc_nonshared.a /usr/lib64/libg.a /usr/lib64/libieee.a /usr/lib64/libmcheck.a /usr/lib64/libpthread_nonshared.a /usr/lib64/librpcsvc.a "
-
-glibc-localefiles = "/usr/share/locale/locale.alias /usr/lib/locale/* /usr/lib64/gconv "
-
-glibc-utilsfiles = "/lib64/libmemusage.so /lib64/libpcprofile.so //usr/lib64/audit/sotruss-lib.so /usr/bin/mtrace /usr/bin/pcprofiledump /usr/bin/sotruss /usr/bin/xtrace /usr/bin/pldd "
-
-glibc-files = " /lib64/ld-2.17.so  /lib64/ld-linux-x86-64.so.2  /lib64/libBrokenLocale-2.17.so /lib64/libBrokenLocale.so.1 /lib64/libSegFault.so /lib64/libanl-2.17.so /lib64/libanl.so.1 /lib64/libc-2.17.so /lib64/libc.so.6* /lib64/libcidn-2.17.so /lib64/libcidn.so.1 /lib64/libcrypt-2.17.so /lib64/libcrypt.so.1 /lib64/libdl-2.17.so /lib64/libdl.so.2* /lib64/libm-2.17.so /lib64/libm.so.6* /lib64/libnsl-2.17.so /lib64/libnsl.so.1 /lib64/libnss_compat-2.17.so /lib64/libnss_compat.so.2 /lib64/libnss_db-2.17.so /lib64/libnss_db.so.2 /lib64/libnss_dns-2.17.so /lib64/libnss_dns.so.2 /lib64/libnss_files-2.17.so /lib64/libnss_files.so.2 /lib64/libnss_hesiod-2.17.so /lib64/libnss_hesiod.so.2 /lib64/libnss_nis-2.17.so /lib64/libnss_nis.so.2 /lib64/libnss_nisplus-2.17.so /lib64/libnss_nisplus.so.2 /lib64/libpthread-2.17.so /lib64/libpthread.so.0 /lib64/libresolv-2.17.so /lib64/libresolv.so.2 /lib64/librt-2.17.so /lib64/librt.so.1 /lib64/libthread_db-1.0.so /lib64/libthread_db.so.1 /lib64/libutil-2.17.so /lib64/libutil.so.1  /sbin/ldconfig /usr/bin/gencat /usr/bin/getconf /usr/bin/getent /usr/bin/iconv /usr/bin/locale /usr/bin/localedef /usr/lib/getconf/* /usr/sbin/glibc_post_upgrade /usr/sbin/iconvconfig  "
-
-glibc-devel-staticfiles = "/usr/lib64/libBrokenLocale.a /usr/lib64/libanl.a /usr/lib64/libc.a /usr/lib64/libcrypt.a /usr/lib64/libdl.a /usr/lib64/libm.a /usr/lib64/libnsl.a /usr/lib64/libpthread.a /usr/lib64/libresolv.a /usr/lib64/librt.a /usr/lib64/libutil.a "
-
-glibc-extrafiles = "/usr/bin/makedb /var/lib/misc/Makefile   "
-
-glibc-profilefiles = "/usr/lib64/libc_p.a /usr/lib64/libBrokenLocale_p.a /usr/lib64/libanl_p.a /usr/lib64/libm_p.a /usr/lib64/libcrypt_p.a /usr/lib64/libpthread_p.a /usr/lib64/libresolv_p.a /usr/lib64/libnsl_p.a /usr/lib64/librt_p.a /usr/lib64/librpcsvc_p.a /usr/lib64/libutil_p.a /usr/lib64/libdl_p.a "
-
-glibc-infofiles = ""
-
-nscdfiles = "/usr/sbin/nscd /usr/sbin/rcnscd /usr/lib/systemd/system/nscd.service /usr/lib/tmpfiles.d/nscd.conf "
-
-glibc-i18ndatafiles = "/usr/share/i18n "
-
-glibc-htmlfiles = ""
-
-FILES_glibc-devel = "${glibc-develfiles}"
-FILES_glibc-locale = "${glibc-localefiles}"
-FILES_glibc-utils = "${glibc-utilsfiles}"
-FILES_glibc- = "${glibc-files}"
-FILES_glibc-devel-static = "${glibc-devel-staticfiles}"
-FILES_glibc-extra = "${glibc-extrafiles}"
-FILES_glibc-profile = "${glibc-profilefiles}"
-FILES_glibc-info = "${glibc-infofiles}"
-FILES_nscd = "${nscdfiles}"
-FILES_glibc-i18ndata = "${glibc-i18ndatafiles}"
-FILES_glibc-html = "${glibc-htmlfiles}"
-
-SPECFILES = "packaging/glibc.spec"
-
-BBCLASSEXTEND =+ "native"
-
-require recipes-BaseSystem/tizenBuildUtils/tizenBuildUtils.inc
-
-require glibc-depends.inc
-require glibc-extraconf.inc
+require glibc-common.inc
+require glibc-ld.inc
+require glibc-testing.inc
+
+STAGINGCC = "gcc-cross-initial"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+# glibc can't be built without optimization, if someone tries to compile an
+# entire image as -O0, we override it with -O2 here and give a note about it.
+def glibc_get_optimization(d):
+    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
+    if base_contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+        bb.note("glibc can't be built with -O0, -O2 will be used instead.")
+        return selected_optimization.replace("-O0", "-O2")
+    return selected_optimization
+
+SELECTED_OPTIMIZATION := "${@glibc_get_optimization(d)}"
+
+# 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; \
+"
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
+# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
+#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
+PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES += "virtual/libintl virtual/libiconv"
+inherit autotools
+require glibc-options.inc
+
+LEAD_SONAME = "libc.so"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_KSH=${base_bindir}/bash \
+                       ac_cv_path_BASH_SHELL=${base_bindir}/bash \
+                       libc_cv_localedir=${localedir} \
+                      libc_cv_ssp=no \
+                      "
+
+GLIBC_EXTRA_OECONF ?= ""
+GLIBC_EXTRA_OECONF_class-nativesdk = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+ARM_INSTRUCTION_SET = "arm"
+
+# glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
+# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
+EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
+EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
+EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
+PARALLEL_MAKE = ""
+
+# glibc make-syscalls.sh has a number of issues with /bin/dash and
+# it's output which make calls via the SHELL also has issues, so 
+# ensure make uses /bin/bash
+EXTRA_OEMAKE += "SHELL=/bin/bash"
+
+OE_FEATURES = "${@features_to_glibc_settings(d)}"
+do_configure_prepend() {
+       sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
+       echo '${OE_FEATURES}' > ${B}/option-groups.config
+}
+
+do_configure_append() {
+       oe_runmake config
+}
+
+GLIBC_ADDONS ?= "ports,nptl,libidn"
+SDK_GLIBC_ADDONS ?= "ports,nptl,libidn"
+GLIBC_ADDONS_class-nativesdk = "${SDK_GLIBC_ADDONS}"
index 96e27ef..7058bb0 100644 (file)
@@ -1,5 +1,120 @@
 require glibc.inc
 
-S = "${WORKDIR}/git"
+DEPENDS += "gperf-native kconfig-frontends-native"
 
 SRC_URI = "git://tz.otcshare.org/profile/base/glibc.git;protocol=ssh;tag=master"
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+      file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
+
+S = "${WORKDIR}/glibc-${PV}/libc"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+PACKAGES_DYNAMIC = ""
+
+RPROVIDES_${PN}-dev = "libc6-dev virtual-libc-dev"
+PROVIDES_${PN}-dbg = "glibc-dbg"
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1"
+
+FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/glibc-${PV}', '${FILE_DIRNAME}/glibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
+
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+    import re
+    uc_os = (re.match('.*uclibc$', d.getVar('TARGET_OS', True)) != None)
+    if uc_os:
+        raise bb.parse.SkipPackage("incompatible with target %s" %
+                                   d.getVar('TARGET_OS', True))
+}
+
+export libc_cv_slibdir = "${base_libdir}"
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+                --without-cvs --disable-profile \
+                --disable-debug --without-gd \
+                --enable-clocale=gnu \
+                --enable-add-ons \
+                --with-headers=${STAGING_INCDIR} \
+                --without-selinux \
+                --enable-obsolete-rpc \
+                --with-kconfig=${STAGING_BINDIR_NATIVE} \
+                ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
+
+do_patch_append() {
+    bb.build.exec_func('do_fix_readlib_c', d)
+}
+
+# for mips glibc now builds syscall tables for all abi's
+# so we make sure that we choose right march option which is
+# compatible with o32,n32 and n64 abi's
+# e.g. -march=mips32 is not compatible with n32 and n64 therefore
+# we filter it out in such case -march=from-abi which will be
+# mips1 when using o32 and mips3 when using n32/n64
+
+TUNE_CCARGS_mips := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
+TUNE_CCARGS_mipsel := "${@oe_filter_out('-march=mips32', '${TUNE_CCARGS}', d)}"
+
+do_fix_readlib_c () {
+       sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
+}
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+        if [ -z "`which rpcgen`" ]; then
+                echo "rpcgen not found.  Install glibc-devel."
+                exit 1
+        fi
+        (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+        find ${S} -name "configure" | xargs touch
+        CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+         yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+         rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+       # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+       unset LDFLAGS
+       base_do_compile
+       (
+               cd ${S}/sunrpc/rpcsvc
+               for r in ${rpcsvc}; do
+                       h=`echo $r|sed -e's,\.x$,.h,'`
+                       rpcgen -h $r -o $h || bbwarn "unable to generate header for $r"
+               done
+       )
+       echo "Adjust ldd script"
+       if [ -n "${RTLDLIST}" ]
+       then
+               prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST=\(.*\)$#\1#'`
+               if [ "${prevrtld}" != "${RTLDLIST}" ]
+               then
+                       sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
+               fi
+       fi
+
+}
+
+require glibc-package.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/32and64bit.patch b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/32and64bit.patch
deleted file mode 100644 (file)
index cdfeaea..0000000
+++ /dev/null
@@ -1,331 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-We run the ldconfig in the cross fashion. make the code bitsize aware so that 
-we can cross build ldconfig cache for various architectures.
-
-Richard Purdie <richard.purdie@linuxfoundation.org> 2009/05/19
-Nitin A Kamble <nitin.a.kamble@intel.com> 2009/03/29
-
-Index: ldconfig-native-2.12.1/readelflib.c
-===================================================================
---- ldconfig-native-2.12.1.orig/readelflib.c
-+++ ldconfig-native-2.12.1/readelflib.c
-@@ -40,39 +40,212 @@ do                                                                \
- /* Returns 0 if everything is ok, != 0 in case of error.  */
- int
--process_elf_file (const char *file_name, const char *lib, int *flag,
-+process_elf_file32 (const char *file_name, const char *lib, int *flag,
-                 unsigned int *osversion, char **soname, void *file_contents,
-                 size_t file_length)
- {
-   int i;
-   unsigned int j;
--  ElfW(Addr) loadaddr;
-+  Elf32_Addr loadaddr;
-   unsigned int dynamic_addr;
-   size_t dynamic_size;
-   char *program_interpreter;
--  ElfW(Ehdr) *elf_header;
--  ElfW(Phdr) *elf_pheader, *segment;
--  ElfW(Dyn) *dynamic_segment, *dyn_entry;
-+  Elf32_Ehdr *elf_header;
-+  Elf32_Phdr *elf_pheader, *segment;
-+  Elf32_Dyn *dynamic_segment, *dyn_entry;
-   char *dynamic_strings;
--  elf_header = (ElfW(Ehdr) *) file_contents;
-+  elf_header = (Elf32_Ehdr *) file_contents;
-   *osversion = 0;
--  if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
-+  if (elf_header->e_type != ET_DYN)
-     {
--      if (opt_verbose)
-+      error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
-+           elf_header->e_type);
-+      return 1;
-+    }
-+
-+  /* Get information from elf program header.  */
-+  elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
-+  check_ptr (elf_pheader);
-+
-+  /* The library is an elf library, now search for soname and
-+     libc5/libc6.  */
-+  *flag = FLAG_ELF;
-+
-+  loadaddr = -1;
-+  dynamic_addr = 0;
-+  dynamic_size = 0;
-+  program_interpreter = NULL;
-+  for (i = 0, segment = elf_pheader;
-+       i < elf_header->e_phnum; i++, segment++)
-+    {
-+      check_ptr (segment);
-+
-+      switch (segment->p_type)
-       {
--        if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
--          error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name);
--        else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
--          error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name);
--        else
--          error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
-+      case PT_LOAD:
-+        if (loadaddr == (Elf32_Addr) -1)
-+          loadaddr = segment->p_vaddr - segment->p_offset;
-+        break;
-+
-+      case PT_DYNAMIC:
-+        if (dynamic_addr)
-+          error (0, 0, _("more than one dynamic segment\n"));
-+
-+        dynamic_addr = segment->p_offset;
-+        dynamic_size = segment->p_filesz;
-+        break;
-+
-+      case PT_INTERP:
-+        program_interpreter = (char *) (file_contents + segment->p_offset);
-+        check_ptr (program_interpreter);
-+
-+        /* Check if this is enough to classify the binary.  */
-+        for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]);
-+             ++j)
-+          if (strcmp (program_interpreter, interpreters[j].soname) == 0)
-+            {
-+              *flag = interpreters[j].flag;
-+              break;
-+            }
-+        break;
-+
-+      case PT_NOTE:
-+        if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
-+          {
-+            Elf32_Word *abi_note = (Elf32_Word *) (file_contents
-+                                                   + segment->p_offset);
-+            Elf32_Addr size = segment->p_filesz;
-+
-+            while (abi_note [0] != 4 || abi_note [1] != 16
-+                   || abi_note [2] != 1
-+                   || memcmp (abi_note + 3, "GNU", 4) != 0)
-+              {
-+#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
-+                Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
-+                                       + ROUND (abi_note[0])
-+                                       + ROUND (abi_note[1]);
-+
-+                if (size - 32 < note_size || note_size == 0)
-+                  {
-+                    size = 0;
-+                    break;
-+                  }
-+                size -= note_size;
-+                abi_note = (void *) abi_note + note_size;
-+              }
-+
-+            if (size == 0)
-+              break;
-+
-+            *osversion = (abi_note [4] << 24) |
-+                         ((abi_note [5] & 0xff) << 16) |
-+                         ((abi_note [6] & 0xff) << 8) |
-+                         (abi_note [7] & 0xff);
-+          }
-+        break;
-+
-+      default:
-+        break;
-+      }
-+
-+    }
-+  if (loadaddr == (Elf32_Addr) -1)
-+    {
-+      /* Very strange. */
-+      loadaddr = 0;
-+    }
-+
-+  /* Now we can read the dynamic sections.  */
-+  if (dynamic_size == 0)
-+    return 1;
-+
-+  dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr);
-+  check_ptr (dynamic_segment);
-+
-+  /* Find the string table.  */
-+  dynamic_strings = NULL;
-+  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
-+       ++dyn_entry)
-+    {
-+      check_ptr (dyn_entry);
-+      if (dyn_entry->d_tag == DT_STRTAB)
-+      {
-+        dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
-+        check_ptr (dynamic_strings);
-+        break;
-       }
--      return 1;
-     }
-+  if (dynamic_strings == NULL)
-+    return 1;
-+
-+  /* Now read the DT_NEEDED and DT_SONAME entries.  */
-+  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
-+       ++dyn_entry)
-+    {
-+      if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
-+      {
-+        char *name = dynamic_strings + dyn_entry->d_un.d_val;
-+        check_ptr (name);
-+
-+        if (dyn_entry->d_tag == DT_NEEDED)
-+          {
-+
-+            if (*flag == FLAG_ELF)
-+              {
-+                /* Check if this is enough to classify the binary.  */
-+                for (j = 0;
-+                     j < sizeof (known_libs) / sizeof (known_libs [0]);
-+                     ++j)
-+                  if (strcmp (name, known_libs [j].soname) == 0)
-+                    {
-+                      *flag = known_libs [j].flag;
-+                      break;
-+                    }
-+              }
-+          }
-+
-+        else if (dyn_entry->d_tag == DT_SONAME)
-+          *soname = xstrdup (name);
-+
-+        /* Do we have everything we need?  */
-+        if (*soname && *flag != FLAG_ELF)
-+          return 0;
-+      }
-+    }
-+
-+  /* We reach this point only if the file doesn't contain a DT_SONAME
-+     or if we can't classify the library.  If it doesn't have a
-+     soname, return the name of the library.  */
-+  if (*soname == NULL)
-+    *soname = xstrdup (lib);
-+
-+  return 0;
-+}
-+
-+int
-+process_elf_file64 (const char *file_name, const char *lib, int *flag,
-+                unsigned int *osversion, char **soname, void *file_contents,
-+                size_t file_length)
-+{
-+  int i;
-+  unsigned int j;
-+  Elf64_Addr loadaddr;
-+  unsigned int dynamic_addr;
-+  size_t dynamic_size;
-+  char *program_interpreter;
-+
-+  Elf64_Ehdr *elf_header;
-+  Elf64_Phdr *elf_pheader, *segment;
-+  Elf64_Dyn *dynamic_segment, *dyn_entry;
-+  char *dynamic_strings;
-+
-+  elf_header = (Elf64_Ehdr *) file_contents;
-+  *osversion = 0;
-+
-   if (elf_header->e_type != ET_DYN)
-     {
-       error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
-@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
-     }
-   /* Get information from elf program header.  */
--  elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents);
-+  elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
-   check_ptr (elf_pheader);
-   /* The library is an elf library, now search for soname and
-@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
-       switch (segment->p_type)
-       {
-       case PT_LOAD:
--        if (loadaddr == (ElfW(Addr)) -1)
-+        if (loadaddr == (Elf64_Addr) -1)
-           loadaddr = segment->p_vaddr - segment->p_offset;
-         break;
-@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
-       case PT_NOTE:
-         if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
-           {
--            ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
-+            Elf64_Word *abi_note = (Elf64_Word *) (file_contents
-                                                    + segment->p_offset);
--            ElfW(Addr) size = segment->p_filesz;
-+            Elf64_Addr size = segment->p_filesz;
-             while (abi_note [0] != 4 || abi_note [1] != 16
-                    || abi_note [2] != 1
-                    || memcmp (abi_note + 3, "GNU", 4) != 0)
-               {
--#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
--                ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
-+#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
-+                Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
-                                        + ROUND (abi_note[0])
-                                        + ROUND (abi_note[1]);
-@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
-       }
-     }
--  if (loadaddr == (ElfW(Addr)) -1)
-+  if (loadaddr == (Elf64_Addr) -1)
-     {
-       /* Very strange. */
-       loadaddr = 0;
-@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
-   if (dynamic_size == 0)
-     return 1;
--  dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr);
-+  dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr);
-   check_ptr (dynamic_segment);
-   /* Find the string table.  */
-@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
-   return 0;
- }
-+/* Returns 0 if everything is ok, != 0 in case of error.  */
-+int
-+process_elf_file (const char *file_name, const char *lib, int *flag,
-+                unsigned int *osversion, char **soname, void *file_contents,
-+                size_t file_length)
-+{
-+  int i;
-+  unsigned int j;
-+  ElfW(Addr) loadaddr;
-+  unsigned int dynamic_addr;
-+  size_t dynamic_size;
-+  char *program_interpreter;
-+
-+  ElfW(Ehdr) *elf_header;
-+  ElfW(Phdr) *elf_pheader, *segment;
-+  ElfW(Dyn) *dynamic_segment, *dyn_entry;
-+  char *dynamic_strings;
-+
-+  elf_header = (ElfW(Ehdr) *) file_contents;
-+  *osversion = 0;
-+
-+  if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
-+    return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length);
-+  else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
-+    return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length);
-+  error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
-+  return 1;
-+}
-+
-+
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/README b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/README
deleted file mode 100644 (file)
index 43fb983..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-The files are pulled verbatim from glibc 2.5 and then patched to allow
-standalone compilation of ldconfig.
-
-Richard Purdie
-OpenedHand Ltd.
-
-Upgraded the ldconfig recipe to eglibc 2.12.1
-Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
deleted file mode 100644 (file)
index 7f8e4db..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-Do data input/output handling according to endien-ness of the library file. That 
-enables use of ldconfig in the cross fashion for any architecture.
-
-2011/04/04
-Richard Purdie <richard.purdie@linuxfoundation.org>
-Nitin Kamble <nitin.a.kamble@intel.com>
-
-Index: ldconfig-native-2.12.1/readelflib.c
-===================================================================
---- ldconfig-native-2.12.1.orig/readelflib.c
-+++ ldconfig-native-2.12.1/readelflib.c
-@@ -38,6 +38,28 @@ do                                                          \
-   }                                                           \
-  while (0);
-+int be;
-+static uint16_t read16(uint16_t x, int be)
-+{
-+  if (be)
-+        return be16toh(x);
-+  return le16toh(x);
-+}
-+
-+static uint32_t read32(uint32_t x, int be)
-+{
-+  if (be)
-+        return be32toh(x);
-+  return le32toh(x);
-+}
-+
-+static uint64_t read64(uint64_t x, int be)
-+{
-+  if (be)
-+        return be64toh(x);
-+  return le64toh(x);
-+}
-+
- /* Returns 0 if everything is ok, != 0 in case of error.  */
- int
- process_elf_file32 (const char *file_name, const char *lib, int *flag,
-@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
-   elf_header = (Elf32_Ehdr *) file_contents;
-   *osversion = 0;
--  if (elf_header->e_type != ET_DYN)
-+  be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
-+
-+  if (read16(elf_header->e_type, be) != ET_DYN)
-     {
-       error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
--           elf_header->e_type);
-+           read16(elf_header->e_type, be));
-       return 1;
-     }
-   /* Get information from elf program header.  */
--  elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
-+  elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
-   check_ptr (elf_pheader);
-   /* The library is an elf library, now search for soname and
-@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
-   dynamic_size = 0;
-   program_interpreter = NULL;
-   for (i = 0, segment = elf_pheader;
--       i < elf_header->e_phnum; i++, segment++)
-+       i < read16(elf_header->e_phnum, be); i++, segment++)
-     {
-       check_ptr (segment);
--      switch (segment->p_type)
-+      switch (read32(segment->p_type, be))
-       {
-       case PT_LOAD:
-         if (loadaddr == (Elf32_Addr) -1)
--          loadaddr = segment->p_vaddr - segment->p_offset;
-+          loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
-         break;
-       case PT_DYNAMIC:
-         if (dynamic_addr)
-           error (0, 0, _("more than one dynamic segment\n"));
--        dynamic_addr = segment->p_offset;
--        dynamic_size = segment->p_filesz;
-+        dynamic_addr = read32(segment->p_offset, be);
-+        dynamic_size = read32(segment->p_filesz, be);
-         break;
-       case PT_INTERP:
--        program_interpreter = (char *) (file_contents + segment->p_offset);
-+        program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
-         check_ptr (program_interpreter);
-         /* Check if this is enough to classify the binary.  */
-@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
-         break;
-       case PT_NOTE:
--        if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
-+        if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
-           {
-             Elf32_Word *abi_note = (Elf32_Word *) (file_contents
--                                                   + segment->p_offset);
--            Elf32_Addr size = segment->p_filesz;
-+                                                   + read32(segment->p_offset, be));
-+            Elf32_Addr size = read32(segment->p_filesz, be);
--            while (abi_note [0] != 4 || abi_note [1] != 16
--                   || abi_note [2] != 1
-+            while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
-+                   || read32(abi_note [2], be) != 1
-                    || memcmp (abi_note + 3, "GNU", 4) != 0)
-               {
--#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
--                Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
--                                       + ROUND (abi_note[0])
--                                       + ROUND (abi_note[1]);
-+#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
-+                Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
-+                                       + ROUND (read32(abi_note[0], be))
-+                                       + ROUND (read32(abi_note[1], be));
-                 if (size - 32 < note_size || note_size == 0)
-                   {
-@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
-             if (size == 0)
-               break;
--            *osversion = (abi_note [4] << 24) |
--                         ((abi_note [5] & 0xff) << 16) |
--                         ((abi_note [6] & 0xff) << 8) |
--                         (abi_note [7] & 0xff);
-+            *osversion = (read32(abi_note [4], be) << 24) |
-+                         ((read32(abi_note [5], be) & 0xff) << 16) |
-+                         ((read32(abi_note [6], be) & 0xff) << 8) |
-+                         (read32(abi_note [7], be) & 0xff);
-           }
-         break;
-@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
-   /* Find the string table.  */
-   dynamic_strings = NULL;
--  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
-+  for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
-        ++dyn_entry)
-     {
-       check_ptr (dyn_entry);
--      if (dyn_entry->d_tag == DT_STRTAB)
-+      if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
-       {
--        dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
-+        dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
-         check_ptr (dynamic_strings);
-         break;
-       }
-@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
-     return 1;
-   /* Now read the DT_NEEDED and DT_SONAME entries.  */
--  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
-+  for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
-        ++dyn_entry)
-     {
--      if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
-+      if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
-       {
--        char *name = dynamic_strings + dyn_entry->d_un.d_val;
-+        char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
-         check_ptr (name);
--        if (dyn_entry->d_tag == DT_NEEDED)
-+        if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
-           {
-             if (*flag == FLAG_ELF)
-@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
-               }
-           }
--        else if (dyn_entry->d_tag == DT_SONAME)
-+        else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
-           *soname = xstrdup (name);
-         /* Do we have everything we need?  */
-@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
-   elf_header = (Elf64_Ehdr *) file_contents;
-   *osversion = 0;
--  if (elf_header->e_type != ET_DYN)
-+  be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
-+
-+  if (read16(elf_header->e_type, be) != ET_DYN)
-     {
-       error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
--           elf_header->e_type);
-+           read16(elf_header->e_type, be));
-       return 1;
-     }
-   /* Get information from elf program header.  */
--  elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
-+  elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
-   check_ptr (elf_pheader);
-   /* The library is an elf library, now search for soname and
-@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
-   dynamic_size = 0;
-   program_interpreter = NULL;
-   for (i = 0, segment = elf_pheader;
--       i < elf_header->e_phnum; i++, segment++)
-+       i < read16(elf_header->e_phnum, be); i++, segment++)
-     {
-       check_ptr (segment);
--      switch (segment->p_type)
-+      switch (read32(segment->p_type, be))
-       {
-       case PT_LOAD:
-         if (loadaddr == (Elf64_Addr) -1)
--          loadaddr = segment->p_vaddr - segment->p_offset;
-+          loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
-         break;
-       case PT_DYNAMIC:
-         if (dynamic_addr)
-           error (0, 0, _("more than one dynamic segment\n"));
--        dynamic_addr = segment->p_offset;
--        dynamic_size = segment->p_filesz;
-+        dynamic_addr = read64(segment->p_offset, be);
-+        dynamic_size = read32(segment->p_filesz, be);
-         break;
-       case PT_INTERP:
--        program_interpreter = (char *) (file_contents + segment->p_offset);
-+        program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
-         check_ptr (program_interpreter);
-         /* Check if this is enough to classify the binary.  */
-@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
-         break;
-       case PT_NOTE:
--        if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
-+        if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
-           {
-             Elf64_Word *abi_note = (Elf64_Word *) (file_contents
--                                                   + segment->p_offset);
--            Elf64_Addr size = segment->p_filesz;
-+                                                   + read64(segment->p_offset, be));
-+            Elf64_Addr size = read32(segment->p_filesz, be);
--            while (abi_note [0] != 4 || abi_note [1] != 16
--                   || abi_note [2] != 1
-+            while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
-+                   || read32(abi_note [2], be) != 1
-                    || memcmp (abi_note + 3, "GNU", 4) != 0)
-               {
-+#undef ROUND
- #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
-                 Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
--                                       + ROUND (abi_note[0])
--                                       + ROUND (abi_note[1]);
-+                                       + ROUND (read32(abi_note[0], be))
-+                                       + ROUND (read32(abi_note[1], be));
-                 if (size - 32 < note_size || note_size == 0)
-                   {
-@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
-             if (size == 0)
-               break;
--            *osversion = (abi_note [4] << 24) |
--                         ((abi_note [5] & 0xff) << 16) |
--                         ((abi_note [6] & 0xff) << 8) |
--                         (abi_note [7] & 0xff);
-+            *osversion = (read32(abi_note [4], be) << 24) |
-+                         ((read32(abi_note [5], be) & 0xff) << 16) |
-+                         ((read32(abi_note [6], be) & 0xff) << 8) |
-+                         (read32(abi_note [7], be) & 0xff);
-           }
-         break;
-@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
-   /* Find the string table.  */
-   dynamic_strings = NULL;
--  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
-+  for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
-        ++dyn_entry)
-     {
-       check_ptr (dyn_entry);
--      if (dyn_entry->d_tag == DT_STRTAB)
-+      if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
-       {
--        dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
-+        dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
-         check_ptr (dynamic_strings);
-         break;
-       }
-@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
-     return 1;
-   /* Now read the DT_NEEDED and DT_SONAME entries.  */
--  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
-+  for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
-        ++dyn_entry)
-     {
--      if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
-+      if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
-       {
--        char *name = dynamic_strings + dyn_entry->d_un.d_val;
-+        char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
-         check_ptr (name);
--        if (dyn_entry->d_tag == DT_NEEDED)
-+        if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
-           {
-             if (*flag == FLAG_ELF)
-@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
-               }
-           }
--        else if (dyn_entry->d_tag == DT_SONAME)
-+        else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
-           *soname = xstrdup (name);
-         /* Do we have everything we need?  */
-Index: ldconfig-native-2.12.1/readlib.c
-===================================================================
---- ldconfig-native-2.12.1.orig/readlib.c
-+++ ldconfig-native-2.12.1/readlib.c
-@@ -169,7 +169,8 @@ process_file (const char *real_file_name
-       ret = 1;
-     }
-   /* Libraries have to be shared object files.  */
--  else if (elf_header->e_type != ET_DYN)
-+  else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
-+      (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
-     ret = 1;
-   else if (process_elf_file (file_name, lib, flag, osversion, soname,
-                            file_contents, statbuf.st_size))
-Index: ldconfig-native-2.12.1/cache.c
-===================================================================
---- ldconfig-native-2.12.1.orig/cache.c
-+++ ldconfig-native-2.12.1/cache.c
-@@ -39,6 +39,29 @@
- # define N_(msgid)  msgid
- #define _(msg) msg
-+extern int be;
-+
-+static uint16_t write16(uint16_t x, int be)
-+{
-+  if (be)
-+        return htobe16(x);
-+  return htole16(x);
-+}
-+
-+static uint32_t write32(uint32_t x, int be)
-+{
-+  if (be)
-+        return htobe32(x);
-+  return htole32(x);
-+}
-+
-+static uint64_t write64(uint64_t x, int be)
-+{
-+  if (be)
-+        return htobe64(x);
-+  return htole64(x);
-+}
-+
- struct cache_entry
- {
-   char *lib;                  /* Library name.  */
-@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
-   /* Number of normal cache entries.  */
-   int cache_entry_old_count = 0;
--  for (entry = entries; entry != NULL; entry = entry->next)
-+    if (be)
-+      printf("saving cache in big endian encoding\n");
-+    else
-+      printf("saving cache in little endian encoding\n");
-+
-+    for (entry = entries; entry != NULL; entry = entry->next)
-     {
-       /* Account the final NULs.  */
-       total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
-@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
-       memset (file_entries, '\0', sizeof (struct cache_file));
-       memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
--      file_entries->nlibs = cache_entry_old_count;
-+      file_entries->nlibs = write32(cache_entry_old_count, be);
-     }
-   struct cache_file_new *file_entries_new = NULL;
-@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
-       memcpy (file_entries_new->version, CACHE_VERSION,
-             sizeof CACHE_VERSION - 1);
--      file_entries_new->nlibs = cache_entry_count;
--      file_entries_new->len_strings = total_strlen;
-+      file_entries_new->nlibs = write32(cache_entry_count, be);
-+      file_entries_new->len_strings = write32(total_strlen, be);
-     }
-   /* Pad for alignment of cache_file_new.  */
-@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
-       /* First the library.  */
-       if (opt_format != 2 && entry->hwcap == 0)
-       {
--        file_entries->libs[idx_old].flags = entry->flags;
-+        file_entries->libs[idx_old].flags = write32(entry->flags, be);
-         /* XXX: Actually we can optimize here and remove duplicates.  */
--        file_entries->libs[idx_old].key = str_offset + pad;
-+        file_entries->libs[idx_old].key = write32(str_offset + pad, be);
-       }
-       if (opt_format != 0)
-       {
-@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
-            not doing so makes the code easier, the string table
-            always begins at the beginning of the the new cache
-            struct.  */
--        file_entries_new->libs[idx_new].flags = entry->flags;
--        file_entries_new->libs[idx_new].osversion = entry->osversion;
--        file_entries_new->libs[idx_new].hwcap = entry->hwcap;
--        file_entries_new->libs[idx_new].key = str_offset;
-+        file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
-+        file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
-+        file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
-+        file_entries_new->libs[idx_new].key = write32(str_offset, be);
-       }
-       size_t len = strlen (entry->lib) + 1;
-@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
-       str_offset += len;
-       /* Then the path.  */
-       if (opt_format != 2 && entry->hwcap == 0)
--      file_entries->libs[idx_old].value = str_offset + pad;
-+      file_entries->libs[idx_old].value = write32(str_offset + pad, be);
-       if (opt_format != 0)
--      file_entries_new->libs[idx_new].value = str_offset;
-+      file_entries_new->libs[idx_new].value = write32(str_offset, be);
-       len = strlen (entry->path) + 1;
-       str = mempcpy (str, entry->path, len);
-       str_offset += len;
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/endianess-header.patch b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/endianess-header.patch
deleted file mode 100644 (file)
index a18b2c2..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-Upstream-Status: Inappropriate [fix poky patch]
-
-This patch fixes build issues with a previous endian-ness_handling.patch on
-distros that don't have macros referenced
-
-7/20/2011
-Matthew McClintock <msm@freescale.com>
-
-diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
---- ldconfig-native-2.12.1.orig/endian_extra.h 1969-12-31 18:00:00.000000000 -0600
-+++ ldconfig-native-2.12.1/endian_extra.h      2011-07-19 18:09:14.323048417 -0500
-@@ -0,0 +1,64 @@
-+/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, write to the Free
-+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-+   02111-1307 USA.  */
-+
-+#include <endian.h>
-+
-+#ifndef       _ENDIAN_EXTRA_H
-+#define       _ENDIAN_EXTRA_H 1
-+
-+/* Don't redefine these macros if they already exist */
-+#ifndef htobe16
-+#ifdef __USE_BSD
-+/* Conversion interfaces.  */
-+# include <byteswap.h>
-+
-+# if __BYTE_ORDER == __LITTLE_ENDIAN
-+#  define htobe16(x) __bswap_16 (x)
-+#  define htole16(x) (x)
-+#  define be16toh(x) __bswap_16 (x)
-+#  define le16toh(x) (x)
-+
-+#  define htobe32(x) __bswap_32 (x)
-+#  define htole32(x) (x)
-+#  define be32toh(x) __bswap_32 (x)
-+#  define le32toh(x) (x)
-+
-+#  define htobe64(x) __bswap_64 (x)
-+#  define htole64(x) (x)
-+#  define be64toh(x) __bswap_64 (x)
-+#  define le64toh(x) (x)
-+# else
-+#  define htobe16(x) (x)
-+#  define htole16(x) __bswap_16 (x)
-+#  define be16toh(x) (x)
-+#  define le16toh(x) __bswap_16 (x)
-+
-+#  define htobe32(x) (x)
-+#  define htole32(x) __bswap_32 (x)
-+#  define be32toh(x) (x)
-+#  define le32toh(x) __bswap_32 (x)
-+
-+#  define htobe64(x) (x)
-+#  define htole64(x) __bswap_64 (x)
-+#  define be64toh(x) (x)
-+#  define le64toh(x) __bswap_64 (x)
-+# endif
-+#endif
-+#endif
-+
-+#endif        /* endian_extra.h */
-diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
---- ldconfig-native-2.12.1.orig/cache.c        2011-07-19 18:21:28.347041301 -0500
-+++ ldconfig-native-2.12.1/cache.c     2011-07-19 18:22:54.118048064 -0500
-@@ -39,6 +39,8 @@
- # define N_(msgid)  msgid
- #define _(msg) msg
-+#include "endian_extra.h"
-+
- extern int be;
- static uint16_t write16(uint16_t x, int be)
-diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
---- ldconfig-native-2.12.1.orig/readelflib.c   2011-07-19 18:21:28.346041593 -0500
-+++ ldconfig-native-2.12.1/readelflib.c        2011-07-19 18:23:05.324059875 -0500
-@@ -25,6 +25,9 @@
- /* check_ptr checks that a pointer is in the mmaped file and doesn't
-    point outside it.  */
-+
-+#include "endian_extra.h"
-+
- #undef check_ptr
- #define check_ptr(ptr)                                                \
- do                                                            \
-diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
---- ldconfig-native-2.12.1.orig/readlib.c      2011-07-19 18:21:28.346041593 -0500
-+++ ldconfig-native-2.12.1/readlib.c   2011-07-19 18:23:23.877046210 -0500
-@@ -40,6 +40,8 @@
- #include "ldconfig.h"
-+#include "endian_extra.h"
-+
- #define _(msg) msg
- #define Elf32_CLASS ELFCLASS32
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/flag_fix.patch b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/flag_fix.patch
deleted file mode 100644 (file)
index 4e9aab9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-The native version of ldconfig was using native definition of LD_SO (i.e. 
-ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
-This was causing libc.so on the target marked as ELF lib rather than 
-FLAG_ELF_LIBC6 in the ld.so.cache.
-
-Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
-
-Index: ldconfig-native-2.12.1/readlib.c
-===================================================================
---- ldconfig-native-2.12.1.orig/readlib.c
-+++ ldconfig-native-2.12.1/readlib.c
-@@ -51,6 +51,10 @@ struct known_names
-   int flag;
- };
-+/* don't use host's definition of LD_SO */
-+#undef LD_SO 
-+#define LD_SO "ld.so.1"
-+
- static struct known_names interpreters[] =
- {
-   { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
deleted file mode 100644 (file)
index dc1e798..0000000
Binary files a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 and /dev/null differ
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig.patch b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig.patch
deleted file mode 100644 (file)
index 52986e6..0000000
+++ /dev/null
@@ -1,471 +0,0 @@
-Upstream-Status: Inappropriate [embedded specific]
-
-enable standalone building of ldconfig
-
----
- cache.c        |   11 +-
- chroot_canon.c |    7 +
- dl-cache.c     |  235 ---------------------------------------------------------
- dl-cache.h     |    3 
- ldconfig.c     |   27 ++++--
- readlib.c      |    7 +
- xstrdup.c      |   11 --
- 7 files changed, 45 insertions(+), 256 deletions(-)
-
-Index: ldconfig-native-2.12.1/cache.c
-===================================================================
---- ldconfig-native-2.12.1.orig/cache.c
-+++ ldconfig-native-2.12.1/cache.c
-@@ -16,6 +16,9 @@
-    along with this program; if not, write to the Free Software Foundation,
-    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+#define _LARGEFILE64_SOURCE
-+#define _GNU_SOURCE
-+
- #include <errno.h>
- #include <error.h>
- #include <dirent.h>
-@@ -31,8 +34,10 @@
- #include <sys/stat.h>
- #include <sys/types.h>
--#include <ldconfig.h>
--#include <dl-cache.h>
-+#include "ldconfig.h"
-+#include "dl-cache.h"
-+# define N_(msgid)  msgid
-+#define _(msg) msg
- struct cache_entry
- {
-Index: ldconfig-native-2.12.1/chroot_canon.c
-===================================================================
---- ldconfig-native-2.12.1.orig/chroot_canon.c
-+++ ldconfig-native-2.12.1/chroot_canon.c
-@@ -17,6 +17,9 @@
-    along with this program; if not, write to the Free Software Foundation,
-    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+#define _LARGEFILE64_SOURCE
-+#define _GNU_SOURCE
-+
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
-@@ -27,7 +30,9 @@
- #include <stddef.h>
- #include <stdint.h>
--#include <ldconfig.h>
-+#include "ldconfig.h"
-+
-+#define __set_errno(Val) errno = (Val)
- #ifndef PATH_MAX
- #define PATH_MAX 1024
-Index: ldconfig-native-2.12.1/dl-cache.c
-===================================================================
---- ldconfig-native-2.12.1.orig/dl-cache.c
-+++ ldconfig-native-2.12.1/dl-cache.c
-@@ -20,12 +20,12 @@
- #include <assert.h>
- #include <unistd.h>
--#include <ldsodefs.h>
-+//#include "ldsodefs.h"
- #include <sys/mman.h>
- #include <dl-cache.h>
- #include <dl-procinfo.h>
--#include <stdio-common/_itoa.h>
-+//#include "_itoa.h"
- #ifndef _DL_PLATFORMS_COUNT
- # define _DL_PLATFORMS_COUNT 0
-@@ -39,103 +39,7 @@ static size_t cachesize;
- /* 1 if cache_data + PTR points into the cache.  */
- #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
--#define SEARCH_CACHE(cache) \
--/* We use binary search since the table is sorted in the cache file.        \
--   The first matching entry in the table is returned.                       \
--   It is important to use the same algorithm as used while generating       \
--   the cache file.  */                                                              \
--do                                                                          \
--  {                                                                         \
--    left = 0;                                                               \
--    right = cache->nlibs - 1;                                               \
--                                                                            \
--    while (left <= right)                                                   \
--      {                                                                             \
--      __typeof__ (cache->libs[0].key) key;                                  \
--                                                                            \
--      middle = (left + right) / 2;                                          \
--                                                                            \
--      key = cache->libs[middle].key;                                        \
--                                                                            \
--      /* Make sure string table indices are not bogus before using          \
--         them.  */                                                          \
--      if (! _dl_cache_verify_ptr (key))                                     \
--        {                                                                   \
--          cmpres = 1;                                                       \
--          break;                                                            \
--        }                                                                   \
--                                                                            \
--      /* Actually compare the entry with the key.  */                       \
--      cmpres = _dl_cache_libcmp (name, cache_data + key);                   \
--      if (__builtin_expect (cmpres == 0, 0))                                \
--        {                                                                   \
--          /* Found it.  LEFT now marks the last entry for which we          \
--             know the name is correct.  */                                  \
--          left = middle;                                                    \
--                                                                            \
--          /* There might be entries with this name before the one we        \
--             found.  So we have to find the beginning.  */                  \
--          while (middle > 0)                                                \
--            {                                                               \
--              __typeof__ (cache->libs[0].key) key;                          \
--                                                                            \
--              key = cache->libs[middle - 1].key;                            \
--              /* Make sure string table indices are not bogus before        \
--                 using them.  */                                            \
--              if (! _dl_cache_verify_ptr (key)                              \
--                  /* Actually compare the entry.  */                        \
--                  || _dl_cache_libcmp (name, cache_data + key) != 0)        \
--                break;                                                      \
--              --middle;                                                     \
--            }                                                               \
--                                                                            \
--          do                                                                \
--            {                                                               \
--              int flags;                                                    \
--              __typeof__ (cache->libs[0]) *lib = &cache->libs[middle];      \
--                                                                            \
--              /* Only perform the name test if necessary.  */               \
--              if (middle > left                                             \
--                  /* We haven't seen this string so far.  Test whether the  \
--                     index is ok and whether the name matches.  Otherwise   \
--                     we are done.  */                                       \
--                  && (! _dl_cache_verify_ptr (lib->key)                     \
--                      || (_dl_cache_libcmp (name, cache_data + lib->key)    \
--                          != 0)))                                           \
--                break;                                                      \
--                                                                            \
--              flags = lib->flags;                                           \
--              if (_dl_cache_check_flags (flags)                             \
--                  && _dl_cache_verify_ptr (lib->value))                     \
--                {                                                           \
--                  if (best == NULL || flags == GLRO(dl_correct_cache_id))   \
--                    {                                                       \
--                      HWCAP_CHECK;                                          \
--                      best = cache_data + lib->value;                       \
--                                                                            \
--                      if (flags == GLRO(dl_correct_cache_id))               \
--                        /* We've found an exact match for the shared        \
--                           object and no general `ELF' release.  Stop       \
--                           searching.  */                                   \
--                        break;                                              \
--                    }                                                       \
--                }                                                           \
--            }                                                               \
--          while (++middle <= right);                                        \
--          break;                                                            \
--      }                                                                     \
--                                                                            \
--      if (cmpres < 0)                                                       \
--        left = middle + 1;                                                  \
--      else                                                                  \
--        right = middle - 1;                                                 \
--      }                                                                             \
--  }                                                                         \
--while (0)
--
--
- int
--internal_function
- _dl_cache_libcmp (const char *p1, const char *p2)
- {
-   while (*p1 != '\0')
-@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const 
-     }
-   return *p1 - *p2;
- }
--
--
--/* Look up NAME in ld.so.cache and return the file name stored there,
--   or null if none is found.  */
--
--const char *
--internal_function
--_dl_load_cache_lookup (const char *name)
--{
--  int left, right, middle;
--  int cmpres;
--  const char *cache_data;
--  uint32_t cache_data_size;
--  const char *best;
--
--  /* Print a message if the loading of libs is traced.  */
--  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
--    _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
--
--  if (cache == NULL)
--    {
--      /* Read the contents of the file.  */
--      void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
--                                             PROT_READ);
--
--      /* We can handle three different cache file formats here:
--       - the old libc5/glibc2.0/2.1 format
--       - the old format with the new format in it
--       - only the new format
--       The following checks if the cache contains any of these formats.  */
--      if (file != MAP_FAILED && cachesize > sizeof *cache
--        && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
--      {
--        size_t offset;
--        /* Looks ok.  */
--        cache = file;
--
--        /* Check for new version.  */
--        offset = ALIGN_CACHE (sizeof (struct cache_file)
--                              + cache->nlibs * sizeof (struct file_entry));
--
--        cache_new = (struct cache_file_new *) ((void *) cache + offset);
--        if (cachesize < (offset + sizeof (struct cache_file_new))
--            || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
--                       sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
--          cache_new = (void *) -1;
--      }
--      else if (file != MAP_FAILED && cachesize > sizeof *cache_new
--             && memcmp (file, CACHEMAGIC_VERSION_NEW,
--                        sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
--      {
--        cache_new = file;
--        cache = file;
--      }
--      else
--      {
--        if (file != MAP_FAILED)
--          __munmap (file, cachesize);
--        cache = (void *) -1;
--      }
--
--      assert (cache != NULL);
--    }
--
--  if (cache == (void *) -1)
--    /* Previously looked for the cache file and didn't find it.  */
--    return NULL;
--
--  best = NULL;
--
--  if (cache_new != (void *) -1)
--    {
--      uint64_t platform;
--
--      /* This is where the strings start.  */
--      cache_data = (const char *) cache_new;
--
--      /* Now we can compute how large the string table is.  */
--      cache_data_size = (const char *) cache + cachesize - cache_data;
--
--      platform = _dl_string_platform (GLRO(dl_platform));
--      if (platform != (uint64_t) -1)
--      platform = 1ULL << platform;
--
--#define _DL_HWCAP_TLS_MASK (1LL << 63)
--      uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
--                               | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
--
--      /* Only accept hwcap if it's for the right platform.  */
--#define HWCAP_CHECK \
--      if (lib->hwcap & hwcap_exclude)                                       \
--      continue;                                                             \
--      if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion))        \
--      continue;                                                             \
--      if (_DL_PLATFORMS_COUNT                                               \
--        && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0                           \
--        && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform)                   \
--      continue
--      SEARCH_CACHE (cache_new);
--    }
--  else
--    {
--      /* This is where the strings start.  */
--      cache_data = (const char *) &cache->libs[cache->nlibs];
--
--      /* Now we can compute how large the string table is.  */
--      cache_data_size = (const char *) cache + cachesize - cache_data;
--
--#undef HWCAP_CHECK
--#define HWCAP_CHECK do {} while (0)
--      SEARCH_CACHE (cache);
--    }
--
--  /* Print our result if wanted.  */
--  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
--      && best != NULL)
--    _dl_debug_printf ("  trying file=%s\n", best);
--
--  return best;
--}
--
--#ifndef MAP_COPY
--/* If the system does not support MAP_COPY we cannot leave the file open
--   all the time since this would create problems when the file is replaced.
--   Therefore we provide this function to close the file and open it again
--   once needed.  */
--void
--_dl_unload_cache (void)
--{
--  if (cache != NULL && cache != (struct cache_file *) -1)
--    {
--      __munmap (cache, cachesize);
--      cache = NULL;
--    }
--}
--#endif
-Index: ldconfig-native-2.12.1/dl-cache.h
-===================================================================
---- ldconfig-native-2.12.1.orig/dl-cache.h
-+++ ldconfig-native-2.12.1/dl-cache.h
-@@ -101,5 +101,4 @@ struct cache_file_new
- (((addr) + __alignof__ (struct cache_file_new) -1)    \
-  & (~(__alignof__ (struct cache_file_new) - 1)))
--extern int _dl_cache_libcmp (const char *p1, const char *p2)
--     internal_function;
-+extern int _dl_cache_libcmp (const char *p1, const char *p2);
-Index: ldconfig-native-2.12.1/ldconfig.c
-===================================================================
---- ldconfig-native-2.12.1.orig/ldconfig.c
-+++ ldconfig-native-2.12.1/ldconfig.c
-@@ -16,6 +16,9 @@
-    along with this program; if not, write to the Free Software Foundation,
-    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
-+#define _LARGEFILE64_SOURCE
-+#define _GNU_SOURCE
-+
- #define PROCINFO_CLASS static
- #include <alloca.h>
- #include <argp.h>
-@@ -39,10 +42,20 @@
- #include <glob.h>
- #include <libgen.h>
--#include <ldconfig.h>
--#include <dl-cache.h>
-+#include "ldconfig.h"
-+#include "dl-cache.h"
-+
-+#include "dl-procinfo.h"
-+
-+#include "argp.h"
-+
-+
-+#define SYSCONFDIR "/etc"
-+#define LIBDIR "/usr/lib"
-+#define SLIBDIR "/lib"
-+# define N_(msgid)  msgid
-+#define _(msg) msg
--#include <dl-procinfo.h>
- #ifdef _DL_FIRST_PLATFORM
- # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
-@@ -55,7 +68,7 @@
- #endif
- /* Get libc version number.  */
--#include <version.h>
-+#include "version.h"
- #define PACKAGE _libc_intl_domainname
-@@ -152,8 +165,8 @@ static const struct argp_option options[
-   { NULL, 0, NULL, 0, NULL, 0 }
- };
--#define PROCINFO_CLASS static
--#include <dl-procinfo.c>
-+//#define PROCINFO_CLASS static
-+//#include <dl-procinfo.c>
- /* Short description of program.  */
- static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
-@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
-   return 0;
- }
-+#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
- /* Print bug-reporting information in the help message.  */
- static char *
- more_help (int key, const char *text, void *input)
-@@ -315,7 +329,7 @@ For bug reporting instructions, please s
- static void
- print_version (FILE *stream, struct argp_state *state)
- {
--  fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
-+  fprintf (stream, "ldconfig (Hacked Poky Version)\n");
-   fprintf (stream, gettext ("\
- Copyright (C) %s Free Software Foundation, Inc.\n\
- This is free software; see the source for copying conditions.  There is NO\n\
-@@ -1233,6 +1247,7 @@ set_hwcap (void)
-     hwcap_mask = strtoul (mask, NULL, 0);
- }
-+const char _libc_intl_domainname[] = "libc";
- int
- main (int argc, char **argv)
-Index: ldconfig-native-2.12.1/readlib.c
-===================================================================
---- ldconfig-native-2.12.1.orig/readlib.c
-+++ ldconfig-native-2.12.1/readlib.c
-@@ -22,6 +22,9 @@
-    development version.  Besides the simplification, it has also been
-    modified to read some other file formats.  */
-+#define _LARGEFILE64_SOURCE
-+#define _GNU_SOURCE
-+
- #include <a.out.h>
- #include <elf.h>
- #include <error.h>
-@@ -35,7 +38,9 @@
- #include <sys/stat.h>
- #include <gnu/lib-names.h>
--#include <ldconfig.h>
-+#include "ldconfig.h"
-+
-+#define _(msg) msg
- #define Elf32_CLASS ELFCLASS32
- #define Elf64_CLASS ELFCLASS64
-Index: ldconfig-native-2.12.1/xstrdup.c
-===================================================================
---- ldconfig-native-2.12.1.orig/xstrdup.c
-+++ ldconfig-native-2.12.1/xstrdup.c
-@@ -16,15 +16,10 @@
-    along with this program; if not, write to the Free Software Foundation,
-    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
--#ifdef HAVE_CONFIG_H
--# include <config.h>
--#endif
-+#define _GNU_SOURCE
-+
-+#include <string.h>
--#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
--# include <string.h>
--#else
--# include <strings.h>
--#endif
- void *xmalloc (size_t n) __THROW;
- char *xstrdup (char *string) __THROW;
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
deleted file mode 100644 (file)
index 27bc411..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-Upstream-Status: Pending
-
-Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
-
-Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
-
---- ldconfig-native-2.12.1.orig/ldconfig.c     
-+++ ldconfig-native-2.12.1/ldconfig.c  
-@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
-   const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
-   if (opt_chroot)
--    {
--      aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
--      if (aux_cache_file == NULL)
--      error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
--             _PATH_LDCONFIG_AUX_CACHE);
--    }
-+    aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
--  if (! opt_ignore_aux_cache)
-+  if (! opt_ignore_aux_cache && aux_cache_file)
-     load_aux_cache (aux_cache_file);
-   else
-     init_aux_cache ();
-@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
-   if (opt_build_cache)
-     {
-       save_cache (cache_file);
--      save_aux_cache (aux_cache_file);
-+      if (aux_cache_file)
-+        save_aux_cache (aux_cache_file);
-     }
-   return 0;
-
diff --git a/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native_2.12.1.bb b/meta-tizen/recipes-BaseSystem/glibc/ldconfig-native_2.12.1.bb
deleted file mode 100644 (file)
index 63ef95b..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-DESCRIPTION = "A standalone native ldconfig build"
-
-LICENSE = "GPLv2+"
-
-LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
-
-SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
-           file://ldconfig.patch \
-           file://ldconfig_aux-cache_path_fix.patch \
-           file://32and64bit.patch \
-           file://endian-ness_handling.patch \
-           file://flag_fix.patch \
-           file://endianess-header.patch"
-
-PR = "r2"
-
-FILESPATH = "${FILE_DIRNAME}/${PN}-${PV}/"
-
-inherit native
-
-S = "${WORKDIR}/${PN}-${PV}"
-
-do_compile () {
-       $CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c  -I. dl-cache.c -o ldconfig
-}
-
-do_install () {
-       install -d ${D}/${bindir}/
-       install ldconfig ${D}/${bindir}/
-}
diff --git a/meta-tizen/recipes-BaseSystem/glibc/site_config/funcs b/meta-tizen/recipes-BaseSystem/glibc/site_config/funcs
new file mode 100644 (file)
index 0000000..ccc8539
--- /dev/null
@@ -0,0 +1,474 @@
+a64l
+abs
+access
+__adjtimex
+alarm
+alphasort
+argz_append
+__argz_count
+argz_create_sep
+argz_insert
+__argz_next
+argz_next
+__argz_stringify
+argz_stringify
+asprintf
+atexit
+atof
+atoi
+bcmp
+bcopy
+bindresvport
+bind_textdomain_codeset
+btowc
+bzero
+calloc
+canonicalize_file_name
+catgets
+cfgetospeed
+cfsetispeed
+cfsetspeed
+chmod
+chown
+chroot
+clock
+close
+closedir
+closelog
+confstr
+connect
+daemon
+dcgettext
+difftime
+dirfd
+dirname
+dngettext
+dup2
+ecvt
+endgrent
+endmntent
+endpwent
+endutent
+endutxent
+epoll_ctl
+err
+ether_hostton
+ether_ntohost
+euidaccess
+execv
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fcntl
+fcvt
+fdatasync
+fdopendir
+feof_unlocked
+fgets_unlocked
+fgetxattr
+finite
+flistxattr
+flock
+flockfile
+fnmatch
+fork
+fpathconf
+__fpending
+fprintf
+free
+freeaddrinfo
+freeifaddrs
+fseeko
+__fsetlocking
+fsetxattr
+fstat64
+fstat
+fstatfs
+fsync
+ftello
+ftime
+ftruncate
+funlockfile
+futimes
+futimesat
+gai_strerror
+gcvt
+getaddrinfo
+getc_unlocked
+getcwd
+getdelim
+getdomainname
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrent
+getgrent_r
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostbyaddr_r
+gethostbyname2
+gethostbyname
+gethostbyname_r
+gethostent
+gethostid
+gethostname
+getifaddrs
+getline
+getloadavg
+getmntent
+getmsg
+getnameinfo
+getnetbyaddr_r
+getnetgrent_r
+getopt
+getopt_long
+getopt_long_only
+getpagesize
+getpass
+getpeername
+getpgrp
+getpid
+getppid
+getprotoent_r
+getpwent
+getpwent_r
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresuid
+getrlimit
+getrusage
+getservbyname
+getservbyname_r
+getservbyport_r
+getservent
+getservent_r
+getspnam
+getspnam_r
+gettimeofday
+getttyent
+getttynam
+getuid
+getusershell
+getutent
+getutid
+getutline
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+getwd
+getxattr
+glob
+gmtime
+gmtime_r
+grantpt
+group_member
+herror
+hstrerror
+iconv
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_ntoa
+inet_ntop
+inet_pton
+initgroups
+innetgr
+iruserok
+isascii
+isatty
+isblank
+isgraph
+isinf
+isnan
+isprint
+isspace
+iswalnum
+iswcntrl
+iswctype
+iswprint
+iswspace
+iswupper
+isxdigit
+kill
+killpg
+lchown
+lckpwdf
+lgetxattr
+link
+listxattr
+llistxattr
+localtime
+localtime_r
+lockf
+lrand48
+lsearch
+lseek64
+lsetxattr
+lstat
+mallinfo
+malloc
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+mbtowc
+memalign
+memchr
+memcmp
+memcpy
+memmove
+mempcpy
+memrchr
+memset
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mkstemp64
+mkstemp
+mktime
+mlock
+mmap
+mtrace
+munlock
+munmap
+nanosleep
+nice
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+_obstack_free
+on_exit
+open64
+open
+openat
+opendir
+openlog
+pathconf
+pipe
+poll
+popen
+posix_memalign
+prctl
+pread
+printf
+__progname
+pselect
+pthread_mutex_lock
+ptsname
+putenv
+putgrent
+putpwent
+putspent
+pututline
+pututxline
+putwc
+pwrite
+qsort
+raise
+rand
+random
+rand_r
+read
+readdir
+readdir_r
+readlink
+realloc
+realpath
+re_comp
+recvmsg
+re_exec
+regcomp
+regexec
+remove
+rename
+re_search
+rmdir
+rpmatch
+rresvport_af
+ruserok
+ruserok_af
+sbrk
+scandir
+sched_setscheduler
+sched_yield
+__secure_getenv
+select
+semctl
+semget
+sendmsg
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+sethostname
+setitimer
+_setjmp
+setjmp
+setlinebuf
+setlocale
+setmntent
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setutxent
+setvbuf
+setxattr
+sgetspent
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigblock
+sigemptyset
+sighold
+siginterrupt
+signal
+sigprocmask
+sigset
+sigsetmask
+sigstack
+sigsuspend
+sigvec
+snprintf
+socket
+socketpair
+sprintf
+srand48
+srand
+srandom
+sscanf
+stat
+statfs
+statvfs
+stime
+stpcpy
+strcasecmp
+strcasestr
+strchr
+strchrnul
+strcmp
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strlen
+strncasecmp
+strncmp
+strndup
+strnlen
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok_r
+strtol
+strtoll
+strtoul
+strtoull
+strtoumax
+strverscmp
+strxfrm
+symlink
+sync
+sysconf
+sysctl
+sysinfo
+syslog
+_sys_siglist
+sys_siglist
+system
+tcgetattr
+tcgetpgrp
+tcsetattr
+tcsetpgrp
+time
+timegm
+times
+timezone
+tmpnam
+towlower
+towupper
+truncate
+tsearch
+ttyname
+tzset
+ulimit
+umask
+uname
+unlink
+unsetenv
+unshare
+updwtmp
+updwtmpx
+usleep
+ustat
+utime
+utimes
+utmpname
+utmpxname
+valloc
+vasprintf
+verrx
+vfork
+vfprintf
+vfscanf
+vhangup
+vprintf
+vsnprintf
+vsprintf
+wait3
+wait4
+waitpid
+wcrtomb
+wcscoll
+wcsdup
+wcslen
+wctob
+wctomb
+wctype
+wcwidth
+wmemchr
+wmemcpy
+wmempcpy
diff --git a/meta-tizen/recipes-BaseSystem/glibc/site_config/headers b/meta-tizen/recipes-BaseSystem/glibc/site_config/headers
new file mode 100644 (file)
index 0000000..609ab53
--- /dev/null
@@ -0,0 +1,156 @@
+aio.h
+alloca.h
+argz.h
+arpa/inet.h
+arpa/nameser.h
+asm/byteorder.h
+asm/ioctls.h
+asm/page.h
+asm/types.h
+assert.h
+byteswap.h
+crypt.h
+ctype.h
+dirent.h
+dlfcn.h
+elf.h
+endian.h
+err.h
+errno.h
+execinfo.h
+fcntl.h
+features.h
+float.h
+fstab.h
+ftw.h
+getopt.h
+glob.h
+grp.h
+iconv.h
+ifaddrs.h
+inttypes.h
+langinfo.h
+lastlog.h
+libgen.h
+libintl.h
+limits.h
+linux/capability.h
+linux/fd.h
+linux/fs.h
+linux/hayesesp.h
+linux/hdreg.h
+linux/icmp.h
+linux/in6.h
+linux/joystick.h
+linux/ptrace.h
+linux/serial.h
+linux/sonypi.h
+linux/unistd.h
+linux/utsname.h
+linux/version.h
+locale.h
+malloc.h
+math.h
+mcheck.h
+memory.h
+mntent.h
+mqueue.h
+netdb.h
+net/if.h
+netinet/ether.h
+netinet/in.h
+netinet/ip6.h
+netinet/ip.h
+netinet/tcp.h
+netinet/udp.h
+netipx/ipx.h
+net/route.h
+paths.h
+poll.h
+pthread.h
+pty.h
+pwd.h
+regex.h
+resolv.h
+rpc/rpc.h
+rpc/types.h
+sched.h
+scsi/scsi.h
+search.h
+semaphore.h
+setjmp.h
+sgtty.h
+shadow.h
+signal.h
+stdarg.h
+stdbool.h
+stdc
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+string.h
+strings.h
+stropts.h
+sys/bitypes.h
+sys/cdefs.h
+sys/dir.h
+sys/epoll.h
+sysexits.h
+sys/fcntl.h
+sys/file.h
+sys/fsuid.h
+sys/ioctl.h
+sys/ipc.h
+syslog.h
+sys/mman.h
+sys/mount.h
+sys/mtio.h
+sys/param.h
+sys/poll.h
+sys/prctl.h
+sys/ptrace.h
+sys/queue.h
+sys/reg.h
+sys/resource.h
+sys/select.h
+sys/sem.h
+sys/shm.h
+sys/signal.h
+sys/socket.h
+sys/socketvar.h
+sys/soundcard.h
+sys/statfs.h
+sys/stat.h
+sys/statvfs.h
+sys/stropts.h
+sys/swap.h
+sys/sysctl.h
+sys/sysinfo.h
+sys/sysmacros.h
+sys/termios.h
+sys/timeb.h
+sys/time.h
+sys/times.h
+sys/timex.h
+sys/types.h
+sys/uio.h
+sys/un.h
+sys/unistd.h
+sys/user.h
+sys/utsname.h
+sys/vfs.h
+sys/wait.h
+termio.h
+termios.h
+time.h
+ttyent.h
+ulimit.h
+unistd.h
+ustat.h
+utime.h
+utmp.h
+utmpx.h
+values.h
+wchar.h
+wctype.h
diff --git a/meta-tizen/recipes-BaseSystem/glibc/site_config/types b/meta-tizen/recipes-BaseSystem/glibc/site_config/types
new file mode 100644 (file)
index 0000000..178bd85
--- /dev/null
@@ -0,0 +1,21 @@
+char
+char *
+double
+float
+int
+long
+long double
+long int
+long long
+long long int
+short
+short int
+signed char
+unsigned char
+unsigned int
+unsigned long
+unsigned long int
+unsigned long long int
+unsigned short
+unsigned short int
+void *