This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM support for glibc-2.5


I have attached the patches I currently use when building an ARM OABI
soft-float NPTL toolchain using crosstool.  The first applies to
glibc-2.5, the next three to glibc-ports-2.5, and the last two to gcc
4.1.2RC1 (aka gcc-4.1.2-20070128).  I use the headers from Linux
2.6.20-rc6 (although I'm sure you could bump that up to 2.6.20) and
up-to-date binutils from H. J. Lu and gdb 6.6, all unpatched.  The
crosstool config files and driver script are also attached, although
you won't be able to use them without patched versions of crosstool.sh
and getandpatch.sh, which are also attached.  You will also need a
kernel config suitable for the core you are tuning for; I attached the
one I use.

I have been planning to rebase my work against the recent checkins to
crosstool SVN (in particular, the somewhat different version of the
gcc-glibc-linux-headers dance that was IIRC accepted into mainline).
I also have some gnueabi variants that aren't well tested yet because
I'm still stuck with one vendor-supplied binary driver and one binary
userspace tool.  In the meantime, I hope this helps.  :-)

Cheers,
- Michael
From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch
Rule to install all needed libraries, not just the ones installed by install-lib,
yet not install programs.  
Needed because we can't use the main install target, as we can't build programs before
we have the final gcc installed; linking fails because libeh.a is not present,
and glibc insists on linking programs with that library.

diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules
--- glibc-2.3.4.orig/Makerules	2004-12-15 20:52:39.000000000 +0200
+++ glibc-2.3.4/Makerules	2005-02-19 15:16:31.415125176 +0200
@@ -844,6 +844,13 @@
 installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\
 			     $(inst_libdir)/$(patsubst %,$(libtype$o),\
 						     $(libprefix)$(libc-name)))
+
+install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \
+		$(inst_slibdir)/libc-$(version).so \
+		$(inst_libdir)/libc.so \
+		$(inst_libdir)/libc.a \
+		install-lib
+
 install: $(installed-libcs)
 $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
 	$(make-target-directory)

Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
diff -Naur glibc-2.4/ports/sysdeps/arm/elf/configure glibc-2.4-patched/ports/sysdeps/arm/elf/configure
--- glibc-2.4/ports/sysdeps/arm/elf/configure	2006-03-06 03:11:40.000000000 -0800
+++ glibc-2.4-patched/ports/sysdeps/arm/elf/configure	2006-04-25 10:32:32.000000000 -0700
@@ -9,7 +9,10 @@
 if test "${libc_cv_arm_tls+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat > conftest.s <<\EOF
+  if test "$usetls" = force; then
+  libc_cv_arm_tls=yes
+else
+cat > conftest.s <<\EOF
 	.section ".tdata", "awT", %progbits
 	.globl foo
 foo:	.long	1
@@ -32,6 +35,7 @@
 fi
 rm -f conftest*
 fi
+fi
 echo "$as_me:$LINENO: result: $libc_cv_arm_tls" >&5
 echo "${ECHO_T}$libc_cv_arm_tls" >&6
 if test $libc_cv_arm_tls = yes; then
diff -Naur glibc-2.4/ports/sysdeps/arm/elf/configure.in glibc-2.4-patched/ports/sysdeps/arm/elf/configure.in
--- glibc-2.4/ports/sysdeps/arm/elf/configure.in	2005-10-05 13:15:21.000000000 -0700
+++ glibc-2.4-patched/ports/sysdeps/arm/elf/configure.in	2006-04-25 10:32:00.000000000 -0700
@@ -5,6 +5,9 @@
 # Check for support of thread-local storage handling in assembler and
 # linker.
 AC_CACHE_CHECK(for ARM TLS support, libc_cv_arm_tls, [dnl
+if test "$usetls" = force; then
+  libc_cv_arm_tls=yes
+else
 cat > conftest.s <<\EOF
 	.section ".tdata", "awT", %progbits
 	.globl foo
@@ -22,7 +25,8 @@
 else
   libc_cv_arm_tls=no
 fi
-rm -f conftest*])
+rm -f conftest*
+fi])
 if test $libc_cv_arm_tls = yes; then
   AC_DEFINE(HAVE_TLS_SUPPORT)
 fi
From libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org Tue Oct 31 17:37:21 2006
Return-Path: <libc-ports-return-550-listarch-libc-ports=sources dot redhat dot com at sourceware dot org>
Delivered-To: listarch-libc-ports at sources dot redhat dot com
Received: (qmail 17273 invoked by alias); 31 Oct 2006 17:37:20 -0000
Received: (qmail 17262 invoked by uid 22791); 31 Oct 2006 17:37:19 -0000
X-Spam-Status: No, hits=-2.5 required=5.0 	tests=AWL,BAYES_00,TW_CP
X-Spam-Check-By: sourceware.org
Received: 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
Received: from drow by nevyn.them.org with local (Exim 4.54) 	id 1GexXw-0007Dj-30; Tue, 31 Oct 2006 12:37:08 -0500
Date: Tue, 31 Oct 2006 12:37:08 -0500
From: Daniel Jacobowitz <drow at false dot org>
To: Mike Frysinger <vapier at gentoo dot org>
Cc: libc-ports at sourceware dot org, Philip Balister <philip dot balister at gmail dot com>
Subject: Re: Problem with glibc-2.5 on ARM
Message-ID: <20061031173708.GJ20468@nevyn.them.org>
References: <499146270610241149ibe030e0nd9d6b177a95b346e@mail.gmail.com> <499146270610241254u7cadf63ej2edf05cedbc5266f@mail.gmail.com> <20061024195837.GA20181@nevyn.them.org> <200610291954.27022.vapier@gentoo.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <200610291954 dot 27022 dot vapier at gentoo dot org>
User-Agent: Mutt/1.5.13 (2006-08-11)
X-IsSubscribed: yes
Mailing-List: contact libc-ports-help at sourceware dot org; run by ezmlm
Precedence: bulk
List-Subscribe: <mailto:libc-ports-subscribe at sourceware dot org>
List-Post: <mailto:libc-ports at sourceware dot org>
List-Help: <mailto:libc-ports-help at sourceware dot org>, <http://sourceware dot org/lists dot html#faqs>
Sender: libc-ports-owner at sourceware dot org
Delivered-To: mailing list libc-ports at sourceware dot org

On Sun, Oct 29, 2006 at 07:54:25PM -0500, Mike Frysinger wrote:
> On Tuesday 24 October 2006 15:58, Daniel Jacobowitz wrote:
> > ARM is going to need a slightly different version of that file, I
> > guess.
> 
> would declaring req with attribute packed not help ?
> -mike

Nope.  "struct rtgenmsg" would still have size 4.

Philip, are you still at all interested in this for the old ABI?
I don't have time to test this patch right now, but I think it
will work.

-- 
Daniel Jacobowitz
CodeSourcery

2006-10-31  Daniel Jacobowitz  <dan@codesourcery.com>

	* sysdeps/unix/sysv/linux/arm/check_pf.c: New file.
	* sysdeps/unix/sysv/linux/arm/eabi/check_pf.c: New file.

