summaryrefslogtreecommitdiffstats
path: root/meta/packages
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-12-20 11:56:07 +0000
committerRichard Purdie <richard@openedhand.com>2006-12-20 11:56:07 +0000
commite46b2474872492e0e92d6bb43d6d1bda33057c06 (patch)
tree692df16dbb17cfb18d0b6178ec3ab361a77679ad /meta/packages
parent82e21d5600bd9769e929bdc4ac84a2191e7e1d47 (diff)
downloadpoky-e46b2474872492e0e92d6bb43d6d1bda33057c06.tar.gz
glibc 2.5: Sync with OE.dev
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1061 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages')
-rw-r--r--meta/packages/glibc/glibc-2.5/glibc-check_pf.patch343
-rw-r--r--meta/packages/glibc/glibc-initial_2.5.bb45
-rw-r--r--meta/packages/glibc/glibc_2.5.bb17
3 files changed, 394 insertions, 11 deletions
diff --git a/meta/packages/glibc/glibc-2.5/glibc-check_pf.patch b/meta/packages/glibc/glibc-2.5/glibc-check_pf.patch
new file mode 100644
index 0000000000..3cff6bbcfa
--- /dev/null
+++ b/meta/packages/glibc/glibc-2.5/glibc-check_pf.patch
@@ -0,0 +1,343 @@
1From libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org Tue Oct 31 17:37:21 2006
2Return-Path: <libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org>
3Delivered-To: listarch-libc-ports at sources dot redhat dot com
4Received: (qmail 17273 invoked by alias); 31 Oct 2006 17:37:20 -0000
5Received: (qmail 17262 invoked by uid 22791); 31 Oct 2006 17:37:19 -0000
6X-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,TW_CP
7X-Spam-Check-By: sourceware.org
8Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 31 Oct 2006 17:37:11 +0000
9Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GexXw-0007Dj-30; Tue, 31 Oct 2006 12:37:08 -0500
10Date: Tue, 31 Oct 2006 12:37:08 -0500
11From: Daniel Jacobowitz <drow at false dot org>
12To: Mike Frysinger <vapier at gentoo dot org>
13Cc: libc-ports at sourceware dot org, Philip Balister <philip dot balister at gmail dot com>
14Subject: Re: Problem with glibc-2.5 on ARM
15Message-ID: <20061031173708.GJ20468@nevyn.them.org>
16References: <499146270610241149ibe030e0nd9d6b177a95b346e@mail.gmail.com> <499146270610241254u7cadf63ej2edf05cedbc5266f@mail.gmail.com> <20061024195837.GA20181@nevyn.them.org> <200610291954.27022.vapier@gentoo.org>
17MIME-Version: 1.0
18Content-Type: text/plain; charset=us-ascii
19Content-Disposition: inline
20In-Reply-To: <200610291954 dot 27022 dot vapier at gentoo dot org>
21User-Agent: Mutt/1.5.13 (2006-08-11)
22X-IsSubscribed: yes
23Mailing-List: contact libc-ports-help at sourceware dot org; run by ezmlm
24Precedence: bulk
25List-Subscribe: <mailto:libc-ports-subscribe at sourceware dot org>
26List-Post: <mailto:libc-ports at sourceware dot org>
27List-Help: <mailto:libc-ports-help at sourceware dot org>, <http://sourceware dot org/lists dot html#faqs>
28Sender: libc-ports-owner at sourceware dot org
29Delivered-To: mailing list libc-ports at sourceware dot org
30
31On Sun, Oct 29, 2006 at 07:54:25PM -0500, Mike Frysinger wrote:
32> On Tuesday 24 October 2006 15:58, Daniel Jacobowitz wrote:
33> > ARM is going to need a slightly different version of that file, I
34> > guess.
35>
36> would declaring req with attribute packed not help ?
37> -mike
38
39Nope. "struct rtgenmsg" would still have size 4.
40
41Philip, are you still at all interested in this for the old ABI?
42I don't have time to test this patch right now, but I think it
43will work.
44
45--
46Daniel Jacobowitz
47CodeSourcery
48
492006-10-31 Daniel Jacobowitz <dan@codesourcery.com>
50
51 * sysdeps/unix/sysv/linux/arm/check_pf.c: New file.
52 * sysdeps/unix/sysv/linux/arm/eabi/check_pf.c: New file.
53
54Index: sysdeps/unix/sysv/linux/arm/check_pf.c
55===================================================================
56RCS file: sysdeps/unix/sysv/linux/arm/check_pf.c
57diff -N sysdeps/unix/sysv/linux/arm/check_pf.c
58--- /dev/null 1 Jan 1970 00:00:00 -0000
59+++ sysdeps/unix/sysv/linux/arm/check_pf.c 31 Oct 2006 17:29:58 -0000
60@@ -0,0 +1,274 @@
61+/* Determine protocol families for which interfaces exist. ARM Linux version.
62+ Copyright (C) 2003, 2006 Free Software Foundation, Inc.
63+ This file is part of the GNU C Library.
64+
65+ The GNU C Library is free software; you can redistribute it and/or
66+ modify it under the terms of the GNU Lesser General Public
67+ License as published by the Free Software Foundation; either
68+ version 2.1 of the License, or (at your option) any later version.
69+
70+ The GNU C Library is distributed in the hope that it will be useful,
71+ but WITHOUT ANY WARRANTY; without even the implied warranty of
72+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
73+ Lesser General Public License for more details.
74+
75+ You should have received a copy of the GNU Lesser General Public
76+ License along with the GNU C Library; if not, write to the Free
77+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
78+ 02111-1307 USA. */
79+
80+#include <assert.h>
81+#include <errno.h>
82+#include <ifaddrs.h>
83+#include <netdb.h>
84+#include <stddef.h>
85+#include <string.h>
86+#include <time.h>
87+#include <unistd.h>
88+#include <sys/socket.h>
89+
90+#include <asm/types.h>
91+#include <linux/netlink.h>
92+#include <linux/rtnetlink.h>
93+
94+#include <not-cancel.h>
95+#include <kernel-features.h>
96+
97+
98+#ifndef IFA_F_TEMPORARY
99+# define IFA_F_TEMPORARY IFA_F_SECONDARY
100+#endif
101+#ifndef IFA_F_HOMEADDRESS
102+# define IFA_F_HOMEADDRESS 0
103+#endif
104+
105+
106+static int
107+make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
108+ struct in6addrinfo **in6ai, size_t *in6ailen)
109+{
110+ struct req
111+ {
112+ struct nlmsghdr nlh;
113+ struct rtgenmsg g;
114+ } req;
115+ struct sockaddr_nl nladdr;
116+
117+ /* struct rtgenmsg consists of a single byte but the ARM ABI rounds
118+ it up to a word. Clear the padding explicitly here. */
119+ assert (sizeof (req.g) == 4);
120+ memset (&req.g, '\0', sizeof (req.g));
121+
122+ req.nlh.nlmsg_len = sizeof (req);
123+ req.nlh.nlmsg_type = RTM_GETADDR;
124+ req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
125+ req.nlh.nlmsg_pid = 0;
126+ req.nlh.nlmsg_seq = time (NULL);
127+ req.g.rtgen_family = AF_UNSPEC;
128+
129+ memset (&nladdr, '\0', sizeof (nladdr));
130+ nladdr.nl_family = AF_NETLINK;
131+
132+ if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
133+ (struct sockaddr *) &nladdr,
134+ sizeof (nladdr))) < 0)
135+ return -1;
136+
137+ *seen_ipv4 = false;
138+ *seen_ipv6 = false;
139+
140+ bool done = false;
141+ char buf[4096];
142+ struct iovec iov = { buf, sizeof (buf) };
143+ struct in6ailist
144+ {
145+ struct in6addrinfo info;
146+ struct in6ailist *next;
147+ } *in6ailist = NULL;
148+ size_t in6ailistlen = 0;
149+
150+ do
151+ {
152+ struct msghdr msg =
153+ {
154+ (void *) &nladdr, sizeof (nladdr),
155+ &iov, 1,
156+ NULL, 0,
157+ 0
158+ };
159+
160+ ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
161+ if (read_len < 0)
162+ return -1;
163+
164+ if (msg.msg_flags & MSG_TRUNC)
165+ return -1;
166+
167+ struct nlmsghdr *nlmh;
168+ for (nlmh = (struct nlmsghdr *) buf;
169+ NLMSG_OK (nlmh, (size_t) read_len);
170+ nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
171+ {
172+ if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
173+ || nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
174+ continue;
175+
176+ if (nlmh->nlmsg_type == RTM_NEWADDR)
177+ {
178+ struct ifaddrmsg *ifam = (struct ifaddrmsg *) NLMSG_DATA (nlmh);
179+
180+ switch (ifam->ifa_family)
181+ {
182+ case AF_INET:
183+ *seen_ipv4 = true;
184+ break;
185+ case AF_INET6:
186+ *seen_ipv6 = true;
187+
188+ if (ifam->ifa_flags & (IFA_F_DEPRECATED
189+ | IFA_F_TEMPORARY
190+ | IFA_F_HOMEADDRESS))
191+ {
192+ struct rtattr *rta = IFA_RTA (ifam);
193+ size_t len = (nlmh->nlmsg_len
194+ - NLMSG_LENGTH (sizeof (*ifam)));
195+ void *local = NULL;
196+ void *address = NULL;
197+ while (RTA_OK (rta, len))
198+ {
199+ switch (rta->rta_type)
200+ {
201+ case IFA_LOCAL:
202+ local = RTA_DATA (rta);
203+ break;
204+
205+ case IFA_ADDRESS:
206+ address = RTA_DATA (rta);
207+ break;
208+ }
209+
210+ rta = RTA_NEXT (rta, len);
211+ }
212+
213+ struct in6ailist *newp = alloca (sizeof (*newp));
214+ newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
215+ ? in6ai_deprecated : 0)
216+ | ((ifam->ifa_flags
217+ & IFA_F_TEMPORARY)
218+ ? in6ai_temporary : 0)
219+ | ((ifam->ifa_flags
220+ & IFA_F_HOMEADDRESS)
221+ ? in6ai_homeaddress : 0));
222+ memcpy (newp->info.addr, address ?: local,
223+ sizeof (newp->info.addr));
224+ newp->next = in6ailist;
225+ in6ailist = newp;
226+ ++in6ailistlen;
227+ }
228+ break;
229+ default:
230+ /* Ignore. */
231+ break;
232+ }
233+ }
234+ else if (nlmh->nlmsg_type == NLMSG_DONE)
235+ /* We found the end, leave the loop. */
236+ done = true;
237+ }
238+ }
239+ while (! done);
240+
241+ close_not_cancel_no_status (fd);
242+
243+ if (in6ailist != NULL)
244+ {
245+ *in6ai = malloc (in6ailistlen * sizeof (**in6ai));
246+ if (*in6ai == NULL)
247+ return -1;
248+
249+ *in6ailen = in6ailistlen;
250+
251+ do
252+ {
253+ (*in6ai)[--in6ailistlen] = in6ailist->info;
254+ in6ailist = in6ailist->next;
255+ }
256+ while (in6ailist != NULL);
257+ }
258+
259+ return 0;
260+}
261+
262+
263+/* We don't know if we have NETLINK support compiled in in our
264+ Kernel. */
265+#if __ASSUME_NETLINK_SUPPORT == 0
266+/* Define in ifaddrs.h. */
267+extern int __no_netlink_support attribute_hidden;
268+#else
269+# define __no_netlink_support 0
270+#endif
271+
272+
273+void
274+attribute_hidden
275+__check_pf (bool *seen_ipv4, bool *seen_ipv6,
276+ struct in6addrinfo **in6ai, size_t *in6ailen)
277+{
278+ *in6ai = NULL;
279+ *in6ailen = 0;
280+
281+ if (! __no_netlink_support)
282+ {
283+ int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
284+
285+ struct sockaddr_nl nladdr;
286+ memset (&nladdr, '\0', sizeof (nladdr));
287+ nladdr.nl_family = AF_NETLINK;
288+
289+ socklen_t addr_len = sizeof (nladdr);
290+
291+ if (fd >= 0
292+ && __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
293+ && __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) == 0
294+ && make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6,
295+ in6ai, in6ailen) == 0)
296+ /* It worked. */
297+ return;
298+
299+ if (fd >= 0)
300+ __close (fd);
301+
302+#if __ASSUME_NETLINK_SUPPORT == 0
303+ /* Remember that there is no netlink support. */
304+ __no_netlink_support = 1;
305+#else
306+ /* We cannot determine what interfaces are available. Be
307+ pessimistic. */
308+ *seen_ipv4 = true;
309+ *seen_ipv6 = true;
310+#endif
311+ }
312+
313+#if __ASSUME_NETLINK_SUPPORT == 0
314+ /* No netlink. Get the interface list via getifaddrs. */
315+ struct ifaddrs *ifa = NULL;
316+ if (getifaddrs (&ifa) != 0)
317+ {
318+ /* We cannot determine what interfaces are available. Be
319+ pessimistic. */
320+ *seen_ipv4 = true;
321+ *seen_ipv6 = true;
322+ return;
323+ }
324+
325+ struct ifaddrs *runp;
326+ for (runp = ifa; runp != NULL; runp = runp->ifa_next)
327+ if (runp->ifa_addr->sa_family == PF_INET)
328+ *seen_ipv4 = true;
329+ else if (runp->ifa_addr->sa_family == PF_INET6)
330+ *seen_ipv6 = true;
331+
332+ (void) freeifaddrs (ifa);
333+#endif
334+}
335Index: sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
336===================================================================
337RCS file: sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
338diff -N sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
339--- /dev/null 1 Jan 1970 00:00:00 -0000
340+++ sysdeps/unix/sysv/linux/arm/eabi/check_pf.c 31 Oct 2006 17:29:58 -0000
341@@ -0,0 +1 @@
342+#include <sysdeps/unix/sysv/linux/check_pf.c>
343
diff --git a/meta/packages/glibc/glibc-initial_2.5.bb b/meta/packages/glibc/glibc-initial_2.5.bb
new file mode 100644
index 0000000000..f13419a413
--- /dev/null
+++ b/meta/packages/glibc/glibc-initial_2.5.bb
@@ -0,0 +1,45 @@
1require glibc_${PV}.bb
2
3DEPENDS = "linux-libc-headers"
4PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
5FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/glibc-2.4', '${FILE_DIRNAME}/glibc', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
6
7PACKAGES = ""
8
9do_configure () {
10 sed -ie 's,{ (exit 1); exit 1; }; },{ (exit 0); }; },g' ${S}/configure
11 chmod +x ${S}/configure
12 CC="${BUILD_CC}" CPP="${BUILD_CPP}" LD="${BUILD_LD}" ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
13 --without-cvs --disable-sanity-checks \
14 --with-headers=${CROSS_DIR}/${TARGET_SYS}/include \
15 --enable-hacker-mode
16 if grep -q GLIBC_2.3 ${S}/ChangeLog; then
17 # glibc-2.3.x passes cross options to $(CC) when generating errlist-compat.c, which fails without a real cross-compiler.
18 # Fortunately, we don't need errlist-compat.c, since we just need .h files,
19 # so work around this by creating a fake errlist-compat.c and satisfying its dependencies.
20 # Another workaround might be to tell configure to not use any cross options to $(CC).
21 # The real fix would be to get install-headers to not generate errlist-compat.c.
22 make sysdeps/gnu/errlist.c
23 mkdir -p stdio-common
24 touch stdio-common/errlist-compat.c
25 fi
26}
27
28do_compile () {
29 :
30}
31
32do_stage () {
33 oe_runmake cross-compiling=yes install_root=${CROSS_DIR}/${TARGET_SYS} prefix="" install-headers
34
35 # Two headers -- stubs.h and features.h -- aren't installed by install-headers,
36 # so do them by hand. We can tolerate an empty stubs.h for the moment.
37 # See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
38 mkdir -p ${CROSS_DIR}/${TARGET_SYS}/include/gnu
39 touch ${CROSS_DIR}/${TARGET_SYS}/include/gnu/stubs.h
40 cp ${S}/include/features.h ${CROSS_DIR}/${TARGET_SYS}/include/features.h
41}
42
43do_install () {
44 :
45}
diff --git a/meta/packages/glibc/glibc_2.5.bb b/meta/packages/glibc/glibc_2.5.bb
index 0afadadb60..d3c6ab02ec 100644
--- a/meta/packages/glibc/glibc_2.5.bb
+++ b/meta/packages/glibc/glibc_2.5.bb
@@ -1,9 +1,6 @@
1DESCRIPTION = "GNU C Library" 1require glibc.inc
2HOMEPAGE = "http://www.gnu.org/software/libc/libc.html" 2
3LICENSE = "LGPL" 3PR = "r4"
4SECTION = "libs"
5PRIORITY = "required"
6PR = "r2"
7 4
8# the -isystem in bitbake.conf screws up glibc do_stage 5# the -isystem in bitbake.conf screws up glibc do_stage
9BUILD_CPPFLAGS = "-I${STAGING_DIR}/${BUILD_SYS}/include" 6BUILD_CPPFLAGS = "-I${STAGING_DIR}/${BUILD_SYS}/include"
@@ -55,6 +52,7 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
55 file://dl-cache-libcmp.patch;patch=1 \ 52 file://dl-cache-libcmp.patch;patch=1 \
56 file://ldsocache-varrun.patch;patch=1 \ 53 file://ldsocache-varrun.patch;patch=1 \
57 file://nptl-crosscompile.patch;patch=1 \ 54 file://nptl-crosscompile.patch;patch=1 \
55 file://glibc-check_pf.patch;patch=1;pnum=0 \
58# file://glibc-2.4-compile.patch;patch=1 \ 56# file://glibc-2.4-compile.patch;patch=1 \
59# file://glibc-2.4-openat-3.patch;patch=1 \ 57# file://glibc-2.4-openat-3.patch;patch=1 \
60# file://fixup-aeabi-syscalls.patch;patch=1 \ 58# file://fixup-aeabi-syscalls.patch;patch=1 \
@@ -71,6 +69,8 @@ SRC_URI = "ftp://ftp.gnu.org/pub/gnu/glibc/glibc-${PV}.tar.bz2 \
71SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1" 69SRC_URI_append_sh3 = " file://no-z-defs.patch;patch=1"
72SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1" 70SRC_URI_append_sh4 = " file://no-z-defs.patch;patch=1"
73 71
72SRC_URI_append_powerpc = " file://powerpc-sqrt-hack.diff;patch=1"
73
74S = "${WORKDIR}/glibc-${PV}" 74S = "${WORKDIR}/glibc-${PV}"
75B = "${WORKDIR}/build-${TARGET_SYS}" 75B = "${WORKDIR}/build-${TARGET_SYS}"
76 76
@@ -86,11 +86,6 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
86 86
87EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}" 87EXTRA_OECONF += "${@get_glibc_fpu_setting(bb, d)}"
88 88
89def get_glibc_fpu_setting(bb, d):
90 if bb.data.getVar('TARGET_FPU', d, 1) in [ 'soft' ]:
91 return "--without-fp"
92 return ""
93
94do_munge() { 89do_munge() {
95 # Integrate ports and libidn into tree 90 # Integrate ports and libidn into tree
96 mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports 91 mv ${WORKDIR}/glibc-ports-${PV} ${S}/ports