From c6a662cd60d585a10b83a3642de36b48bb15e5ac Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Mon, 31 May 2010 01:26:40 +0200 Subject: klibc: add some patches to 1.5.17 and make it build vs. old kernels. * increase default preference, tested on arm --- .../klibc/klibc-1.5.17/arm-signal-cleanup.patch | 18 +++ recipes/klibc/klibc-1.5.17/socket.h.patch | 160 +++++++++++++++++++++ recipes/klibc/klibc_1.5.17.bb | 2 +- recipes/klibc/klibc_1.5.17.inc | 4 +- 4 files changed, 182 insertions(+), 2 deletions(-) create mode 100644 recipes/klibc/klibc-1.5.17/arm-signal-cleanup.patch create mode 100644 recipes/klibc/klibc-1.5.17/socket.h.patch diff --git a/recipes/klibc/klibc-1.5.17/arm-signal-cleanup.patch b/recipes/klibc/klibc-1.5.17/arm-signal-cleanup.patch new file mode 100644 index 0000000000..b95d6aec95 --- /dev/null +++ b/recipes/klibc/klibc-1.5.17/arm-signal-cleanup.patch @@ -0,0 +1,18 @@ +Index: klibc-1.5.15/usr/include/arch/arm/klibc/archsignal.h +=================================================================== +--- klibc-1.5.15.orig/usr/include/arch/arm/klibc/archsignal.h 2010-03-20 01:06:35.000000000 +0100 ++++ klibc-1.5.15/usr/include/arch/arm/klibc/archsignal.h 2010-05-30 18:08:47.000000000 +0200 +@@ -104,7 +104,12 @@ + #define MINSIGSTKSZ 2048 + #define SIGSTKSZ 8192 + ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31) + #include ++#else ++#include ++#endif + + /* This uses gcc anonymous union support... */ + struct siginfo; + diff --git a/recipes/klibc/klibc-1.5.17/socket.h.patch b/recipes/klibc/klibc-1.5.17/socket.h.patch new file mode 100644 index 0000000000..71c93729d8 --- /dev/null +++ b/recipes/klibc/klibc-1.5.17/socket.h.patch @@ -0,0 +1,160 @@ +upstream: http://www.zytor.com/pipermail/klibc/2010-February/002486.html,http://www.zytor.com/pipermail/klibc/2010-February/002487.html,http://www.zytor.com/pipermail/klibc/2010-February/002488.html +status: pending +comment: squashed 3 commits togheter + +Subject: Add relevant socket.h definitions +From: maximilian attems +Date: Tue Feb 23 06:02:42 PST 2010 + + +linux-2.6 9c501935a3cdcf6b1d35aaee3aa11c7a7051a305 cleaned + from allmost any userspace export. + +thus define the stuff that used to be there in klibc socket.h + +Signed-off-by: maximilian attems + +Modified for compatibility with pre 2.6.33 kernels in OpenEmbedded +--- +Index: klibc-1.5.16/usr/include/sys/socket.h +=================================================================== +--- a/usr/include/sys/socket.h 2010-03-13 22:33:51.000000000 +0100 ++++ b/usr/include/sys/socket.h 2010-05-31 00:44:16.000000000 +0200 +@@ -9,6 +9,14 @@ + #include + #include + #include ++ ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#include /* the SIOCxxx I/O controls */ ++#include /* iovec support */ ++#include /* arch-dependent defines */ ++#endif ++ + #include + #include + #if _KLIBC_HAS_ARCHSOCKET_H +@@ -29,6 +37,8 @@ + # define SOCK_PACKET 10 + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++ + #ifndef AF_INET + #define AF_UNSPEC 0 + #define AF_UNIX 1 /* Unix domain sockets */ +@@ -148,7 +158,12 @@ + sa_family_t sa_family; /* address family, AF_xxx */ + char sa_data[14]; /* 14 bytes of protocol address */ + }; ++ ++#endif ++ + typedef int socklen_t; ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) + struct msghdr { + void *msg_name; + int msg_namelen; +@@ -158,7 +173,7 @@ + size_t msg_controllen; + unsigned msg_flags; + }; +- ++#endif + + __extern int socket(int, int, int); + __extern int bind(int, struct sockaddr *, int); +Index: klibc-1.5.16/usr/kinit/nfsmount/nfsmount.h +=================================================================== +--- a/usr/kinit/nfsmount/nfsmount.h 2009-01-04 20:28:03.000000000 +0100 ++++ b/usr/kinit/nfsmount/nfsmount.h 2010-05-30 23:00:36.000000000 +0200 +@@ -3,6 +3,12 @@ + + #include + ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++#define MNTPROC_MNT 1 ++#define MNTPROC_UMNT 3 ++#endif ++ + extern int nfs_port; + + extern int nfsmount_main(int argc, char *argv[]); +Index: klibc-1.5.16/usr/kinit/nfsmount/dummypmap.c +=================================================================== +--- a/usr/kinit/nfsmount/dummypmap.c 2009-01-04 20:28:03.000000000 +0100 ++++ b/usr/kinit/nfsmount/dummypmap.c 2010-05-30 23:08:29.000000000 +0200 +@@ -39,7 +39,12 @@ + + static int bind_portmap(void) + { ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++ int sock = socket(AF_INET, SOCK_DGRAM, 0); ++#else + int sock = socket(PF_INET, SOCK_DGRAM, 0); ++#endif + struct sockaddr_in sin; + + if (sock < 0) +Index: klibc-1.5.16/usr/kinit/nfsmount/mount.c +=================================================================== +--- a/usr/kinit/nfsmount/mount.c 2010-05-30 22:30:26.000000000 +0200 ++++ b/usr/kinit/nfsmount/mount.c 2010-05-30 23:13:15.000000000 +0200 +@@ -294,11 +294,21 @@ + } + mounted = 1; + ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++ if (data->flags & NFS_MOUNT_TCP) { ++ sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); ++ } else { ++ sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); ++ } ++#else + if (data->flags & NFS_MOUNT_TCP) { + sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + } else { + sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP); + } ++#endif ++ + + if (sock == -1) { + perror("socket"); +Index: klibc-1.5.16/usr/kinit/nfsmount/sunrpc.c +=================================================================== +--- a/usr/kinit/nfsmount/sunrpc.c 2009-01-04 20:28:03.000000000 +0100 ++++ b/usr/kinit/nfsmount/sunrpc.c 2010-05-30 23:11:12.000000000 +0200 +@@ -152,7 +152,12 @@ + + memset(clnt, 0, sizeof(clnt)); + ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++ if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { ++#else + if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { ++#endif + perror("socket"); + goto bail; + } +@@ -197,7 +202,12 @@ + + memset(clnt, 0, sizeof(clnt)); + ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33) ++ if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { ++#else + if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) { ++#endif + perror("socket"); + goto bail; + } +-- +1.6.6.1 diff --git a/recipes/klibc/klibc_1.5.17.bb b/recipes/klibc/klibc_1.5.17.bb index 4b299f226e..694bf5849b 100644 --- a/recipes/klibc/klibc_1.5.17.bb +++ b/recipes/klibc/klibc_1.5.17.bb @@ -1,3 +1,3 @@ require klibc.inc require klibc_${PV}.inc -PR = "${INC_PR}.0" +PR = "${INC_PR}.1" diff --git a/recipes/klibc/klibc_1.5.17.inc b/recipes/klibc/klibc_1.5.17.inc index 69d0dc7ea6..db571cdfa5 100644 --- a/recipes/klibc/klibc_1.5.17.inc +++ b/recipes/klibc/klibc_1.5.17.inc @@ -7,10 +7,12 @@ SRC_URI += "file://fstype-sane-vfat-and-jffs2-for-1.5.patch \ file://staging.patch \ file://klibc_kexecsyscall.patch \ file://mntproc-definitions.patch \ + file://arm-signal-cleanup.patch \ + file://socket.h.patch \ file://isystem.patch \ " -DEFAULT_PREFERENCE = "-1" +DEFAULT_PREFERENCE = "1" DEFAULT_PREFERENCE_aquides = "1" KLIBC_FETCHDIR = "1.5" -- cgit 1.2.3-korg