Index: glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/check_pf.c
===================================================================
RCS file: glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/check_pf.c
diff -N glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/check_pf.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/check_pf.c	31 Oct 2006 17:29:58 -0000
@@ -0,0 +1,274 @@
+/* Determine protocol families for which interfaces exist.  ARM Linux version.
+   Copyright (C) 2003, 2006 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 <assert.h>
+#include <errno.h>
+#include <ifaddrs.h>
+#include <netdb.h>
+#include <stddef.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <sys/socket.h>
+
+#include <asm/types.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+
+#include <not-cancel.h>
+#include <kernel-features.h>
+
+
+#ifndef IFA_F_TEMPORARY
+# define IFA_F_TEMPORARY IFA_F_SECONDARY
+#endif
+#ifndef IFA_F_HOMEADDRESS
+# define IFA_F_HOMEADDRESS 0
+#endif
+
+
+static int
+make_request (int fd, pid_t pid, bool *seen_ipv4, bool *seen_ipv6,
+	      struct in6addrinfo **in6ai, size_t *in6ailen)
+{
+  struct req
+  {
+    struct nlmsghdr nlh;
+    struct rtgenmsg g;
+  } req;
+  struct sockaddr_nl nladdr;
+
+  /* struct rtgenmsg consists of a single byte but the ARM ABI rounds
+     it up to a word.  Clear the padding explicitly here.  */
+  assert (sizeof (req.g) == 4);
+  memset (&req.g, '\0', sizeof (req.g));
+
+  req.nlh.nlmsg_len = sizeof (req);
+  req.nlh.nlmsg_type = RTM_GETADDR;
+  req.nlh.nlmsg_flags = NLM_F_ROOT | NLM_F_MATCH | NLM_F_REQUEST;
+  req.nlh.nlmsg_pid = 0;
+  req.nlh.nlmsg_seq = time (NULL);
+  req.g.rtgen_family = AF_UNSPEC;
+
+  memset (&nladdr, '\0', sizeof (nladdr));
+  nladdr.nl_family = AF_NETLINK;
+
+  if (TEMP_FAILURE_RETRY (__sendto (fd, (void *) &req, sizeof (req), 0,
+				    (struct sockaddr *) &nladdr,
+				    sizeof (nladdr))) < 0)
+    return -1;
+
+  *seen_ipv4 = false;
+  *seen_ipv6 = false;
+
+  bool done = false;
+  char buf[4096];
+  struct iovec iov = { buf, sizeof (buf) };
+  struct in6ailist
+  {
+    struct in6addrinfo info;
+    struct in6ailist *next;
+  } *in6ailist = NULL;
+  size_t in6ailistlen = 0;
+
+  do
+    {
+      struct msghdr msg =
+	{
+	  (void *) &nladdr, sizeof (nladdr),
+	  &iov, 1,
+	  NULL, 0,
+	  0
+	};
+
+      ssize_t read_len = TEMP_FAILURE_RETRY (__recvmsg (fd, &msg, 0));
+      if (read_len < 0)
+	return -1;
+
+      if (msg.msg_flags & MSG_TRUNC)
+	return -1;
+
+      struct nlmsghdr *nlmh;
+      for (nlmh = (struct nlmsghdr *) buf;
+	   NLMSG_OK (nlmh, (size_t) read_len);
+	   nlmh = (struct nlmsghdr *) NLMSG_NEXT (nlmh, read_len))
+	{
+	  if (nladdr.nl_pid != 0 || (pid_t) nlmh->nlmsg_pid != pid
+	      || nlmh->nlmsg_seq != req.nlh.nlmsg_seq)
+	    continue;
+
+	  if (nlmh->nlmsg_type == RTM_NEWADDR)
+	    {
+	      struct ifaddrmsg *ifam = (struct ifaddrmsg *) NLMSG_DATA (nlmh);
+
+	      switch (ifam->ifa_family)
+		{
+		case AF_INET:
+		  *seen_ipv4 = true;
+		  break;
+		case AF_INET6:
+		  *seen_ipv6 = true;
+
+		  if (ifam->ifa_flags & (IFA_F_DEPRECATED
+					 | IFA_F_TEMPORARY
+					 | IFA_F_HOMEADDRESS))
+		    {
+		      struct rtattr *rta = IFA_RTA (ifam);
+		      size_t len = (nlmh->nlmsg_len
+				    - NLMSG_LENGTH (sizeof (*ifam)));
+		      void *local = NULL;
+		      void *address = NULL;
+		      while (RTA_OK (rta, len))
+			{
+			  switch (rta->rta_type)
+			    {
+			    case IFA_LOCAL:
+			      local = RTA_DATA (rta);
+			      break;
+
+			    case IFA_ADDRESS:
+			      address = RTA_DATA (rta);
+			      break;
+			    }
+
+			  rta = RTA_NEXT (rta, len);
+			}
+
+		      struct in6ailist *newp = alloca (sizeof (*newp));
+		      newp->info.flags = (((ifam->ifa_flags & IFA_F_DEPRECATED)
+					   ? in6ai_deprecated : 0)
+					  | ((ifam->ifa_flags
+					      & IFA_F_TEMPORARY)
+					     ? in6ai_temporary : 0)
+					  | ((ifam->ifa_flags
+					      & IFA_F_HOMEADDRESS)
+					     ? in6ai_homeaddress : 0));
+		      memcpy (newp->info.addr, address ?: local,
+			      sizeof (newp->info.addr));
+		      newp->next = in6ailist;
+		      in6ailist = newp;
+		      ++in6ailistlen;
+		    }
+		  break;
+		default:
+		  /* Ignore.  */
+		  break;
+		}
+	    }
+	  else if (nlmh->nlmsg_type == NLMSG_DONE)
+	    /* We found the end, leave the loop.  */
+	    done = true;
+	}
+    }
+  while (! done);
+
+  close_not_cancel_no_status (fd);
+
+  if (in6ailist != NULL)
+    {
+      *in6ai = malloc (in6ailistlen * sizeof (**in6ai));
+      if (*in6ai == NULL)
+	return -1;
+
+      *in6ailen = in6ailistlen;
+
+      do
+	{
+	  (*in6ai)[--in6ailistlen] = in6ailist->info;
+	  in6ailist = in6ailist->next;
+	}
+      while (in6ailist != NULL);
+    }
+
+  return 0;
+}
+
+
+/* We don't know if we have NETLINK support compiled in in our
+   Kernel.  */
+#if __ASSUME_NETLINK_SUPPORT == 0
+/* Define in ifaddrs.h.  */
+extern int __no_netlink_support attribute_hidden;
+#else
+# define __no_netlink_support 0
+#endif
+
+
+void
+attribute_hidden
+__check_pf (bool *seen_ipv4, bool *seen_ipv6,
+	    struct in6addrinfo **in6ai, size_t *in6ailen)
+{
+  *in6ai = NULL;
+  *in6ailen = 0;
+
+  if (! __no_netlink_support)
+    {
+      int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+
+      struct sockaddr_nl nladdr;
+      memset (&nladdr, '\0', sizeof (nladdr));
+      nladdr.nl_family = AF_NETLINK;
+
+      socklen_t addr_len = sizeof (nladdr);
+
+      if (fd >= 0
+	  && __bind (fd, (struct sockaddr *) &nladdr, sizeof (nladdr)) == 0
+	  && __getsockname (fd, (struct sockaddr *) &nladdr, &addr_len) == 0
+	  && make_request (fd, nladdr.nl_pid, seen_ipv4, seen_ipv6,
+			   in6ai, in6ailen) == 0)
+	/* It worked.  */
+	return;
+
+      if (fd >= 0)
+	__close (fd);
+
+#if __ASSUME_NETLINK_SUPPORT == 0
+      /* Remember that there is no netlink support.  */
+      __no_netlink_support = 1;
+#else
+      /* We cannot determine what interfaces are available.  Be
+	 pessimistic.  */
+      *seen_ipv4 = true;
+      *seen_ipv6 = true;
+#endif
+    }
+
+#if __ASSUME_NETLINK_SUPPORT == 0
+  /* No netlink.  Get the interface list via getifaddrs.  */
+  struct ifaddrs *ifa = NULL;
+  if (getifaddrs (&ifa) != 0)
+    {
+      /* We cannot determine what interfaces are available.  Be
+	 pessimistic.  */
+      *seen_ipv4 = true;
+      *seen_ipv6 = true;
+      return;
+    }
+
+  struct ifaddrs *runp;
+  for (runp = ifa; runp != NULL; runp = runp->ifa_next)
+    if (runp->ifa_addr->sa_family == PF_INET)
+      *seen_ipv4 = true;
+    else if (runp->ifa_addr->sa_family == PF_INET6)
+      *seen_ipv6 = true;
+
+  (void) freeifaddrs (ifa);
+#endif
+}
Index: glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
===================================================================
RCS file: glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
diff -N glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/eabi/check_pf.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ glibc-2.5/ports/sysdeps/unix/sysv/linux/arm/eabi/check_pf.c	31 Oct 2006 17:29:58 -0000
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/check_pf.c>

