files for using csl2005q3-2 toolchain
authorTomas Frydrych <tf@openedhand.com>
Mon, 18 Sep 2006 15:23:13 +0000 (15:23 +0000)
committerTomas Frydrych <tf@openedhand.com>
Mon, 18 Sep 2006 15:23:13 +0000 (15:23 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@723 311d38ba-8fff-0310-9ca6-ca027cbcb966

meta/conf/distro/include/poky-eabi-csl2005q3-2.inc [new file with mode: 0644]
meta/packages/binutils/binutils-cross_csl-arm-2005q3-2.bb [new file with mode: 0644]
meta/packages/binutils/binutils_csl-arm-2005q3-2.bb [new file with mode: 0644]
meta/packages/gcc/gcc-cross_csl-arm-2005q3-2.bb [new file with mode: 0644]
meta/packages/gcc/gcc_csl-arm-2005q3-2.bb [new file with mode: 0644]
meta/packages/glibc/files/nptl-crosscompile-2.3.6.patch [new file with mode: 0644]
meta/packages/glibc/glibc-initial_csl-2005q3-2.bb [new file with mode: 0644]
meta/packages/glibc/glibc-intermediate_csl-2005q3-2.bb [new file with mode: 0644]
meta/packages/glibc/glibc_csl-2005q3-2.bb [new file with mode: 0644]
meta/packages/linux-libc-headers/linux-libc-headers_csl-arm-2005q3-2.bb [new file with mode: 0644]

diff --git a/meta/conf/distro/include/poky-eabi-csl2005q3-2.inc b/meta/conf/distro/include/poky-eabi-csl2005q3-2.inc
new file mode 100644 (file)
index 0000000..0235e91
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Poky configuration to use EABI
+#
+
+PREFERRED_PROVIDER_virtual/arm-poky-linux-gnueabi-libc-for-gcc = "glibc-intermediate"
+PREFERRED_PROVIDER_virtual/arm-linux-libc-for-gcc = "glibc-intermediate"
+
+PREFERRED_VERSION_gcc ?= "3.4.4+csl-arm-2005q3-2"
+PREFERRED_VERSION_gcc-cross ?= "3.4.4+csl-arm-2005q3-2"
+PREFERRED_VERSION_gcc-cross-initial ?= "3.4.4+csl-arm-2005q3-2"
+PREFERRED_VERSION_binutils ?= "2.16+csl-arm-2005q3-2"
+PREFERRED_VERSION_binutils-cross ?= "2.16+csl-arm-2005q3-2"
+PREFERRED_VERSION_glibc ?= "2.3.6+csl-arm-2005q3-2"
+PREFERRED_VERSION_glibc-intermediate ?= "2.3.6+csl-arm-2005q3-2"
+
+PREFERRED_VERSION_linux-libc-headers ?= "2.6.12rc3+csl-arm-2005q3-2"
+
+#Use the ARM EABI when building for an ARM cpu. We can't use overrides
+#here because this breaks all places where ":=" is used.
+TARGET_VENDOR = "${@['','-poky'][bb.data.getVar('TARGET_ARCH',d,1)=='arm']}"
+TARGET_OS = "linux${@['','-gnueabi'][bb.data.getVar('TARGET_ARCH',d,1)=='arm']}"
diff --git a/meta/packages/binutils/binutils-cross_csl-arm-2005q3-2.bb b/meta/packages/binutils/binutils-cross_csl-arm-2005q3-2.bb
new file mode 100644 (file)
index 0000000..142dc46
--- /dev/null
@@ -0,0 +1,34 @@
+SECTION = "devel"
+require binutils_csl-arm-2005q3.bb
+inherit cross
+DEPENDS += "flex-native bison-native"
+PROVIDES = "virtual/${TARGET_PREFIX}binutils"
+FILESDIR = "${FILE_DIRNAME}/binutils-{PV}"
+PACKAGES = ""
+EXTRA_OECONF = "--with-sysroot=${CROSS_DIR}/${TARGET_SYS} \
+               --program-prefix=${TARGET_PREFIX}"
+
+S = "${WORKDIR}/binutils-2.17pre"
+
+do_stage () {
+       oe_runmake install
+
+       # We don't really need these, so we'll remove them...
+       rm -rf ${CROSS_DIR}/lib/ldscripts
+       rm -rf ${CROSS_DIR}/share/info
+       rm -rf ${CROSS_DIR}/share/locale
+       rm -rf ${CROSS_DIR}/share/man
+       rmdir ${CROSS_DIR}/share || :
+       rmdir ${CROSS_DIR}/${libdir}/gcc-lib || :
+       rmdir ${CROSS_DIR}/${libdir} || :
+       rmdir ${CROSS_DIR}/${prefix} || :
+
+       # We want to move this into the target specific location
+       mkdir -p ${CROSS_DIR}/${TARGET_SYS}/lib
+       mv -f ${CROSS_DIR}/lib/libiberty.a ${CROSS_DIR}/${TARGET_SYS}/lib
+       rmdir ${CROSS_DIR}/lib || :
+}
+
+do_install () {
+       :
+}
diff --git a/meta/packages/binutils/binutils_csl-arm-2005q3-2.bb b/meta/packages/binutils/binutils_csl-arm-2005q3-2.bb
new file mode 100644 (file)
index 0000000..c5e71af
--- /dev/null
@@ -0,0 +1,137 @@
+DESCRIPTION = "A GNU collection of binary utilities"
+HOMEPAGE = "http://www.gnu.org/software/binutils/"
+SECTION = "devel"
+LICENSE = "GPL"
+DEFAULT_PREFERENCE = "-1"
+
+BINV = "2.16"
+PV = "2.16+csl-arm-2005q3-2"
+
+FILESDIR = "${FILE_DIRNAME}/binutils-${PV}"
+
+S = "${WORKDIR}/binutils-2.17pre"
+
+inherit autotools gettext
+
+PACKAGES = "${PN} ${PN}-dev ${PN}-doc ${PN}-symlinks"
+
+FILES_${PN} = " \
+       ${bindir}/${TARGET_PREFIX}* \
+       ${libdir}/lib*-*.so \
+       ${prefix}/${TARGET_SYS}/bin/*"
+
+FILES_${PN}-dev = " \
+       ${includedir} \
+       ${libdir}/*.a \
+       ${libdir}/*.la \
+       ${libdir}/libbfd.so \
+       ${libdir}/libopcodes.so"
+
+FILES_${PN}-symlinks = " \
+       ${bindir}/addr2line \
+       ${bindir}/ar \
+       ${bindir}/as \
+       ${bindir}/c++filt \
+       ${bindir}/gprof \
+       ${bindir}/ld \
+       ${bindir}/nm \
+       ${bindir}/objcopy \
+       ${bindir}/objdump \
+       ${bindir}/ranlib \
+       ${bindir}/readelf \
+       ${bindir}/size \
+       ${bindir}/strings \
+       ${bindir}/strip"
+
+SRC_URI = \
+    "http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2005q3-2-arm-none-linux-gnueabi.src.tar.bz2 \
+#     file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch;patch=1;pnum=1\
+#    file://binutils-uclibc-100-uclibc-conf.patch;patch=1;pnum=1 \
+#     file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1;pnum=1 \
+#     file://binutils-uclibc-300-006_better_file_error.patch;patch=1;pnum=1 \
+#     file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1;pnum=1 \
+#     file://binutils-uclibc-400-mips-ELF_MAXPAGESIZE-4K.patch;patch=1;pnum=1 \
+#     file://binutils-uclibc-702-binutils-skip-comments.patch;patch=1;pnum=1  \
+      "
+do_unpack2() {
+       cd ${WORKDIR}
+       pwd
+       tar -xvjf ./arm-2005q3-2-arm-none-linux-gnueabi/binutils-2005q3-2.tar.bz2
+}
+
+addtask unpack2 after do_unpack before do_patch
+
+B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
+
+EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
+               --enable-shared"
+
+# This is necessary due to a bug in the binutils Makefiles
+EXTRA_OEMAKE = "configure-build-libiberty all"
+
+export AR = "${HOST_PREFIX}ar"
+export AS = "${HOST_PREFIX}as"
+export LD = "${HOST_PREFIX}ld"
+export NM = "${HOST_PREFIX}nm"
+export RANLIB = "${HOST_PREFIX}ranlib"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
+export OBJDUMP = "${HOST_PREFIX}objdump"
+
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+
+export CC_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+export CXX_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+
+export CC_FOR_BUILD = "${BUILD_CC}"
+export CPP_FOR_BUILD = "${BUILD_CPP}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
+
+export CC = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+
+do_configure () {
+       (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+       oe_runconf
+}
+
+do_stage () {
+       oe_libinstall -so -a -C opcodes libopcodes ${STAGING_LIBDIR}/
+       oe_libinstall -a -C libiberty libiberty ${STAGING_LIBDIR}/
+       oe_libinstall -so -a -C bfd libbfd ${STAGING_LIBDIR}/
+       install -m 0644 ${S}/include/dis-asm.h ${STAGING_INCDIR}/
+       install -m 0644 ${S}/include/symcat.h ${STAGING_INCDIR}/
+       install -m 0644 ${S}/include/libiberty.h ${STAGING_INCDIR}/
+       install -m 0644 ${S}/include/ansidecl.h ${STAGING_INCDIR}/
+       install -m 0644 ${S}/include/bfdlink.h ${STAGING_INCDIR}/
+       install -m 0644 bfd/bfd.h ${STAGING_INCDIR}/
+}
+
+do_install () {
+       autotools_do_install
+
+       # We don't really need these, so we'll remove them...
+       rm -rf ${D}${libdir}/ldscripts
+
+       # Fix the /usr/${TARGET_SYS}/bin/* links
+       for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
+               rm -f $l
+               ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
+                       | tr -s / \
+                       | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
+       done
+
+       # Install the libiberty header
+       install -d ${D}${includedir}
+       install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+       install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+       cd ${D}${bindir}
+
+       # Symlinks for ease of running these on the native target
+       for p in ${TARGET_SYS}-* ; do
+               ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
+       done
+}
diff --git a/meta/packages/gcc/gcc-cross_csl-arm-2005q3-2.bb b/meta/packages/gcc/gcc-cross_csl-arm-2005q3-2.bb
new file mode 100644 (file)
index 0000000..d144191
--- /dev/null
@@ -0,0 +1,16 @@
+require gcc_csl-arm-2005q3.bb
+# path mangling, needed by the cross packaging
+require gcc-paths-cross.inc
+inherit cross
+# NOTE: split PR.  If the main .oe changes something that affects its *build*
+# remember to increment this one too.
+PR = "r0"
+PV = "3.4.4+csl-arm-2005q3-2"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+# cross build
+require gcc3-build-cross.inc
+# cross packaging
+require gcc-package-cross.inc
diff --git a/meta/packages/gcc/gcc_csl-arm-2005q3-2.bb b/meta/packages/gcc/gcc_csl-arm-2005q3-2.bb
new file mode 100644 (file)
index 0000000..6a39587
--- /dev/null
@@ -0,0 +1,27 @@
+DESCRIPTION = "The GNU cc and gcc C compilers."
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+BINV = "3.4.4"
+PV = "3.4.4+csl-arm-2005q3-2"
+PR = "r1"
+
+FILESDIR = "${FILE_DIRNAME}/gcc-csl-arm"
+
+inherit autotools gettext
+
+require gcc-package.inc
+
+SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2005q3-2-arm-none-linux-gnueabi.src.tar.bz2"
+
+do_unpack2() {
+       cd ${WORKDIR}
+       tar -xvjf ./arm-2005q3-2-arm-none-linux-gnueabi/gcc-2005q3-2.tar.bz2
+       rm -rf ./arm-2005q3-2-arm-none-linux-gnueabi
+}
+
+addtask unpack2 after do_unpack before do_patch
+
+require gcc3-build.inc
+
+S = "${WORKDIR}/gcc-2005q3"
diff --git a/meta/packages/glibc/files/nptl-crosscompile-2.3.6.patch b/meta/packages/glibc/files/nptl-crosscompile-2.3.6.patch
new file mode 100644 (file)
index 0000000..2df3cd9
--- /dev/null
@@ -0,0 +1,175 @@
+diff
+--- glibc-2.3.6/nptl/sysdeps/pthread/configure.in.orig 2006-09-14 11:12:16.000000000 +0100
++++ glibc-2.3.6/nptl/sysdeps/pthread/configure.in      2006-09-14 11:12:16.000000000 +0100
+@@ -21,29 +21,4 @@
+ dnl Iff <unwind.h> is available, make sure it is the right one and it
+ dnl contains struct _Unwind_Exception.
+-AC_CACHE_CHECK(dnl
+-for forced unwind support, libc_cv_forced_unwind, [dnl
+-AC_TRY_LINK([#include <unwind.h>], [
+-struct _Unwind_Exception exc;
+-struct _Unwind_Context *context;
+-_Unwind_GetCFA (context)],
+-libc_cv_forced_unwind=yes, libc_cv_forced_unwind=no)])
+-if test $libc_cv_forced_unwind = yes; then
+-  AC_DEFINE(HAVE_FORCED_UNWIND)
+-dnl Check for C cleanup handling.
+-  old_CFLAGS="$CFLAGS"
+-  CFLAGS="$CFLAGS -Werror -fexceptions"
+-  AC_CACHE_CHECK([for C cleanup handling], libc_cv_c_cleanup, [dnl
+-  AC_TRY_LINK([
+-#include <stdio.h>
+-void cl (void *a) { }], [
+-  int a __attribute__ ((cleanup (cl)));
+-  puts ("test")],
+-libc_cv_c_cleanup=yes, libc_cv_c_cleanup=no)])
+-  CFLAGS="$old_CFLAGS"
+-  if test $libc_cv_c_cleanup = no; then
+-    AC_MSG_ERROR([the compiler must support C cleanup handling])
+-  fi
+-else
+-  AC_MSG_ERROR(forced unwind support is required)
+-fi
++AC_DEFINE(HAVE_FORCED_UNWIND)
+diff
+--- glibc-2.3.6/nptl/sysdeps/pthread/configure.orig    2006-09-14 11:11:12.000000000 +0100
++++ glibc-2.3.6/nptl/sysdeps/pthread/configure 2006-09-14 11:11:12.000000000 +0100
+@@ -24,136 +24,7 @@
+ fi
+-echo "$as_me:$LINENO: checking for forced unwind support" >&5
+-echo $ECHO_N "checking for forced unwind support... $ECHO_C" >&6
+-if test "${libc_cv_forced_unwind+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-  cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-#include <unwind.h>
+-int
+-main ()
+-{
+-
+-struct _Unwind_Exception exc;
+-struct _Unwind_Context *context;
+-_Unwind_GetCFA (context)
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-       { ac_try='test -z "$ac_c_werror_flag"
+-                       || test ! -s conftest.err'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; } &&
+-       { ac_try='test -s conftest$ac_exeext'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  libc_cv_forced_unwind=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-libc_cv_forced_unwind=no
+-fi
+-rm -f conftest.err conftest.$ac_objext \
+-      conftest$ac_exeext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $libc_cv_forced_unwind" >&5
+-echo "${ECHO_T}$libc_cv_forced_unwind" >&6
+-if test $libc_cv_forced_unwind = yes; then
+-  cat >>confdefs.h <<\_ACEOF
++cat >>confdefs.h <<\_ACEOF
+ #define HAVE_FORCED_UNWIND 1
+ _ACEOF
+-  old_CFLAGS="$CFLAGS"
+-  CFLAGS="$CFLAGS -Werror -fexceptions"
+-  echo "$as_me:$LINENO: checking for C cleanup handling" >&5
+-echo $ECHO_N "checking for C cleanup handling... $ECHO_C" >&6
+-if test "${libc_cv_c_cleanup+set}" = set; then
+-  echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-    cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-
+-#include <stdio.h>
+-void cl (void *a) { }
+-int
+-main ()
+-{
+-
+-  int a __attribute__ ((cleanup (cl)));
+-  puts ("test")
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>conftest.er1
+-  ac_status=$?
+-  grep -v '^ *+' conftest.er1 >conftest.err
+-  rm -f conftest.er1
+-  cat conftest.err >&5
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-       { ac_try='test -z "$ac_c_werror_flag"
+-                       || test ! -s conftest.err'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; } &&
+-       { ac_try='test -s conftest$ac_exeext'
+-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+-  (eval $ac_try) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  libc_cv_c_cleanup=yes
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-libc_cv_c_cleanup=no
+-fi
+-rm -f conftest.err conftest.$ac_objext \
+-      conftest$ac_exeext conftest.$ac_ext
+-fi
+-echo "$as_me:$LINENO: result: $libc_cv_c_cleanup" >&5
+-echo "${ECHO_T}$libc_cv_c_cleanup" >&6
+-  CFLAGS="$old_CFLAGS"
+-  if test $libc_cv_c_cleanup = no; then
+-    { { echo "$as_me:$LINENO: error: the compiler must support C cleanup handling" >&5
+-echo "$as_me: error: the compiler must support C cleanup handling" >&2;}
+-   { (exit 1); exit 1; }; }
+-  fi
+-else
+-  { { echo "$as_me:$LINENO: error: forced unwind support is required" >&5
+-echo "$as_me: error: forced unwind support is required" >&2;}
+-   { (exit 1); exit 1; }; }
+-fi
diff --git a/meta/packages/glibc/glibc-initial_csl-2005q3-2.bb b/meta/packages/glibc/glibc-initial_csl-2005q3-2.bb
new file mode 100644 (file)
index 0000000..9ba2ac3
--- /dev/null
@@ -0,0 +1,46 @@
+SECTION = "libs"
+require glibc_${PV}.bb
+
+DEPENDS = "linux-libc-headers"
+PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/glibc-2.4', '${FILE_DIRNAME}/glibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
+
+PACKAGES = ""
+
+do_configure () {
+       sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure
+       chmod +x ${S}/configure
+       CC="${BUILD_CC}" CPP="${BUILD_CPP}" LD="${BUILD_LD}" ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
+               --without-cvs --disable-sanity-checks \
+               --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
+               --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
+}
+
+do_compile () {
+       :
+}
+
+do_stage () {
+       oe_runmake cross-compiling=yes install_root=${CROSS_DIR}/${TARGET_SYS} prefix="" install-headers
+
+       # 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 ${CROSS_DIR}/${TARGET_SYS}/include/gnu
+       touch ${CROSS_DIR}/${TARGET_SYS}/include/gnu/stubs.h
+       cp ${S}/include/features.h ${CROSS_DIR}/${TARGET_SYS}/include/features.h
+}
+
+do_install () {
+       :
+}
diff --git a/meta/packages/glibc/glibc-intermediate_csl-2005q3-2.bb b/meta/packages/glibc/glibc-intermediate_csl-2005q3-2.bb
new file mode 100644 (file)
index 0000000..b6a0a55
--- /dev/null
@@ -0,0 +1,16 @@
+SECTION = "libs"
+
+require glibc_${PV}.bb
+
+DEFAULT_PREFERENCE = "-1"
+
+do_install () {
+       :
+}
+
+PACKAGES = ""
+PROVIDES = "virtual/${TARGET_PREFIX}libc-for-gcc"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial linux-libc-headers"
+GLIBC_ADDONS = "nptl,libidn"
+#GLIBC_ADDONS = "libidn"
+GLIBC_EXTRA_OECONF = ""
diff --git a/meta/packages/glibc/glibc_csl-2005q3-2.bb b/meta/packages/glibc/glibc_csl-2005q3-2.bb
new file mode 100644 (file)
index 0000000..754c01c
--- /dev/null
@@ -0,0 +1,155 @@
+DESCRIPTION = "GNU C Library"
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+LICENSE = "LGPL"
+SECTION = "libs"
+PRIORITY = "required"
+# DEFAULT_PREFERENCE = "-1"
+PV = "2.3.6+csl-arm-2005q3-2"
+PR = "r10"
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_DIR}/${BUILD_SYS}/include"
+TARGET_CPPFLAGS = "-I${STAGING_DIR}/${TARGET_SYS}/include"
+
+FILESDIR = "${FILE_DIRNAME}/files"
+
+GLIBC_ADDONS ?= "nptl,libidn"
+GLIBC_EXTRA_OECONF ?= ""
+
+GLIBC_BROKEN_LOCALES = "sid_ET tr_TR mn_MN gez_ET bn_BD gez_ER te_IN"
+
+#
+# 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$', bb.data.getVar('TARGET_OS', d, 1)) != None)
+    if uc_os:
+        raise bb.parse.SkipPackage("incompatible with target %s" %
+                                   bb.data.getVar('TARGET_OS', d, 1))
+}
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+PROVIDES = "virtual/libc ${@['virtual/${TARGET_PREFIX}libc-for-gcc', '']['nptl' in '${GLIBC_ADDONS}']}"
+PROVIDES += "virtual/libintl virtual/libiconv"
+DEPENDS = "${@['virtual/${TARGET_PREFIX}gcc-initial', 'virtual/${TARGET_PREFIX}gcc']['nptl' in '${GLIBC_ADDONS}']} linux-libc-headers"
+RDEPENDS_${PN}-dev = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2005q3-2-arm-none-linux-gnueabi.src.tar.bz2 \
+           file://nptl-crosscompile-2.3.6.patch;patch=1 \
+           file://etc/ld.so.conf \
+          file://generate-supported.mk \
+          "
+
+do_unpack2() {
+       cd ${WORKDIR}
+       tar -xvjf ./arm-2005q3-2-arm-none-linux-gnueabi/glibc-2005q3-2.tar.bz2
+       rm -rf ./arm-2005q3-2-arm-none-linux-gnueabi
+}
+
+addtask unpack2 after do_unpack before do_patch
+
+S = "${WORKDIR}/glibc-2.3.5pre"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+inherit autotools
+
+EXTRA_OECONF = "--without-cvs --disable-profile --disable-debug --without-gd \
+               --enable-clocale=gnu \
+               --enable-add-ons \
+               --with-headers=${STAGING_INCDIR} \
+               --without-selinux \
+               ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
+
+def get_glibc_fpu_setting(bb, d):
+       if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
+               return "--without-fp"
+       return ""
+
+
+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"
+       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 || oewarn "unable to generate header for $r"
+               done
+       )
+}
+
+do_stage() {
+       rm -f ${STAGING_LIBDIR}/libc.so.6
+       oe_runmake 'install_root=${STAGING_DIR}/${HOST_SYS}' \
+                  'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
+                  '${STAGING_LIBDIR}/libc.so.6' \
+                  install-headers install-lib
+
+       install -d ${STAGING_INCDIR}/gnu \
+                  ${STAGING_INCDIR}/bits \
+                  ${STAGING_INCDIR}/rpcsvc
+       install -m 0644 ${S}/include/gnu/stubs.h ${STAGING_INCDIR}/gnu/
+       install -m 0644 ${B}/bits/stdio_lim.h ${STAGING_INCDIR}/bits/
+       install -m 0644 misc/syscall-list.h ${STAGING_INCDIR}/bits/syscall.h
+       for r in ${rpcsvc}; do
+               h=`echo $r|sed -e's,\.x$,.h,'`
+               install -m 0644 ${S}/sunrpc/rpcsvc/$h ${STAGING_INCDIR}/rpcsvc/
+       done
+       for i in libc.a libc_pic.a libc_nonshared.a; do
+               install -m 0644 ${B}/$i ${STAGING_LIBDIR}/ || die "failed to install $i"
+       done
+       echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${STAGING_LIBDIR}/libpthread.so
+       echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${STAGING_LIBDIR}/libc.so
+
+       rm -f ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6
+       oe_runmake 'install_root=${CROSS_DIR}/${TARGET_SYS}' \
+                  'includedir=/include' 'libdir=/lib' 'slibdir=/lib' \
+                  '${CROSS_DIR}/${TARGET_SYS}/lib/libc.so.6' \
+                  install-headers install-lib
+
+       install -d ${CROSS_DIR}/${TARGET_SYS}/include/gnu \
+                  ${CROSS_DIR}/${TARGET_SYS}/include/bits \
+                  ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc
+       install -m 0644 ${S}/include/gnu/stubs.h ${CROSS_DIR}/${TARGET_SYS}/include/gnu/
+       install -m 0644 ${B}/bits/stdio_lim.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/
+       install -m 0644 misc/syscall-list.h ${CROSS_DIR}/${TARGET_SYS}/include/bits/syscall.h
+       for r in ${rpcsvc}; do
+               h=`echo $r|sed -e's,\.x$,.h,'`
+               install -m 0644 ${S}/sunrpc/rpcsvc/$h ${CROSS_DIR}/${TARGET_SYS}/include/rpcsvc/
+       done
+
+       for i in libc.a libc_pic.a libc_nonshared.a; do
+               install -m 0644 ${B}/$i ${CROSS_DIR}/${TARGET_SYS}/lib/ || die "failed to install $i"
+       done
+       echo 'GROUP ( libpthread.so.0 libpthread_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libpthread.so
+       echo 'GROUP ( libc.so.6 libc_nonshared.a )' > ${CROSS_DIR}/${TARGET_SYS}/lib/libc.so
+}
+
+require glibc-package.bbclass
diff --git a/meta/packages/linux-libc-headers/linux-libc-headers_csl-arm-2005q3-2.bb b/meta/packages/linux-libc-headers/linux-libc-headers_csl-arm-2005q3-2.bb
new file mode 100644 (file)
index 0000000..136d9e7
--- /dev/null
@@ -0,0 +1,88 @@
+SECTION = "devel"
+DESCRIPTION = "Sanitized set of 2.6 kernel headers for the C library's use."
+# This package is derived from the original linux-libc-headers at
+#   http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
+# More specifically, llh-2.6.12.0 was patched up to 2.6.16-rc6 with 
+# the official linux patches (where applicable) and then fixed up just
+# enough to build glibc-2.4. BEWARE!
+#
+# license note from the linux-libc-headers package: 
+#   Linux-libc-headers are derived from linux kernel headers. For license of a
+#   particular header, check it's content, and if copyright notice isn't present,
+#   standard linux kernel license applies. 
+# since we assume GPL for linux i think we can also assume it here
+LICENSE = "GPL"
+DEFAULT_PREFERENCE = "-1"
+INHIBIT_DEFAULT_DEPS = "1"
+PR = "r4"
+PV = "2.6.12rc3+csl-arm-2005q3-2"
+
+SRC_URI = "http://www.codesourcery.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-2005q3-2-arm-none-linux-gnueabi.src.tar.bz2"
+
+#unpack the inner tarball, extract the include directory and do little
+#cleanup
+do_unpack2() {
+       cd ${WORKDIR}
+       tar -xvjf ./arm-2005q3-2-arm-none-linux-gnueabi/linux-2005q3-2.tar.bz2
+       mkdir -p linux-include
+       mv ./linux-2.6.12rc3/include ./linux-include
+       rm ./linux-include/include/asm-arm/arch
+       rm -rf ./arm-2005q3-2-arm-none-linux-gnuabi
+       rm -rf ./linux-2.6.12.rc3
+}
+
+addtask unpack2 after do_unpack before do_patch
+
+S = "${WORKDIR}/linux-include"
+
+do_configure () {
+       case ${TARGET_ARCH} in
+               alpha*)   ARCH=alpha ;;
+               arm*)     ARCH=arm ;;
+               cris*)    ARCH=cris ;;
+               hppa*)    ARCH=parisc ;;
+               i*86*)    ARCH=i386 ;;
+               ia64*)    ARCH=ia64 ;;
+               mips*)    ARCH=mips ;;
+               m68k*)    ARCH=m68k ;;
+               powerpc*) ARCH=ppc ;;
+               s390*)    ARCH=s390 ;;
+               sh*)      ARCH=sh ;;
+               sparc64*) ARCH=sparc64 ;;
+               sparc*)   ARCH=sparc ;;
+               x86_64*)  ARCH=x86_64 ;;
+       esac
+       if test !  -e include/asm-$ARCH; then
+               oefatal unable to create asm symlink in kernel headers
+       fi
+       rm "include/asm"
+       cp -pPR "include/asm-$ARCH" "include/asm"
+       if test "$ARCH" = "arm"; then
+               cp -pPR include/asm/arch-ebsa285 include/asm/arch
+       elif test "$ARCH" = "sh"; then
+               cp -pPR include/asm/cpu-${TARGET_ARCH} include/asm/cpu || die "unable to create include/asm/cpu"
+       fi
+}
+
+do_stage () {
+       install -d ${STAGING_INCDIR}
+       rm -rf ${STAGING_INCDIR}/linux ${STAGING_INCDIR}/asm ${STAGING_INCDIR}/asm-generic
+       cp -pfLR include/linux ${STAGING_INCDIR}/
+       cp -pfLR include/asm ${STAGING_INCDIR}/
+       cp -pfLR include/asm-generic ${STAGING_INCDIR}/
+       rm -rf ${CROSS_DIR}/${TARGET_SYS}/include/linux
+       rm -rf ${CROSS_DIR}/${TARGET_SYS}/include/asm
+       rm -rf ${CROSS_DIR}/${TARGET_SYS}/include/asm-generic
+       install -d ${CROSS_DIR}/${TARGET_SYS}/include
+       cp -pfLR include/linux ${CROSS_DIR}/${TARGET_SYS}/include/
+       cp -pfLR include/asm ${CROSS_DIR}/${TARGET_SYS}/include/
+       cp -pfLR include/asm-generic ${CROSS_DIR}/${TARGET_SYS}/include/
+}
+
+do_install() {
+       install -d ${D}${includedir}
+       cp -pfLR include/linux ${D}${includedir}/
+       cp -pfLR include/asm ${D}${includedir}/
+       cp -pfLR include/asm-generic ${D}${includedir}/
+}
+