From libc-ports-return-558-listarch-libc-ports=sources dot redhat dot com at sourceware dot org Thu Nov 09 22:28:42 2006
Return-Path: <libc-ports-return-558-listarch-libc-ports=sources dot redhat dot com at sourceware dot org>
Delivered-To: listarch-libc-ports at sources dot redhat dot com
Received: (qmail 7577 invoked by alias); 9 Nov 2006 22:28:41 -0000
Received: (qmail 7561 invoked by uid 22791); 9 Nov 2006 22:28:38 -0000
X-Spam-Status: No, hits=-1.5 required=5.0 	tests=AWL,BAYES_05,RCVD_ILLEGAL_IP,SPF_PASS
X-Spam-Check-By: sourceware.org
Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4)     by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Nov 2006 22:28:29 +0000
Received: (qmail 10471 invoked from network); 9 Nov 2006 22:28:27 -0000
Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2)   by mail.codesourcery.com with ESMTPA; 9 Nov 2006 22:28:27 -0000
Received: from jsm28 (helo=localhost) 	by digraph.polyomino.org.uk with local-esmtp (Exim 4.63) 	(envelope-from <joseph@codesourcery.com>) 	id 1GiINm-0005Wr-Ug 	for libc-ports@sourceware.org; Thu, 09 Nov 2006 22:28:26 +0000
Date: Thu, 9 Nov 2006 22:28:26 +0000 (UTC)
From: "Joseph S dot  Myers" <joseph at codesourcery dot com>
X-X-Sender: jsm28@digraph.polyomino.org.uk
To: libc-ports at sourceware dot org
Subject: Fix ARM bits/mathdef.h
Message-ID: <Pine.LNX.4.64.0611092227210.17049@digraph.polyomino.org.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Mailing-List: contact libc-ports-help at sourceware dot org; run by ezmlm
Precedence: bulk
List-Subscribe: <mailto:libc-ports-subscribe at sourceware dot org>
List-Post: <mailto:libc-ports at sourceware dot org>
List-Help: <mailto:libc-ports-help at sourceware dot org>, <http://sourceware dot org/lists dot html#faqs>
Sender: libc-ports-owner at sourceware dot org
Delivered-To: mailing list libc-ports at sourceware dot org

No version of ARM hard or soft float has excess precision; all operate
on float values with float arithmetic, and on double values with
double arithmetic.  Thus glibc's default <bits/mathdef.h>, which
defines float_t to be double (so describing a generic system with
excess precision), is incorrect for ARM; in fact
sysdeps/arm/fpu/bits/mathdef.h is correct for all ARM cases, minus a
comment about FPA.

2006-11-09  Joseph Myers  <joseph@codesourcery.com>

	* sysdeps/arm/fpu/bits/mathdef.h: Move to
	sysdeps/arm/bits/mathdef.h.  Remove comment about FPA.

diff -rupN ports.orig/sysdeps/arm/bits/mathdef.h ports/sysdeps/arm/bits/mathdef.h
--- glibc-2.5/ports/sysdeps/arm/bits/mathdef.h	1970-01-01 00:00:00.000000000 +0000
+++ glibc-2.5/ports/sysdeps/arm/bits/mathdef.h	2006-11-09 22:26:19.000000000 +0000
@@ -0,0 +1,42 @@
+/* Copyright (C) 1999, 2000, 2004, 2006 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.  */
+
+#if !defined _MATH_H && !defined _COMPLEX_H
+# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
+#endif
+
+#if defined  __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
+# define _MATH_H_MATHDEF	1
+
+/* GCC does not promote `float' values to `double'.  */
+typedef float float_t;		/* `float' expressions are evaluated as
+				   `float'.  */
+typedef double double_t;	/* `double' expressions are evaluated as
+				   `double'.  */
+
+/* The values returned by `ilogb' for 0 and NaN respectively.  */
+# define FP_ILOGB0	(-2147483647)
+# define FP_ILOGBNAN	(2147483647)
+
+#endif	/* ISO C99 */
+
+#ifndef __NO_LONG_DOUBLE_MATH
+/* Signal that we do not really have a `long double'.  This disables the
+   declaration of all the `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif
diff -rupN ports.orig/sysdeps/arm/fpu/bits/mathdef.h ports/sysdeps/arm/fpu/bits/mathdef.h
--- glibc-2.5/ports/sysdeps/arm/fpu/bits/mathdef.h	2004-03-15 21:44:08.000000000 +0000
+++ glibc-2.5/ports/sysdeps/arm/fpu/bits/mathdef.h	1970-01-01 00:00:00.000000000 +0000
@@ -1,44 +0,0 @@
-/* Copyright (C) 1999, 2000, 2004 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.  */
-
-#if !defined _MATH_H && !defined _COMPLEX_H
-# error "Never use <bits/mathdef.h> directly; include <math.h> instead"
-#endif
-
-#if defined  __USE_ISOC99 && defined _MATH_H && !defined _MATH_H_MATHDEF
-# define _MATH_H_MATHDEF	1
-
-/* GCC does not promote `float' values to `double'.  */
-typedef float float_t;		/* `float' expressions are evaluated as
-				   `float'.  */
-typedef double double_t;	/* `double' expressions are evaluated as
-				   `double'.  */
-
-/* The values returned by `ilogb' for 0 and NaN respectively.  */
-# define FP_ILOGB0	(-2147483647)
-# define FP_ILOGBNAN	(2147483647)
-
-#endif	/* ISO C99 */
-
-#ifndef __NO_LONG_DOUBLE_MATH
-/* Signal that we do not really have a `long double'.  This disables the
-   declaration of all the `long double' function variants.  */
-/* XXX The FPA does support this but the patterns in GCC are currently
-   turned off.  */
-# define __NO_LONG_DOUBLE_MATH	1
-#endif

-- 
Joseph S. Myers
joseph@codesourcery.com

--- gcc-4.1.0/gcc/config/arm/linux-eabi.h	2005-11-15 06:32:13.000000000 -0800
+++ gcc-4.1.0-patched/gcc/config/arm/linux-eabi.h	2006-04-26 22:13:14.000000000 -0700
@@ -48,7 +48,8 @@
 #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
 
 #undef SUBTARGET_EXTRA_LINK_SPEC
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
+#define SUBTARGET_EXTRA_LINK_SPEC \
+  " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
 
 /* Use ld-linux.so.3 so that it will be possible to run "classic"
    GNU/Linux binaries on an EABI system.  */
# Origin: from a patch by Dimitry Andric <dimitry@andric.com>, 2004-05-01
# See http://gcc.gnu.org/PR14352 and http://gcc.gnu.org/PR16314
# See also http://gcc.gnu.org/ml/gcc-patches/2004-08/msg02568.html et seq for why this isn't in mainline
# Fixes errors like the following when building glibc (or any other executable
# or shared library) when using gcc 3.4.0 for ARM with softfloat:
#
# .../libc_pic.os(.text+0x15834): In function `__modf': undefined reference to `__subdf3'
# .../libc_pic.os(.text+0x158b8): In function `__modf': undefined reference to `__subdf3'
# .../libc_pic.os(.text+0x1590c): In function `scalbn': undefined reference to `__muldf3'
# .../libc_pic.os(.text+0x15e94): In function `__ldexpf': undefined reference to `__eqsf2'
# .../libc_pic.os(.text+0xcee4c): In function `monstartup': undefined reference to `__fixsfsi'

diff -urNd gcc-3.4.0-orig/gcc/config/arm/t-linux gcc-3.4.0/gcc/config/arm/t-linux
--- gcc-3.4.0-orig/gcc/config/arm/t-linux	2003-09-20 23:09:07.000000000 +0200
+++ gcc-3.4.0/gcc/config/arm/t-linux	2004-05-01 20:31:59.102846400 +0200
@@ -4,7 +4,12 @@
 LIBGCC2_DEBUG_CFLAGS = -g0
 
 LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _bb_init_func \
+	_call_via_rX _interwork_call_via_rX \
+	_lshrdi3 _ashrdi3 _ashldi3 \
+	_negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+	_truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+	_fixsfsi _fixunssfsi _floatdidf _floatdisf
 
 # MULTILIB_OPTIONS = mhard-float/msoft-float
 # MULTILIB_DIRNAMES = hard-float soft-float
diff -ur gcc-4.1.1/gcc/config/arm/linux-elf.h gcc-4.1.1-patched/gcc/config/arm/linux-elf.h
--- gcc-4.1.1/gcc/config/arm/linux-elf.h	2005-10-09 18:04:31.000000000 -0700
+++ gcc-4.1.1-patched/gcc/config/arm/linux-elf.h	2006-12-06 10:59:34.000000000 -0800
@@ -49,7 +49,9 @@
    %{shared:-lc} \
    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
 
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
+ *    do not use -lfloat.  */
+#undef LIBGCC_SPEC
 
 #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
 

Attachment: arm-soft-oabi.dat
Description: MPEG movie

Attachment: gcc-4.1.x-glibc-2.5-nptl.dat
Description: MPEG movie

Attachment: demo-arm-soft-oabi.sh
Description: Bourne shell script

Attachment: crosstool.sh
Description: Bourne shell script

Attachment: getandpatch.sh
Description: Bourne shell script

Attachment: arm-tls-oabi.config
Description: Binary data

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]