From andersen at uclibc.org Thu Nov 2 13:46:07 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Thu, 2 Nov 2006 13:46:07 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/misc/time Message-ID: <20061102214607.E4D2B485FA@busybox.net> Author: andersen Date: 2006-11-02 13:46:07 -0800 (Thu, 02 Nov 2006) New Revision: 16489 Log: In bug 622, JohnAta writes: In 2005, Congress passed a law so that in 2007, the second week of March starts DST. Previously, it was the first week of April. The uclibc time library routines apparently have not been updated to reflect this new processing. Using the current version of uclibc, on March 11, 2007 the reported time will be incorrect. Modified: trunk/uClibc/libc/misc/time/time.c Changeset: Modified: trunk/uClibc/libc/misc/time/time.c =================================================================== --- trunk/uClibc/libc/misc/time/time.c 2006-11-01 20:20:37 UTC (rev 16488) +++ trunk/uClibc/libc/misc/time/time.c 2006-11-02 21:46:07 UTC (rev 16489) @@ -195,6 +195,21 @@ #define TZNAME_MAX _POSIX_TZNAME_MAX #endif +#if defined (L_tzset) || defined (L_localtime_r) || defined(L_strftime) || \ + defined(L__time_mktime) || defined(L__time_mktime_tzi) + +void _time_tzset(int use_old_rules); +libc_hidden_proto(_time_tzset) + +#ifndef L__time_mktime + + /* Jan 1, 2007 Z - tm = 0,0,0,1,0,107,1,0,0 */ + +const static time_t new_rule_starts = 1167609600; + +#endif +#endif + /**********************************************************************/ /* The era code is currently unfinished. */ /* #define ENABLE_ERA_CODE */ @@ -590,7 +605,7 @@ { TZLOCK; - tzset(); + _time_tzset(*timer < new_rule_starts); __time_localtime_tzi(timer, result, _time_tzinfo); @@ -1028,7 +1043,8 @@ unsigned char mod; unsigned char code; - tzset(); /* We'll, let's get this out of the way. */ + /* We'll, let's get this out of the way. */ + _time_tzset(_time_mktime((struct tm *) timeptr, 0) < new_rule_starts); lvl = 0; p = format; @@ -1717,7 +1733,9 @@ 6, 0, 0, /* Note: overloaded for non-M non-J case... */ 0, 1, 0, /* J */ ',', 'M', '4', '.', '1', '.', '0', - ',', 'M', '1', '0', '.', '5', '.', '0', 0 + ',', 'M', '1', '0', '.', '5', '.', '0', 0, + ',', 'M', '3', '.', '2', '.', '0', + ',', 'M', '1', '1', '.', '1', '.', '0', 0 }; #define TZ vals @@ -1725,6 +1743,7 @@ #define RANGE (vals + 7) #define RULE (vals + 11 - 1) #define DEFAULT_RULES (vals + 22) +#define DEFAULT_2007_RULES (vals + 38) /* Initialize to UTC. */ int daylight = 0; @@ -1853,6 +1872,11 @@ void tzset(void) { + _time_tzset((time(NULL)) < new_rule_starts); +} + +void _time_tzset(int use_old_rules) +{ register const char *e; register char *s; long off; @@ -1975,7 +1999,15 @@ } else { /* OK, we have dst, so get some rules. */ count = 0; if (!*e) { /* No rules so default to US rules. */ - e = DEFAULT_RULES; + e = use_old_rules ? DEFAULT_RULES : DEFAULT_2007_RULES; +#ifdef DEBUG_TZSET + if (e == DEFAULT_RULES) + printf("tzset: Using old rules.\n"); + else if (e == DEFAULT_2007_RULES) + printf("tzset: Using new rules\n"); + else + printf("tzset: Using undefined rules\n"); +#endif /* DEBUG_TZSET */ } do { @@ -2314,6 +2346,8 @@ --d; } + _time_tzset (x.tm_year < 2007); /* tm_year was expanded above */ + #ifdef __BCC__ d = p[5] - 1; days = -719163L + ((long)d)*365 + ((d/4) - (d/100) + (d/400) + p[3] + p[7]); From bugs at busybox.net Thu Nov 2 13:46:38 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 2 Nov 2006 13:46:38 -0800 Subject: [uClibc 0000622]: New daylight savings time rules not implemented Message-ID: The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=622 ====================================================================== Reported By: JohnAta Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 622 Category: Other Reproducibility: always Severity: major Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 01-03-2006 15:00 PST Last Modified: 11-02-2006 13:46 PST ====================================================================== Summary: New daylight savings time rules not implemented Description: In 2005, Congress passed a law so that in 2007, the second week of March starts DST. Previously, it was the first week of April. The uclibc time library routines apparently have not been updated to reflect this new processing. Using the current version of uclibc, on March 11, 2007 the reported time will be incorrect. ====================================================================== ---------------------------------------------------------------------- JohnAta - 10-19-06 19:45 ---------------------------------------------------------------------- This patch will support the new DST rules as well as the old. ---------------------------------------------------------------------- andersen - 11-02-06 13:46 ---------------------------------------------------------------------- Updated to svn trunk and applied Issue History Date Modified Username Field Change ====================================================================== 01-03-06 15:00 JohnAta New Issue 01-03-06 15:00 JohnAta Status new => assigned 01-03-06 15:00 JohnAta Assigned To => uClibc 01-03-06 15:09 JohnAta Issue Monitored: JohnAta 10-19-06 19:44 JohnAta File Added: uclibc.df 10-19-06 19:45 JohnAta Note Added: 0001711 11-02-06 13:46 andersen Note Added: 0001727 11-02-06 13:46 andersen Status assigned => closed 11-02-06 13:46 andersen Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Nov 3 10:52:35 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 3 Nov 2006 10:52:35 -0800 (PST) Subject: svn commit: trunk/uClibc/libpthread/linuxthreads.old Message-ID: <20061103185235.EA44C485AC@busybox.net> Author: vapier Date: 2006-11-03 10:52:35 -0800 (Fri, 03 Nov 2006) New Revision: 16492 Log: dont need to force optimization in CFLAGS anymore (if this fails your compiler prob sucks anyways) Modified: trunk/uClibc/libpthread/linuxthreads.old/Makefile.in Changeset: Modified: trunk/uClibc/libpthread/linuxthreads.old/Makefile.in =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/Makefile.in 2006-11-03 08:21:47 UTC (rev 16491) +++ trunk/uClibc/libpthread/linuxthreads.old/Makefile.in 2006-11-03 18:52:35 UTC (rev 16492) @@ -11,11 +11,6 @@ CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old) -# This stuff will not compile without at least -O1 -# psm: can't handle this here, could maybe search for -O0 in CFLAGS -# and append -O1 if found -#CFLAGS:=$(CFLAGS:-O0=-O1) - ifeq ($(PTHREADS_DEBUG_SUPPORT),y) LDFLAGS-libpthread.so := $(LDFLAGS_NOSTRIP) -z defs else From vapier at uclibc.org Fri Nov 3 10:55:00 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 3 Nov 2006 10:55:00 -0800 (PST) Subject: svn commit: trunk/uClibc/libpthread/linuxthreads.old Message-ID: <20061103185500.C242348570@busybox.net> Author: vapier Date: 2006-11-03 10:55:00 -0800 (Fri, 03 Nov 2006) New Revision: 16493 Log: remove duplicated/unused ASSERT code Modified: trunk/uClibc/libpthread/linuxthreads.old/debug.h trunk/uClibc/libpthread/linuxthreads.old/internals.h trunk/uClibc/libpthread/linuxthreads.old/manager.c trunk/uClibc/libpthread/linuxthreads.old/queue.h trunk/uClibc/libpthread/linuxthreads.old/spinlock.c Changeset: Modified: trunk/uClibc/libpthread/linuxthreads.old/debug.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/debug.h 2006-11-03 18:52:35 UTC (rev 16492) +++ trunk/uClibc/libpthread/linuxthreads.old/debug.h 2006-11-03 18:55:00 UTC (rev 16493) @@ -29,9 +29,6 @@ # define DEBUG_PT #endif -/* include asserts for now */ -#define DO_ASSERT - /* define the PDEBUG macro here */ #undef PDEBUG #ifdef DEBUG_PT @@ -40,17 +37,4 @@ # define PDEBUG(fmt, args...) /* debug switched off */ #endif -/* nothing; placeholder to disable a PDEBUG message but don't delete it */ -#undef PDEBUGG -#define PDEBUGG(fmt, args...) - -/* Define ASSERT to stop/warn. Should be void in production code */ -#undef ASSERT -#ifdef DO_ASSERT -# define ASSERT(x) if (!(x)) fprintf(stderr, "pt: assertion failed in %s:%i.\n",\ - __FILE__, __LINE__) -#else -# define ASSERT(x) -#endif - #endif /* _PT_DEBUG_H */ Modified: trunk/uClibc/libpthread/linuxthreads.old/internals.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/internals.h 2006-11-03 18:52:35 UTC (rev 16492) +++ trunk/uClibc/libpthread/linuxthreads.old/internals.h 2006-11-03 18:55:00 UTC (rev 16493) @@ -445,17 +445,6 @@ extern int __libc_multiple_threads attribute_hidden; extern int __librt_multiple_threads; -/* Debugging */ - -#ifdef DEBUG -#include -#define ASSERT assert -#define MSG __pthread_message -#else -#define ASSERT(x) -#define MSG(msg,arg...) -#endif - /* Internal global functions */ void __pthread_destroy_specifics(void); Modified: trunk/uClibc/libpthread/linuxthreads.old/manager.c =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/manager.c 2006-11-03 18:52:35 UTC (rev 16492) +++ trunk/uClibc/libpthread/linuxthreads.old/manager.c 2006-11-03 18:55:00 UTC (rev 16493) @@ -148,7 +148,6 @@ /* Synchronize debugging of the thread manager */ n = TEMP_FAILURE_RETRY(__libc_read(reqfd, (char *)&request, sizeof(request))); - ASSERT(n == sizeof(request) && request.req_kind == REQ_DEBUG); #ifndef USE_SELECT ufd.fd = reqfd; ufd.events = POLLIN; @@ -187,7 +186,6 @@ PDEBUG("before __libc_read\n"); n = __libc_read(reqfd, (char *)&request, sizeof(request)); PDEBUG("after __libc_read, n=%d\n", n); - ASSERT(n == sizeof(request)); switch(request.req_kind) { case REQ_CREATE: PDEBUG("got REQ_CREATE\n"); @@ -698,7 +696,6 @@ pthread_readlock_info *iter, *next; char *h_bottom_save; - ASSERT(th->p_exited); /* Make the handle invalid */ handle = thread_handle(th->p_tid); __pthread_lock(&handle->h_lock, NULL); Modified: trunk/uClibc/libpthread/linuxthreads.old/queue.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/queue.h 2006-11-03 18:52:35 UTC (rev 16492) +++ trunk/uClibc/libpthread/linuxthreads.old/queue.h 2006-11-03 18:55:00 UTC (rev 16493) @@ -21,7 +21,6 @@ static inline void enqueue(pthread_descr * q, pthread_descr th) { int prio = th->p_priority; - ASSERT(th->p_nextwaiting == NULL); for (; *q != NULL; q = &((*q)->p_nextwaiting)) { if (prio > (*q)->p_priority) { th->p_nextwaiting = *q; Modified: trunk/uClibc/libpthread/linuxthreads.old/spinlock.c =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/spinlock.c 2006-11-03 18:52:35 UTC (rev 16492) +++ trunk/uClibc/libpthread/linuxthreads.old/spinlock.c 2006-11-03 18:55:00 UTC (rev 16493) @@ -620,8 +620,6 @@ if (maxprio == INT_MIN) continue; - ASSERT (p_max_prio != (struct wait_node *) 1); - /* Now we want to to remove the max priority thread's wait node from the list. Before we can do this, we must atomically try to change the node's abandon state from zero to nonzero. If we succeed, that means we From andersen at uclibc.org Sat Nov 4 10:33:05 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 10:33:05 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux: common/bits mips/bits Message-ID: <20061104183305.5C7F94859B@busybox.net> Author: andersen Date: 2006-11-04 10:33:04 -0800 (Sat, 04 Nov 2006) New Revision: 16494 Log: based on a patch from Atsushi Nemoto: There is a mismatch of struct msghdr between the kernel and libc. In a 64-bit environment, the size of msg_namelen is 4 for all, but the size of msg_iovlen and msg_controllen is 8 bytes for the kernel and for glibc, but 4 bytes for uClibc. Fix size for the 64bit case. Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/socket.h trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/socket.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/bits/socket.h 2006-11-03 18:55:00 UTC (rev 16493) +++ trunk/uClibc/libc/sysdeps/linux/common/bits/socket.h 2006-11-04 18:33:04 UTC (rev 16494) @@ -215,16 +215,26 @@ /* Note: do not change these members to match glibc; these match the SuSv3 spec already (e.g. msg_iovlen/msg_controllen). http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */ +/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit + platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */ struct msghdr { void *msg_name; /* Address to send to/receive from. */ socklen_t msg_namelen; /* Length of address data. */ struct iovec *msg_iov; /* Vector of data to send/receive into. */ +#if __WORDSIZE == 32 int msg_iovlen; /* Number of elements in the vector. */ +#else + size_t msg_iovlen; /* Number of elements in the vector. */ +#endif void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ +#if __WORDSIZE == 32 socklen_t msg_controllen; /* Ancillary data buffer length. */ +#else + size_t msg_controllen; /* Ancillary data buffer length. */ +#endif int msg_flags; /* Flags on received message. */ }; Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h 2006-11-03 18:55:00 UTC (rev 16493) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h 2006-11-04 18:33:04 UTC (rev 16494) @@ -213,16 +213,29 @@ /* Structure describing messages sent by `sendmsg' and received by `recvmsg'. */ +/* Note: do not change these members to match glibc; these match the + SuSv3 spec already (e.g. msg_iovlen/msg_controllen). + http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/socket.h.html */ +/* Note: linux kernel uses __kernel_size_t (which is 8bytes on 64bit + platforms, and 4bytes on 32bit platforms) for msg_iovlen/msg_controllen */ struct msghdr { void *msg_name; /* Address to send to/receive from. */ socklen_t msg_namelen; /* Length of address data. */ struct iovec *msg_iov; /* Vector of data to send/receive into. */ +#if __WORDSIZE == 32 int msg_iovlen; /* Number of elements in the vector. */ +#else + size_t msg_iovlen; /* Number of elements in the vector. */ +#endif void *msg_control; /* Ancillary data (eg BSD filedesc passing). */ +#if __WORDSIZE == 32 socklen_t msg_controllen; /* Ancillary data buffer length. */ +#else + size_t msg_controllen; /* Ancillary data buffer length. */ +#endif int msg_flags; /* Flags on received message. */ }; From bugs at busybox.net Sat Nov 4 10:34:05 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Sat, 4 Nov 2006 10:34:05 -0800 Subject: [uClibc 0000940]: iproute2 'OVERRUN: Bad address' on x86_64 Message-ID: <2516bfb1ae4af268e939f2452d539780@bugs.uclibc.org> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=940 ====================================================================== Reported By: jalsot Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 940 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 07-10-2006 12:11 PDT Last Modified: 11-04-2006 10:34 PST ====================================================================== Summary: iproute2 'OVERRUN: Bad address' on x86_64 Description: Binaries from iproute2 from buildroot doesn't work on x86_64. It gives 'OVERRUN: Bad address' message. NETLINK is set in linux kernel, but it seems, the problem is in communication [see strace output]. On irc someboyd [mnemoc] has got the same issue. He had different gcc [gcc-4.1.1]. He has x86_64 as well. As he reported, on another architecture [I guess i686] the problem disappears with the same environment. He tried uclibc-0.9.28 as well without success. As he reported, with diet libc it works well with same version of kernel, iproute2 and compilation conditions. I also tried iproute2-2.6.16-060323 but didn't help. As we the traces shows, the problem might be with uClibc. ====================================================================== ---------------------------------------------------------------------- mnemoc - 07-10-06 12:31 ---------------------------------------------------------------------- i have the same problem with iproute2's ip and BB's ip (1.1.3 and 1.2.0) against uclibc 0.9.28 and uclibc snapshot (random days during the last two weeks). gcc 4.1.1, using T2 (http://www.t2-project.org/) instead of buildroot. i'm attaching the syscall traces of uclibc/iproute2 and then dietlibc/iproute2, both static with the same versions of everything (gcc=4.1.1). this issue happens on x86_64 and not on athlon xp or p4. no idea about other 64bits architectures. $ strace -vvfF ./uemb-2.3-trunk-mnemosyne-x86-64-opteron/sbin/ip addr show execve("./uemb-2.3-trunk-mnemosyne-x86-64-opteron/sbin/ip", ["./uemb-2.3-trunk-mnemosyne-x86-6"..., "addr", "show"], ["MANPATH=/usr/share/man", "SHELL=/bin/bash", "TERM=screen", "USER=amery", "HISTFILESIZE=50", "T2DOWNOPT=-alt-dir /voldata/down"..., "LS_COLORS=", "TERMCAP=SC|screen|VT 100/ANSI X3"..., "PAGER=less -R", "PATH=/command:/home/amery/bin:/c"..., "STY=8661.mnemoc", "BLOCKSIZE=K", "PWD=/home/amery/building/t2-trun"..., "INPUTRC=/etc/inputrc", "EDITOR=vi", "PS1=\\[\\033[1;34m\\][\\[\\033[1;36m\\"..., "SVN_SSH=ssh -i /home/amery/.ssh/"..., "HISTCONTROL=ignoredups", "HOME=/home/amery", "SHLVL=2", "LOGNAME=amery", "LESS=--ignore-case", "CVS_RSH=ssh", "WINDOW=4", "PKG_CONFIG_PATH=/usr/lib/pkgconf"..., "LESSOPEN=|lesspipe %s", "BROWSER=links", "INFOPATH=/usr/share/info", "OLDPWD=/home/amery/building/t2-t"..., "_=/usr/bin/strace"]) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x2504, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {c_iflags=0x2504, c_oflags=0x5, c_cflags=0xbf, c_lflags=0x8a3b, c_line=0, c_cc="\x03\x1c\x7f\x15\x04\x00\x01\x00\x11\x13\x1a\x00\x12\x0f\x17\x16\x00\x00\x00"}) = 0 socket(PF_NETLINK, SOCK_RAW, 0) = 3 setsockopt(3, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0 setsockopt(3, SOL_SOCKET, SO_RCVBUF, [140737488388096], 4) = 0 bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0 getsockname(3, {sa_family=AF_NETLINK, pid=5561, groups=00000000}, [18412476522519592972]) = 0 time(NULL) = 1152559095 sendto(3, "\24\0\0\0\22\0\1\3\370\247\262D\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{ptrace: umoven: Input/output error 0x7fff00000000, 16384}], msg_controllen=0, msg_flags=0}, 0) = 236 brk(0) = 0x636000 brk(0x637000) = 0x637000 recvmsg(3, 0x7fffff862d70, 0) = -1 EFAULT (Bad address) write(2, "OVERRUN", 7OVERRUN) = 7 write(2, ": ", 2: ) = 2 write(2, "Bad address", 11Bad address) = 11 write(2, "\n", 1 ) = 1 $ strace -vvfF ./dietemb-2.3-trunk-mnemosyne-x86-64-opteron/sbin/ip addr show execve("./dietemb-2.3-trunk-mnemosyne-x86-64-opteron/sbin/ip", ["./dietemb-2.3-trunk-mnemosyne-x8"..., "addr", "show"], ["MANPATH=/usr/share/man", "SHELL=/bin/bash", "TERM=screen", "USER=amery", "HISTFILESIZE=50", "T2DOWNOPT=-alt-dir /voldata/down"..., "LS_COLORS=", "TERMCAP=SC|screen|VT 100/ANSI X3"..., "PAGER=less -R", "PATH=/command:/home/amery/bin:/c"..., "STY=8661.mnemoc", "BLOCKSIZE=K", "PWD=/home/amery/building/t2-trun"..., "INPUTRC=/etc/inputrc", "EDITOR=vi", "PS1=\\[\\033[1;34m\\][\\[\\033[1;36m\\"..., "SVN_SSH=ssh -i /home/amery/.ssh/"..., "HISTCONTROL=ignoredups", "HOME=/home/amery", "SHLVL=2", "LOGNAME=amery", "LESS=--ignore-case", "CVS_RSH=ssh", "WINDOW=4", "PKG_CONFIG_PATH=/usr/lib/pkgconf"..., "LESSOPEN=|lesspipe %s", "BROWSER=links", "INFOPATH=/usr/share/info", "OLDPWD=/home/amery/building/t2-t"..., "_=/usr/bin/strace"]) = 0 socket(PF_NETLINK, SOCK_RAW, 0) = 3 setsockopt(3, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0 setsockopt(3, SOL_SOCKET, SO_RCVBUF, [140737488388096], 4) = 0 bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0 getsockname(3, {sa_family=AF_NETLINK, pid=5758, groups=00000000}, [18418382205630808076]) = 0 time(NULL) = 1152559188 sendto(3, "\24\0\0\0\22\0\1\3U\250\262D\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\354\0\0\0\20\0\2\0U\250\262D~\26\0\0\0\0\1\0\22\0\0\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 236 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af0f5272000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af0f5273000 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0U\250\262D~\26\0\0\0\0\0\0\22\0\0\0\303"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 20 sendto(3, "\24\0\0\0\26\0\1\3V\250\262D\0\0\0\0\0\0\0\0", 20, 0, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"D\0\0\0\24\0\2\0V\250\262D~\26\0\0\2\30\201\0\22\0\0\0"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 68 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2af0f5274000 recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"\24\0\0\0\3\0\2\0V\250\262D~\26\0\0\0\0\0\0\22\0\0\0\10"..., 16384}], msg_controllen=0, msg_flags=0}, 0) = 20 socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4 ioctl(4, SIOCGIFTXQLEN, 0x7fffff9b28e0) = 0 close(4) = 0 write(1, "18: dummy0: "..., 5718: dummy0: mtu 1500 qdisc noqueue ) = 57 write(1, " link/ether 06:4c:27:44:2e:92"..., 55 link/ether 06:4c:27:44:2e:92 brd ff:ff:ff:ff:ff:ff ) = 55 write(1, " inet 192.168.20.1/24 brd 192"..., 74 inet 192.168.20.1/24 brd 192.168.20.255 scope global secondary dummy0 ) = 74 _exit(0) ---------------------------------------------------------------------- jalsot - 07-10-06 15:06 ---------------------------------------------------------------------- What is interesting, e.g. 'ip link set eth0 mtu 1200' and 'ip rule' works partially: # ip rule 0: from all lookup local 32766: from all lookup main 32767: from all lookup default OVERRUN: Bad address ---------------------------------------------------------------------- andersen - 11-04-06 10:34 ---------------------------------------------------------------------- fixed with svn commit 16494 Issue History Date Modified Username Field Change ====================================================================== 07-10-06 12:11 jalsot New Issue 07-10-06 12:11 jalsot Status new => assigned 07-10-06 12:11 jalsot Assigned To => uClibc 07-10-06 12:25 mnemoc Issue Monitored: mnemoc 07-10-06 12:31 mnemoc Note Added: 0001508 07-10-06 15:06 jalsot Note Added: 0001512 11-04-06 10:34 andersen Note Added: 0001729 11-04-06 10:34 andersen Status assigned => closed 11-04-06 10:34 andersen Resolution open => fixed ====================================================================== From andersen at uclibc.org Sat Nov 4 11:44:01 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:44:01 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips Message-ID: <20061104194401.1BDF3485AB@busybox.net> Author: andersen Date: 2006-11-04 11:44:00 -0800 (Sat, 04 Nov 2006) New Revision: 16496 Log: mips64 patch from Atsushi Nemoto: It seems these codes dropped when importing from glibc. This is required for mips64. Modified: trunk/uClibc/libc/sysdeps/linux/mips/sigaction.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/sigaction.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/sigaction.c 2006-11-04 19:15:56 UTC (rev 16495) +++ trunk/uClibc/libc/sysdeps/linux/mips/sigaction.c 2006-11-04 19:44:00 UTC (rev 16496) @@ -33,6 +33,16 @@ libc_hidden_proto(memcpy) +#if _MIPS_SIM != _ABIO32 + +# ifdef __NR_rt_sigreturn +static void restore_rt (void) asm ("__restore_rt"); +# endif +# ifdef __NR_sigreturn +static void restore (void) asm ("__restore"); +# endif +#endif + /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) @@ -119,3 +129,31 @@ weak_alias(__libc_sigaction,sigaction) libc_hidden_weak(sigaction) #endif + +/* NOTE: Please think twice before making any changes to the bits of + code below. GDB needs some intimate knowledge about it to + recognize them as signal trampolines, and make backtraces through + signal handlers work right. Important are both the names + (__restore_rt) and the exact instruction sequence. + If you ever feel the need to make any changes, please notify the + appropriate GDB maintainer. */ + +#define RESTORE(name, syscall) RESTORE2 (name, syscall) +#define RESTORE2(name, syscall) \ +asm \ + ( \ + ".align 4\n" \ + "__" #name ":\n" \ + " li $2, " #syscall "\n" \ + " syscall\n" \ + ); + +/* The return code for realtime-signals. */ +#if _MIPS_SIM != _ABIO32 +# ifdef __NR_rt_sigreturn +RESTORE (restore_rt, __NR_rt_sigreturn) +# endif +# ifdef __NR_sigreturn +RESTORE (restore, __NR_sigreturn) +# endif +#endif From andersen at uclibc.org Sat Nov 4 11:44:51 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:44:51 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips/bits Message-ID: <20061104194451.CFD73485B7@busybox.net> Author: andersen Date: 2006-11-04 11:44:51 -0800 (Sat, 04 Nov 2006) New Revision: 16497 Log: mips64 patch from Atsushi Nemoto: The predefined _MIPS_SZPTR (32 for O32 or N32, 64 for N64) can be used for WORDSIZE. This is came from glibc code. Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h 2006-11-04 19:44:00 UTC (rev 16496) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/wordsize.h 2006-11-04 19:44:51 UTC (rev 16497) @@ -1,4 +1,4 @@ -/* Copyright (C) 1999 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003 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 @@ -16,4 +16,4 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define __WORDSIZE 32 +#define __WORDSIZE _MIPS_SZPTR From andersen at uclibc.org Sat Nov 4 11:45:37 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:45:37 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips/bits Message-ID: <20061104194537.C0ADC485B8@busybox.net> Author: andersen Date: 2006-11-04 11:45:37 -0800 (Sat, 04 Nov 2006) New Revision: 16498 Log: mips64 patch from Atsushi Nemoto: The kernel include/asm-mips/posix_types.h defines __kernel_ino_t as unsigned long. Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h 2006-11-04 19:44:51 UTC (rev 16497) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_types.h 2006-11-04 19:45:37 UTC (rev 16498) @@ -9,7 +9,7 @@ # if __WORDSIZE == 64 typedef unsigned int __kernel_dev_t; -typedef unsigned int __kernel_ino_t; +typedef unsigned long __kernel_ino_t; typedef unsigned int __kernel_mode_t; typedef unsigned int __kernel_nlink_t; typedef long __kernel_off_t; From andersen at uclibc.org Sat Nov 4 11:47:04 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:47:04 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips/bits Message-ID: <20061104194704.7C41D485BA@busybox.net> Author: andersen Date: 2006-11-04 11:47:04 -0800 (Sat, 04 Nov 2006) New Revision: 16499 Log: mips64 patch from Atsushi Nemoto This is a bit twisted dirent.h can be used for both getdirent and getdirent64 case on mips/mips64. Added: trunk/uClibc/libc/sysdeps/linux/mips/bits/dirent.h Changeset: Added: trunk/uClibc/libc/sysdeps/linux/mips/bits/dirent.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/dirent.h 2006-11-04 19:45:37 UTC (rev 16498) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/dirent.h 2006-11-04 19:47:04 UTC (rev 16499) @@ -0,0 +1,61 @@ +/* Copyright (C) 1996, 1997 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. */ + +#ifndef _DIRENT_H +# error "Never use directly; include instead." +#endif +#include +#include + +struct dirent + { +#if defined(__USE_FILE_OFFSET64) && defined(__NR_getdents64) + __ino64_t d_ino; + __off64_t d_off; +#else + __ino_t d_ino; + __off_t d_off; +#endif + unsigned short int d_reclen; + unsigned char d_type; + char d_name[256]; /* We must not include limits.h! */ + }; + +#ifdef __USE_LARGEFILE64 +struct dirent64 + { +#ifdef __NR_getdents64 + __ino64_t d_ino; + __off64_t d_off; +#else + /* dirent64 is the same as dirent. */ + __ino_t d_ino; + __off_t d_off; +#endif + unsigned short int d_reclen; + unsigned char d_type; + char d_name[256]; /* We must not include limits.h! */ + }; +#endif + +#define d_fileno d_ino /* Backwards compatibility. */ + +#undef _DIRENT_HAVE_D_NAMLEN +#define _DIRENT_HAVE_D_RECLEN +#define _DIRENT_HAVE_D_OFF +#define _DIRENT_HAVE_D_TYPE From andersen at uclibc.org Sat Nov 4 11:48:12 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:48:12 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/string/mips Message-ID: <20061104194812.A2733485BF@busybox.net> Author: andersen Date: 2006-11-04 11:48:12 -0800 (Sat, 04 Nov 2006) New Revision: 16500 Log: mips64 patch from Atsushi Nemoto: Import mips64 version of memset, memcpy from glibc. Modified: trunk/uClibc/libc/string/mips/memcpy.S trunk/uClibc/libc/string/mips/memset.S Changeset: Modified: trunk/uClibc/libc/string/mips/memcpy.S =================================================================== --- trunk/uClibc/libc/string/mips/memcpy.S 2006-11-04 19:47:04 UTC (rev 16499) +++ trunk/uClibc/libc/string/mips/memcpy.S 2006-11-04 19:48:12 UTC (rev 16500) @@ -22,12 +22,125 @@ #include #include "sysdep.h" +/* void *memcpy(void *s1, const void *s2, size_t n); */ + #ifdef __mips64 -#error mips32 code being compiled for mips64! + +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +# define LDHI ldl /* high part is left in big-endian */ +# define SDHI sdl /* high part is left in big-endian */ +# define LDLO ldr /* low part is right in big-endian */ +# define SDLO sdr /* low part is right in big-endian */ +#else +# define LDHI ldr /* high part is right in little-endian */ +# define SDHI sdr /* high part is right in little-endian */ +# define LDLO ldl /* low part is left in little-endian */ +# define SDLO sdl /* low part is left in little-endian */ #endif -/* void *memcpy(void *s1, const void *s2, size_t n); */ +ENTRY (memcpy) + .set noreorder + slti t0, a2, 16 # Less than 16? + bne t0, zero, L(last16) + move v0, a0 # Setup exit value before too late + + xor t0, a1, a0 # Find a0/a1 displacement + andi t0, 0x7 + bne t0, zero, L(shift) # Go handle the unaligned case + PTR_SUBU t1, zero, a1 + andi t1, 0x7 # a0/a1 are aligned, but are we + beq t1, zero, L(chk8w) # starting in the middle of a word? + PTR_SUBU a2, t1 + LDHI t0, 0(a1) # Yes we are... take care of that + PTR_ADDU a1, t1 + SDHI t0, 0(a0) + PTR_ADDU a0, t1 + +L(chk8w): + andi t0, a2, 0x3f # 64 or more bytes left? + beq t0, a2, L(chk1w) + PTR_SUBU a3, a2, t0 # Yes + PTR_ADDU a3, a1 # a3 = end address of loop + move a2, t0 # a2 = what will be left after loop +L(lop8w): + ld t0, 0(a1) # Loop taking 8 words at a time + ld t1, 8(a1) + ld t2, 16(a1) + ld t3, 24(a1) + ld ta0, 32(a1) + ld ta1, 40(a1) + ld ta2, 48(a1) + ld ta3, 56(a1) + PTR_ADDIU a0, 64 + PTR_ADDIU a1, 64 + sd t0, -64(a0) + sd t1, -56(a0) + sd t2, -48(a0) + sd t3, -40(a0) + sd ta0, -32(a0) + sd ta1, -24(a0) + sd ta2, -16(a0) + bne a1, a3, L(lop8w) + sd ta3, -8(a0) + +L(chk1w): + andi t0, a2, 0x7 # 8 or more bytes left? + beq t0, a2, L(last16) + PTR_SUBU a3, a2, t0 # Yes, handle them one dword at a time + PTR_ADDU a3, a1 # a3 again end address + move a2, t0 +L(lop1w): + ld t0, 0(a1) + PTR_ADDIU a0, 8 + PTR_ADDIU a1, 8 + bne a1, a3, L(lop1w) + sd t0, -8(a0) + +L(last16): + blez a2, L(lst16e) # Handle last 16 bytes, one at a time + PTR_ADDU a3, a2, a1 +L(lst16l): + lb t0, 0(a1) + PTR_ADDIU a0, 1 + PTR_ADDIU a1, 1 + bne a1, a3, L(lst16l) + sb t0, -1(a0) +L(lst16e): + jr ra # Bye, bye + nop + +L(shift): + PTR_SUBU a3, zero, a0 # Src and Dest unaligned + andi a3, 0x7 # (unoptimized case...) + beq a3, zero, L(shft1) + PTR_SUBU a2, a3 # a2 = bytes left + LDHI t0, 0(a1) # Take care of first odd part + LDLO t0, 7(a1) + PTR_ADDU a1, a3 + SDHI t0, 0(a0) + PTR_ADDU a0, a3 +L(shft1): + andi t0, a2, 0x7 + PTR_SUBU a3, a2, t0 + PTR_ADDU a3, a1 +L(shfth): + LDHI t1, 0(a1) # Limp through, dword by dword + LDLO t1, 7(a1) + PTR_ADDIU a0, 8 + PTR_ADDIU a1, 8 + bne a1, a3, L(shfth) + sd t1, -8(a0) + b L(last16) # Handle anything which may be left + move a2, t0 + + .set reorder +END (memcpy) + +#else /* !__mips64 */ + #if __BYTE_ORDER == __BIG_ENDIAN # define LWHI lwl /* high part is left in big-endian */ # define SWHI swl /* high part is left in big-endian */ @@ -139,4 +252,6 @@ .set reorder END (memcpy) +#endif /* !__mips64 */ + libc_hidden_def(memcpy) Modified: trunk/uClibc/libc/string/mips/memset.S =================================================================== --- trunk/uClibc/libc/string/mips/memset.S 2006-11-04 19:47:04 UTC (rev 16499) +++ trunk/uClibc/libc/string/mips/memset.S 2006-11-04 19:48:12 UTC (rev 16500) @@ -22,12 +22,77 @@ #include #include "sysdep.h" +/* void *memset(void *s, int c, size_t n). */ + #ifdef __mips64 -#error mips32 code being compiled for mips64! + +#include + +#if __BYTE_ORDER == __BIG_ENDIAN +# define SDHI sdl /* high part is left in big-endian */ +#else +# define SDHI sdr /* high part is right in little-endian */ #endif -/* void *memset(void *s, int c, size_t n). */ +ENTRY (memset) + .set noreorder + slti ta1, a2, 16 # Less than 16? + bne ta1, zero, L(last16) + move v0, a0 # Setup exit value before too late + + beq a1, zero, L(ueven) # If zero pattern, no need to extend + andi a1, 0xff # Avoid problems with bogus arguments + dsll ta0, a1, 8 + or a1, ta0 + dsll ta0, a1, 16 + or a1, ta0 # a1 is now pattern in full word + dsll ta0, a1, 32 + or a1, ta0 # a1 is now pattern in double word + +L(ueven): + PTR_SUBU ta0, zero, a0 # Unaligned address? + andi ta0, 0x7 + beq ta0, zero, L(chkw) + PTR_SUBU a2, ta0 + SDHI a1, 0(a0) # Yes, handle first unaligned part + PTR_ADDU a0, ta0 # Now both a0 and a2 are updated + +L(chkw): + andi ta0, a2, 0xf # Enough left for one loop iteration? + beq ta0, a2, L(chkl) + PTR_SUBU a3, a2, ta0 + PTR_ADDU a3, a0 # a3 is last loop address +1 + move a2, ta0 # a2 is now # of bytes left after loop +L(loopw): + PTR_ADDIU a0, 16 # Handle 2 dwords pr. iteration + sd a1, -16(a0) + bne a0, a3, L(loopw) + sd a1, -8(a0) + +L(chkl): + andi ta0, a2, 0x8 # Check if there is at least a double + beq ta0, zero, L(last16) # word remaining after the loop + PTR_SUBU a2, ta0 + sd a1, 0(a0) # Yes... + PTR_ADDIU a0, 8 + +L(last16): + blez a2, L(exit) # Handle last 16 bytes (if cnt>0) + PTR_ADDU a3, a2, a0 # a3 is last address +1 +L(lst16l): + PTR_ADDIU a0, 1 + bne a0, a3, L(lst16l) + sb a1, -1(a0) +L(exit): + j ra # Bye, bye + nop + + .set reorder +END (memset) + +#else /* !__mips64 */ + #if __BYTE_ORDER == __BIG_ENDIAN # define SWHI swl /* high part is left in big-endian */ #else @@ -89,4 +154,6 @@ .set reorder END (memset) +#endif /* !__mips64 */ + libc_hidden_def(memset) From andersen at uclibc.org Sat Nov 4 11:49:19 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:49:19 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips/bits Message-ID: <20061104194919.17FE9485C1@busybox.net> Author: andersen Date: 2006-11-04 11:49:18 -0800 (Sat, 04 Nov 2006) New Revision: 16501 Log: mips64 patch from Atsushi Nemoto: The mips64 N32/N64 ABI can pass much arguments via registers. Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h 2006-11-04 19:48:12 UTC (rev 16500) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/syscalls.h 2006-11-04 19:49:18 UTC (rev 16501) @@ -8,6 +8,7 @@ * header files. It also defines the traditional `SYS_' macros for older * programs. */ #include +#include #ifndef __ASSEMBLER__ @@ -152,6 +153,7 @@ return (type)-1; \ } +#if _MIPS_SIM == _MIPS_SIM_ABI32 #define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ type name (atype a,btype b,ctype c,dtype d,etype e) \ { \ @@ -262,6 +264,100 @@ __set_errno(sys_result); \ return (type)-1; \ } +#else /* N32 || N64 */ +#define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \ +type name (atype a,btype b,ctype c,dtype d,etype e) \ +{ \ + long err; \ + long sys_result; \ + { \ + register unsigned long __v0 asm("$2"); \ + register unsigned long __a0 asm("$4") = (unsigned long) a; \ + register unsigned long __a1 asm("$5") = (unsigned long) b; \ + register unsigned long __a2 asm("$6") = (unsigned long) c; \ + register unsigned long __a3 asm("$7") = (unsigned long) d; \ + register unsigned long __a4 asm("$8") = (unsigned long) e; \ + __asm__ volatile ( \ + ".set noreorder\n\t" \ + "li $2, %6\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (SYS_ify(name)) \ + : "$1", "$3", "$9", "$10", "$11", "$12", "$13", \ + "$14", "$15", "$24", "$25", "memory"); \ + err = __a3; \ + sys_result = __v0; \ + } \ + if (err == 0) \ + return (type) sys_result; \ + __set_errno(sys_result); \ + return (type)-1; \ +} +#define _syscall6(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f) \ +type name (atype a,btype b,ctype c,dtype d,etype e,ftype f) \ +{ \ + long err; \ + long sys_result; \ + { \ + register unsigned long __v0 asm("$2"); \ + register unsigned long __a0 asm("$4") = (unsigned long) a; \ + register unsigned long __a1 asm("$5") = (unsigned long) b; \ + register unsigned long __a2 asm("$6") = (unsigned long) c; \ + register unsigned long __a3 asm("$7") = (unsigned long) d; \ + register unsigned long __a4 asm("$8") = (unsigned long) e; \ + register unsigned long __a5 asm("$9") = (unsigned long) f; \ + __asm__ volatile ( \ + ".set noreorder\n\t" \ + "li $2, %7\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "r" (__a5), "i" (SYS_ify(name)) \ + : "$1", "$3", "$10", "$11", "$12", "$13", \ + "$14", "$15", "$24", "$25", "memory"); \ + err = __a3; \ + sys_result = __v0; \ + } \ + if (err == 0) \ + return (type) sys_result; \ + __set_errno(sys_result); \ + return (type)-1; \ +} + +#define _syscall7(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e,ftype,f,gtype,g) \ +type name (atype a,btype b,ctype c,dtype d,etype e,ftype f,gtype g) \ +{ \ + long err; \ + long sys_result; \ + { \ + register unsigned long __v0 asm("$2"); \ + register unsigned long __a0 asm("$4") = (unsigned long) a; \ + register unsigned long __a1 asm("$5") = (unsigned long) b; \ + register unsigned long __a2 asm("$6") = (unsigned long) c; \ + register unsigned long __a3 asm("$7") = (unsigned long) d; \ + register unsigned long __a4 asm("$8") = (unsigned long) e; \ + register unsigned long __a5 asm("$9") = (unsigned long) f; \ + register unsigned long __a6 asm("$10") = (unsigned long) g; \ + __asm__ volatile ( \ + ".set noreorder\n\t" \ + "li $2, %8\t\t\t# " #name "\n\t" \ + "syscall\n\t" \ + ".set reorder" \ + : "=r" (__v0), "+r" (__a3) \ + : "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "r" (__a5), "r" (__a6), "i" (SYS_ify(name)) \ + : "$1", "$3", "$11", "$12", "$13", \ + "$14", "$15", "$24", "$25", "memory"); \ + err = __a3; \ + sys_result = __v0; \ + } \ + if (err == 0) \ + return (type) sys_result; \ + __set_errno(sys_result); \ + return (type)-1; \ +} +#endif /* N32 || N64 */ + #endif /* __ASSEMBLER__ */ #endif /* _BITS_SYSCALLS_H */ From andersen at uclibc.org Sat Nov 4 11:50:20 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:50:20 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips: bits Message-ID: <20061104195020.A873B485C6@busybox.net> Author: andersen Date: 2006-11-04 11:50:20 -0800 (Sat, 04 Nov 2006) New Revision: 16502 Log: mips64 patch from Atsushi Nemoto: The mips64 N32/N64 ABI have a bit different register usage convention. Also the register size for these ABI is 8 byte. Use ld/sd for them. Modified: trunk/uClibc/libc/sysdeps/linux/mips/__longjmp.c trunk/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h trunk/uClibc/libc/sysdeps/linux/mips/bsd-_setjmp.S trunk/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S trunk/uClibc/libc/sysdeps/linux/mips/setjmp.S trunk/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/__longjmp.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/__longjmp.c 2006-11-04 19:49:18 UTC (rev 16501) +++ trunk/uClibc/libc/sysdeps/linux/mips/__longjmp.c 2006-11-04 19:50:20 UTC (rev 16502) @@ -20,6 +20,7 @@ #include #include #include +#include #ifndef __GNUC__ #error This file uses GNU C extensions; you must compile with GCC. @@ -38,12 +39,23 @@ /* Pull back the floating point callee-saved registers. */ #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + __asm__ __volatile__ ("l.d $f24, %0" : : "m" (env[0].__fpregs[0])); + __asm__ __volatile__ ("l.d $f25, %0" : : "m" (env[0].__fpregs[1])); + __asm__ __volatile__ ("l.d $f26, %0" : : "m" (env[0].__fpregs[2])); + __asm__ __volatile__ ("l.d $f27, %0" : : "m" (env[0].__fpregs[3])); + __asm__ __volatile__ ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); + __asm__ __volatile__ ("l.d $f29, %0" : : "m" (env[0].__fpregs[5])); + __asm__ __volatile__ ("l.d $f30, %0" : : "m" (env[0].__fpregs[6])); + __asm__ __volatile__ ("l.d $f31, %0" : : "m" (env[0].__fpregs[7])); +#else /* O32 || N32 */ __asm__ __volatile__ ("l.d $f20, %0" : : "m" (env[0].__fpregs[0])); __asm__ __volatile__ ("l.d $f22, %0" : : "m" (env[0].__fpregs[1])); __asm__ __volatile__ ("l.d $f24, %0" : : "m" (env[0].__fpregs[2])); __asm__ __volatile__ ("l.d $f26, %0" : : "m" (env[0].__fpregs[3])); __asm__ __volatile__ ("l.d $f28, %0" : : "m" (env[0].__fpregs[4])); __asm__ __volatile__ ("l.d $f30, %0" : : "m" (env[0].__fpregs[5])); +#endif /* O32 || N32 */ /* Get and reconstruct the floating point csr. */ __asm__ __volatile__ ("lw $2, %0" : : "m" (env[0].__fpc_csr)); @@ -51,9 +63,14 @@ #endif /* Get the GP. */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + __asm__ __volatile__ ("ld $gp, %0" : : "m" (env[0].__gp)); +#else /* O32 || N32 */ __asm__ __volatile__ ("lw $gp, %0" : : "m" (env[0].__gp)); +#endif /* O32 || N32 */ /* Get the callee-saved registers. */ +#if _MIPS_SIM == _MIPS_SIM_ABI32 __asm__ __volatile__ ("lw $16, %0" : : "m" (env[0].__regs[0])); __asm__ __volatile__ ("lw $17, %0" : : "m" (env[0].__regs[1])); __asm__ __volatile__ ("lw $18, %0" : : "m" (env[0].__regs[2])); @@ -62,15 +79,36 @@ __asm__ __volatile__ ("lw $21, %0" : : "m" (env[0].__regs[5])); __asm__ __volatile__ ("lw $22, %0" : : "m" (env[0].__regs[6])); __asm__ __volatile__ ("lw $23, %0" : : "m" (env[0].__regs[7])); +#else /* N32 || N64 */ + __asm__ __volatile__ ("ld $16, %0" : : "m" (env[0].__regs[0])); + __asm__ __volatile__ ("ld $17, %0" : : "m" (env[0].__regs[1])); + __asm__ __volatile__ ("ld $18, %0" : : "m" (env[0].__regs[2])); + __asm__ __volatile__ ("ld $19, %0" : : "m" (env[0].__regs[3])); + __asm__ __volatile__ ("ld $20, %0" : : "m" (env[0].__regs[4])); + __asm__ __volatile__ ("ld $21, %0" : : "m" (env[0].__regs[5])); + __asm__ __volatile__ ("ld $22, %0" : : "m" (env[0].__regs[6])); + __asm__ __volatile__ ("ld $23, %0" : : "m" (env[0].__regs[7])); +#endif /* N32 || N64 */ /* Get the PC. */ +#if _MIPS_SIM == _MIPS_SIM_ABI32 __asm__ __volatile__ ("lw $25, %0" : : "m" (env[0].__pc)); +#elif _MIPS_SIM == _MIPS_SIM_NABI32 + __asm__ __volatile__ ("lw $31, %0" : : "m" (env[0].__pc)); +#else /* N64 */ + __asm__ __volatile__ ("ld $31, %0" : : "m" (env[0].__pc)); +#endif /* N64 */ /* Restore the stack pointer and the FP. They have to be restored last and in a single asm as gcc, depending on options used, may use either of them to access env. */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + __asm__ __volatile__ ("ld $29, %0\n\t" + "ld $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp)); +#else /* O32 || N32 */ __asm__ __volatile__ ("lw $29, %0\n\t" "lw $30, %1\n\t" : : "m" (env[0].__sp), "m" (env[0].__fp)); +#endif /* O32 || N32 */ /* Give setjmp 1 if given a 0, or what they gave us if non-zero. */ if (val == 0) @@ -78,7 +116,11 @@ else __asm__ __volatile__ ("move $2, %0" : : "r" (val)); +#if _MIPS_SIM == _MIPS_SIM_ABI32 __asm__ __volatile__ ("jr $25"); +#else /* N32 || N64 */ + __asm__ __volatile__ ("jr $31"); +#endif /* N32 || N64 */ /* Avoid `volatile function does return' warnings. */ for (;;); Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h 2006-11-04 19:49:18 UTC (rev 16501) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/setjmp.h 2006-11-04 19:50:20 UTC (rev 16502) @@ -24,6 +24,8 @@ # error "Never include directly; use instead." #endif +#include + typedef struct { /* Program counter. */ @@ -33,7 +35,11 @@ void * __sp; /* Callee-saved registers s0 through s7. */ +#if _MIPS_SIM == _MIPS_SIM_ABI32 int __regs[8]; +#else + long long __regs[8]; +#endif /* The frame pointer. */ void * __fp; @@ -45,7 +51,11 @@ int __fpc_csr; /* Callee-saved floating point registers. */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + double __fpregs[8]; +#else /* N32 || O32 */ double __fpregs[6]; +#endif /* N32 || O32 */ } __jmp_buf[1]; #ifdef __USE_MISC Modified: trunk/uClibc/libc/sysdeps/linux/mips/bsd-_setjmp.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bsd-_setjmp.S 2006-11-04 19:49:18 UTC (rev 16501) +++ trunk/uClibc/libc/sysdeps/linux/mips/bsd-_setjmp.S 2006-11-04 19:50:20 UTC (rev 16502) @@ -22,6 +22,7 @@ in setjmp doesn't clobber the state restored by longjmp. */ #include +#include #ifdef __PIC__ .option pic2 @@ -35,11 +36,17 @@ _setjmp: #ifdef __PIC__ +#if (_MIPS_SIM == _MIPS_SIM_ABI32) .set noreorder .cpload t9 .set reorder la t9, __sigsetjmp +#else + .cpsetup t9, v0, _setjmp + PTR_LA t9, __sigsetjmp + .cpreturn #endif +#endif move a1,zero /* Pass a second argument of zero. */ #ifdef __PIC__ jr t9 Modified: trunk/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S 2006-11-04 19:49:18 UTC (rev 16501) +++ trunk/uClibc/libc/sysdeps/linux/mips/bsd-setjmp.S 2006-11-04 19:50:20 UTC (rev 16502) @@ -22,6 +22,7 @@ in setjmp doesn't clobber the state restored by longjmp. */ #include +#include #ifdef __PIC__ .option pic2 @@ -36,9 +37,15 @@ setjmp: .set noreorder #ifdef __PIC__ +#if _MIPS_SIM == _MIPS_SIM_ABI32 .cpload t9 .set reorder la t9, __sigsetjmp +#else /* N32 */ + .cpsetup t9, v0, setjmp + PTR_LA t9, __sigsetjmp + .cprestore +#endif /* N32 */ #endif li a1, 1 /* Pass a second argument of one. */ #ifdef __PIC__ Modified: trunk/uClibc/libc/sysdeps/linux/mips/setjmp.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/setjmp.S 2006-11-04 19:49:18 UTC (rev 16501) +++ trunk/uClibc/libc/sysdeps/linux/mips/setjmp.S 2006-11-04 19:50:20 UTC (rev 16502) @@ -17,6 +17,7 @@ 02111-1307 USA. */ #include +#include /* The function __sigsetjmp_aux saves all the registers, but it can't reliably access the stack or frame pointers, so we pass them in as @@ -35,7 +36,11 @@ __sigsetjmp: #ifdef __PIC__ .set noreorder +#if _MIPS_SIM == _MIPS_SIM_ABI32 .cpload t9 +#else + .cpsetup t9, v0, __sigsetjmp +#endif .set reorder #endif move a2, sp @@ -45,7 +50,10 @@ move a3, $fp #endif #ifdef __PIC__ - la t9, __sigsetjmp_aux + PTR_LA t9, __sigsetjmp_aux +#if _MIPS_SIM != _MIPS_SIM_ABI32 + .cpreturn +#endif jr t9 #else j __sigsetjmp_aux Modified: trunk/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c 2006-11-04 19:49:18 UTC (rev 16501) +++ trunk/uClibc/libc/sysdeps/linux/mips/setjmp_aux.c 2006-11-04 19:50:20 UTC (rev 16502) @@ -19,6 +19,8 @@ #include #include +#include +#include /* This function is only called via the assembly language routine __sigsetjmp, which arranges to pass in the stack pointer and the frame @@ -28,20 +30,39 @@ extern int __sigjmp_save (sigjmp_buf, int); int +#if _MIPS_SIM == _MIPS_SIM_ABI64 +__sigsetjmp_aux (jmp_buf env, int savemask, long sp, long fp) +#else /* O32 || N32 */ __sigsetjmp_aux (jmp_buf env, int savemask, int sp, int fp) +#endif /* O32 || N32 */ { #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__ /* Store the floating point callee-saved registers... */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); + asm volatile ("s.d $f25, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); + asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); + asm volatile ("s.d $f27, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); + asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); + asm volatile ("s.d $f29, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); + asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[6])); + asm volatile ("s.d $f31, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[7])); +#else /* O32 || N32 */ asm volatile ("s.d $f20, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[0])); asm volatile ("s.d $f22, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[1])); asm volatile ("s.d $f24, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[2])); asm volatile ("s.d $f26, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[3])); asm volatile ("s.d $f28, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[4])); asm volatile ("s.d $f30, %0" : : "m" (env[0].__jmpbuf[0].__fpregs[5])); +#endif /* O32 || N32 */ #endif /* .. and the PC; */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + asm volatile ("sd $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); +#else asm volatile ("sw $31, %0" : : "m" (env[0].__jmpbuf[0].__pc)); +#endif /* .. and the stack pointer; */ env[0].__jmpbuf[0].__sp = (void *) sp; @@ -50,9 +71,14 @@ env[0].__jmpbuf[0].__fp = (void *) fp; /* .. and the GP; */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 + asm volatile ("sd $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp)); +#else asm volatile ("sw $gp, %0" : : "m" (env[0].__jmpbuf[0].__gp)); +#endif /* .. and the callee-saved registers; */ +#if (_MIPS_SIM == _MIPS_SIM_ABI32) asm volatile ("sw $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); asm volatile ("sw $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); asm volatile ("sw $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); @@ -61,6 +87,16 @@ asm volatile ("sw $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); asm volatile ("sw $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); asm volatile ("sw $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); +#else /* N32 || N64 */ + asm volatile ("sd $16, %0" : : "m" (env[0].__jmpbuf[0].__regs[0])); + asm volatile ("sd $17, %0" : : "m" (env[0].__jmpbuf[0].__regs[1])); + asm volatile ("sd $18, %0" : : "m" (env[0].__jmpbuf[0].__regs[2])); + asm volatile ("sd $19, %0" : : "m" (env[0].__jmpbuf[0].__regs[3])); + asm volatile ("sd $20, %0" : : "m" (env[0].__jmpbuf[0].__regs[4])); + asm volatile ("sd $21, %0" : : "m" (env[0].__jmpbuf[0].__regs[5])); + asm volatile ("sd $22, %0" : : "m" (env[0].__jmpbuf[0].__regs[6])); + asm volatile ("sd $23, %0" : : "m" (env[0].__jmpbuf[0].__regs[7])); +#endif /* N32 || N64 */ #if defined __UCLIBC_HAS_FLOATS__ && ! defined __UCLIBC_HAS_SOFT_FLOAT__ /* .. and finally get and reconstruct the floating point csr. */ From andersen at uclibc.org Sat Nov 4 11:53:15 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:53:15 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips Message-ID: <20061104195315.94A40485CF@busybox.net> Author: andersen Date: 2006-11-04 11:53:15 -0800 (Sat, 04 Nov 2006) New Revision: 16503 Log: mips64 patch from Atsushi Nemoto: miscellaneous asm routines Modified: trunk/uClibc/libc/sysdeps/linux/mips/clone.S trunk/uClibc/libc/sysdeps/linux/mips/crt1.S trunk/uClibc/libc/sysdeps/linux/mips/crti.S trunk/uClibc/libc/sysdeps/linux/mips/crtn.S Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/clone.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/clone.S 2006-11-04 19:50:20 UTC (rev 16502) +++ trunk/uClibc/libc/sysdeps/linux/mips/clone.S 2006-11-04 19:53:15 UTC (rev 16503) @@ -38,11 +38,16 @@ clone: .frame sp, 4*SZREG, sp #ifdef __PIC__ +#if _MIPS_SIM == _MIPS_SIM_ABI32 .set noreorder .cpload $25 .set reorder subu sp,32 .cprestore 16 +#else /* N32 */ + PTR_SUBU sp,32 /* fn, arg, gp, pad */ + .cpsetup $25, 16, clone +#endif /* N32 */ #else subu sp,32 #endif @@ -53,9 +58,12 @@ beqz a0,error /* No NULL function pointers. */ beqz a1,error /* No NULL stack pointers. */ - subu a1,32 /* Reserve argument save space. */ - sw a0,0(a1) /* Save function pointer. */ - sw a3,4(a1) /* Save argument pointer. */ +#if _MIPS_SIM != _MIPS_SIM_ABI32 + and a1,~(16-1) /* force alignment */ +#endif + PTR_SUBU a1,32 /* Reserve argument save space. */ + PTR_S a0,0(a1) /* Save function pointer. */ + PTR_S a3,PTRSIZE(a1) /* Save argument pointer. */ /* Do the system call */ @@ -67,19 +75,25 @@ beqz v0,__thread_start /* Successful return from the parent */ - addiu sp,32 +#if _MIPS_SIM != _MIPS_SIM_ABI32 + .cpreturn +#endif + PTR_ADDU sp,32 j $31 ; nop /* Something bad happened -- no child created */ error: - addiu sp,32 +#if _MIPS_SIM != _MIPS_SIM_ABI32 + .cpreturn +#endif + PTR_ADDU sp,32 /* uClibc change -- start */ move a0,v0 /* Pass return val to C function. */ /* uClibc change -- stop */ #ifdef __PIC__ - la t9,__syscall_error + PTR_LA t9,__syscall_error jr t9 #else j __syscall_error @@ -95,12 +109,14 @@ .ent __thread_start, 0; __thread_start: +#if _MIPS_SIM == _MIPS_SIM_ABI32 /* cp is already loaded. */ .cprestore 16 +#endif /* The stackframe has been created on entry of clone(). */ /* Restore the arg for user's function. */ - lw t9,0(sp) /* Function pointer. */ - lw a0,4(sp) /* Argument pointer. */ + PTR_L t9,0(sp) /* Function pointer. */ + PTR_L a0,PTRSIZE(sp) /* Argument pointer. */ /* Call the user's function. */ jal t9 Modified: trunk/uClibc/libc/sysdeps/linux/mips/crt1.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/crt1.S 2006-11-04 19:50:20 UTC (rev 16502) +++ trunk/uClibc/libc/sysdeps/linux/mips/crt1.S 2006-11-04 19:53:15 UTC (rev 16503) @@ -37,6 +37,7 @@ #include +#include #include @@ -83,6 +84,7 @@ __start: #ifdef __PIC__ +#if _MIPS_SIM == _MIPS_SIM_ABI32 .set noreorder move $0, $31 /* Save old ra. */ bal 10f /* Find addr of cpload. */ @@ -92,18 +94,29 @@ move $31, $0 .set reorder #else + move $0, $31; /* Save old ra. */ + .set noreorder + bal 10f /* Find addr of .cpsetup. */ + nop +10: + .set reorder + .cpsetup $31, $25, 10b + move $31, $0 +#endif +#else la $28, _gp /* Setup GP correctly if we're non-PIC. */ move $31, $0 #endif - la $4, main /* main */ - lw $5, 0($29) /* argc */ - addiu $6, $29, 4 /* argv */ + PTR_LA $4, main /* main */ + PTR_L $5, 0($29) /* argc */ + PTR_ADDIU $6, $29, PTRSIZE /* argv */ /* Allocate space on the stack for seven arguments and * make sure the stack is aligned to double words (8 bytes) */ +#if _MIPS_SIM == _MIPS_SIM_ABI32 and $29, -2 * 4 subu $29, 32 la $7, _init /* init */ @@ -111,6 +124,13 @@ sw $8, 16($29) /* fini */ sw $2, 20($29) /* rtld_fini */ sw $29, 24($29) /* stack_end */ +#else + and $29, -2 * PTRSIZE + PTR_LA $7, _init /* init */ + PTR_LA $8, _fini /* fini */ + move $9, $2 /* rtld_fini */ + move $10, $29 /* stack_end */ +#endif jal __uClibc_main hlt: /* Crash if somehow `__uClibc_main' returns anyway. */ Modified: trunk/uClibc/libc/sysdeps/linux/mips/crti.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/crti.S 2006-11-04 19:50:20 UTC (rev 16502) +++ trunk/uClibc/libc/sysdeps/linux/mips/crti.S 2006-11-04 19:53:15 UTC (rev 16503) @@ -1,3 +1,5 @@ +#include "sgidefs.h" +#if _MIPS_SIM == _MIPS_SIM_ABI32 .file 1 "initfini.c" .section .mdebug.abi32 .previous @@ -48,3 +50,109 @@ .end _fini .ident "GCC: (GNU) 3.3.2" +#elif _MIPS_SIM == _MIPS_SIM_NABI32 + .file 1 "initfini.c" + .section .mdebug.abiN32 + .previous + .abicalls +#APP + + .section .init +#NO_APP + .align 2 + .align 3 + .globl _init + .ent _init + .type _init, @function +_init: + .frame $sp,16,$31 # vars= 0, regs= 2/0, args= 0, gp= 0 + .mask 0x90000000,-8 + .fmask 0x00000000,0 + addiu $sp,$sp,-16 + sd $28,0($sp) + lui $28,%hi(%neg(%gp_rel(_init))) + addu $28,$28,$25 + addiu $28,$28,%lo(%neg(%gp_rel(_init))) + sd $31,8($sp) +#APP + + .align 3 + .end _init + + .section .fini +#NO_APP + .align 2 + .align 3 + .globl _fini + .ent _fini + .type _fini, @function +_fini: + .frame $sp,16,$31 # vars= 0, regs= 2/0, args= 0, gp= 0 + .mask 0x90000000,-8 + .fmask 0x00000000,0 + addiu $sp,$sp,-16 + sd $28,0($sp) + lui $28,%hi(%neg(%gp_rel(_fini))) + addu $28,$28,$25 + addiu $28,$28,%lo(%neg(%gp_rel(_fini))) + sd $31,8($sp) +#APP + .align 3 + .end _fini + + .ident "GCC: (GNU) 3.4.3" +#else /* N64 */ + .file 1 "initfini.c" + .section .mdebug.abi64 + .previous + .abicalls +#APP + + + .section .init +#NO_APP + .align 2 + .globl _init + .ent _init + .type _init, @function +_init: + .frame $sp,32,$31 # vars= 0, regs= 2/0, args= 0, extra= 16 + .mask 0x90000000,-8 + .fmask 0x00000000,0 + dsubu $sp,$sp,32 + sd $31,24($sp) + sd $28,16($sp) + .set noat + lui $1,%hi(%neg(%gp_rel(_init))) + addiu $1,$1,%lo(%neg(%gp_rel(_init))) + daddu $gp,$1,$25 + .set at +#APP + + .align 2 + .end _init + + .section .fini +#NO_APP + .align 2 + .globl _fini + .ent _fini + .type _fini, @function +_fini: + .frame $sp,32,$31 # vars= 0, regs= 2/0, args= 0, extra= 16 + .mask 0x90000000,-8 + .fmask 0x00000000,0 + dsubu $sp,$sp,32 + sd $31,24($sp) + sd $28,16($sp) + .set noat + lui $1,%hi(%neg(%gp_rel(_fini))) + addiu $1,$1,%lo(%neg(%gp_rel(_fini))) + daddu $gp,$1,$25 + .set at +#APP + .align 2 + .end _fini + + .ident "GCC: (GNU) 3.3.2" +#endif /* N64 */ Modified: trunk/uClibc/libc/sysdeps/linux/mips/crtn.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/crtn.S 2006-11-04 19:50:20 UTC (rev 16502) +++ trunk/uClibc/libc/sysdeps/linux/mips/crtn.S 2006-11-04 19:53:15 UTC (rev 16503) @@ -1,3 +1,5 @@ +#include "sgidefs.h" +#if _MIPS_SIM == _MIPS_SIM_ABI32 .file 1 "initfini.c" .section .mdebug.abi32 .previous @@ -43,3 +45,101 @@ #APP .ident "GCC: (GNU) 3.3.2" +#elif _MIPS_SIM == _MIPS_SIM_NABI32 + .file 1 "initfini.c" + .section .mdebug.abiN32 + .previous + .abicalls +#APP + + .section .init +#NO_APP + .align 2 + .align 3 + .globl _init + .ent _init + .type _init, @function +#NO_APP + ld $31,8($sp) + ld $28,0($sp) + .set noreorder + .set nomacro + j $31 + addiu $sp,$sp,16 + .set macro + .set reorder + + .end _init +#APP + + .section .fini +#NO_APP + .align 2 + .align 3 + .globl _fini + .ent _fini + .type _fini, @function +#NO_APP + ld $31,8($sp) + ld $28,0($sp) + .set noreorder + .set nomacro + j $31 + addiu $sp,$sp,16 + .set macro + .set reorder + + .end _fini +#APP + + .ident "GCC: (GNU) 3.4.3" +#else /* N64 */ + .file 1 "initfini.c" + .section .mdebug.abi64 + .previous + .abicalls +#APP + + + .section .init +#NO_APP + .align 2 + .globl _init + .ent _init + .type _init, @function +#NO_APP + ld $31,24($sp) + ld $28,16($sp) + #nop + .set noreorder + .set nomacro + j $31 + daddu $sp,$sp,32 + .set macro + .set reorder + + .end _init +#APP + + .section .fini +#NO_APP + .align 2 + .globl _fini + .ent _fini + .type _fini, @function +#NO_APP + ld $31,24($sp) + ld $28,16($sp) + #nop + .set noreorder + .set nomacro + j $31 + daddu $sp,$sp,32 + .set macro + .set reorder + + .end _fini +#APP + + .ident "GCC: (GNU) 3.3.2" +#endif /* N64 */ From andersen at uclibc.org Sat Nov 4 11:54:32 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:54:32 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips/bits Message-ID: <20061104195432.6C41B485D4@busybox.net> Author: andersen Date: 2006-11-04 11:54:32 -0800 (Sat, 04 Nov 2006) New Revision: 16504 Log: mips64 patch from Atsushi Nemoto: Adjust for mips64 kernel. Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h trunk/uClibc/libc/sysdeps/linux/mips/bits/stat.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h 2006-11-04 19:53:15 UTC (rev 16503) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/fcntl.h 2006-11-04 19:54:32 UTC (rev 16504) @@ -62,7 +62,11 @@ #endif #ifdef __USE_LARGEFILE64 -# define O_LARGEFILE 0x2000 /* Allow large file opens. */ +# if __WORDSIZE == 64 +# define O_LARGEFILE 0 +# else +# define O_LARGEFILE 0x2000 /* Allow large file opens. */ +# endif #endif /* Values for the second argument to `fcntl'. */ @@ -81,9 +85,15 @@ # define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */ #endif -#define F_GETLK64 33 /* Get record locking info. */ -#define F_SETLK64 34 /* Set record locking info (non-blocking). */ -#define F_SETLKW64 35 /* Set record locking info (blocking). */ +#if __WORDSIZE == 64 +# define F_GETLK64 14 /* Get record locking info. */ +# define F_SETLK64 6 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 7 /* Set record locking info (blocking). */ +#else +# define F_GETLK64 33 /* Get record locking info. */ +# define F_SETLK64 34 /* Set record locking info (non-blocking). */ +# define F_SETLKW64 35 /* Set record locking info (blocking). */ +#endif #if defined __USE_BSD || defined __USE_UNIX98 # define F_SETOWN 24 /* Get owner of socket (receiver of SIGIO). */ Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h 2006-11-04 19:53:15 UTC (rev 16503) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h 2006-11-04 19:54:32 UTC (rev 16504) @@ -5,11 +5,59 @@ * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ -#if __WORDSIZE == 64 -#define kernel_stat kernel_stat64 -#else +#include + +#if _MIPS_SIM == _MIPS_SIM_ABI64 +/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */ struct kernel_stat { __kernel_dev_t st_dev; + unsigned int st_pad1[3]; + __kernel_ino_t st_ino; + __kernel_mode_t st_mode; + __kernel_nlink_t st_nlink; + __kernel_uid_t st_uid; + __kernel_gid_t st_gid; + __kernel_dev_t st_rdev; + unsigned int st_pad2[3]; + __kernel_off_t st_size; + unsigned int st_atime; + unsigned int reserved0; + unsigned int st_mtime; + unsigned int reserved1; + unsigned int st_ctime; + unsigned int reserved2; + unsigned int st_blksize; + unsigned int reserved3; + unsigned long st_blocks; +}; +#define kernel_stat64 kernel_stat +#elif _MIPS_SIM == _MIPS_SIM_NABI32 +/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */ +struct kernel_stat { + unsigned int st_dev; + unsigned int st_pad1[3]; + unsigned long long st_ino; + __kernel_mode_t st_mode; + __kernel_nlink_t st_nlink; + __kernel_uid_t st_uid; + __kernel_gid_t st_gid; + unsigned int st_rdev; + unsigned int st_pad2[3]; + unsigned long long st_size; + unsigned int st_atime; + unsigned int reserved0; + unsigned int st_mtime; + unsigned int reserved1; + unsigned int st_ctime; + unsigned int reserved2; + unsigned int st_blksize; + unsigned int reserved3; + unsigned long long st_blocks; +}; +#define kernel_stat64 kernel_stat +#else /* O32 */ +struct kernel_stat { + __kernel_dev_t st_dev; long st_pad1[3]; __kernel_ino_t st_ino; __kernel_mode_t st_mode; @@ -30,7 +78,6 @@ long st_blocks; long st_pad4[14]; }; -#endif struct kernel_stat64 { unsigned long st_dev; @@ -53,6 +100,7 @@ unsigned long st_pad2; long long st_blocks; }; +#endif /* O32 */ #endif /* _BITS_STAT_STRUCT_H */ Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h 2006-11-04 19:53:15 UTC (rev 16503) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/siginfo.h 2006-11-04 19:54:32 UTC (rev 16504) @@ -265,7 +265,8 @@ /* Structure to transport application-defined values with signals. */ # define __SIGEV_MAX_SIZE 64 -# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) +# define __SIGEV_HEAD_SIZE (sizeof(long) + 2*sizeof(int)) +# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE - __SIGEV_HEAD_SIZE) / sizeof (int)) /* Forward declaration of the `pthread_attr_t' type. */ struct __pthread_attr_s; Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/stat.h 2006-11-04 19:53:15 UTC (rev 16503) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/stat.h 2006-11-04 19:54:32 UTC (rev 16504) @@ -20,6 +20,8 @@ # error "Never include directly; use instead." #endif +#include + /* Versions of the `struct stat' data structure. */ #define _STAT_VER_LINUX_OLD 1 #define _STAT_VER_KERNEL 1 @@ -33,6 +35,7 @@ #define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */ +#if _MIPS_SIM == _MIPS_SIM_ABI32 /* Structure describing file characteristics. */ struct stat { @@ -76,8 +79,38 @@ #endif long int st_pad5[14]; }; +#else /* N32 || N64 */ +/* The memory layout is the same as of struct stat64 of the 32-bit kernel. */ +struct stat { + unsigned int st_dev; + int st_pad1[3]; + __ino_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned int st_rdev; /* Device number, if device. */ + int st_pad2[3]; + __off_t st_size; /* Size of file, in bytes. */ + /* + * Actually this should be timestruc_t st_atime, st_mtime and + * st_ctime but we don't have it under Linux. + */ + int st_atime; + int reserved0; /* Reserved for st_atime expansion */ + int st_mtime; + int reserved1; /* Reserved for st_mtime expansion */ + int st_ctime; + int reserved2; /* Reserved for st_ctime expansion */ + int st_blksize; /* Optimal block size for I/O. */ + int st_pad3; + __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ + int st_pad4[14]; +}; +#endif /* N32 || N64 */ #ifdef __USE_LARGEFILE64 +#if _MIPS_SIM == _MIPS_SIM_ABI32 struct stat64 { __dev_t st_dev; @@ -105,6 +138,35 @@ __blkcnt64_t st_blocks; /* Number of 512-byte blocks allocated. */ long int st_pad4[14]; }; +#else /* N32 || N64 */ +/* stat64 of N32/N64 is just an alias of stat syscall. */ +struct stat64 { + unsigned int st_dev; + int st_pad1[3]; + __ino_t st_ino; /* File serial number. */ + __mode_t st_mode; /* File mode. */ + __nlink_t st_nlink; /* Link count. */ + __uid_t st_uid; /* User ID of the file's owner. */ + __gid_t st_gid; /* Group ID of the file's group.*/ + unsigned int st_rdev; /* Device number, if device. */ + int st_pad2[3]; + __off_t st_size; /* Size of file, in bytes. */ + /* + * Actually this should be timestruc_t st_atime, st_mtime and + * st_ctime but we don't have it under Linux. + */ + int st_atime; + int reserved0; /* Reserved for st_atime expansion */ + int st_mtime; + int reserved1; /* Reserved for st_mtime expansion */ + int st_ctime; + int reserved2; /* Reserved for st_ctime expansion */ + int st_blksize; /* Optimal block size for I/O. */ + int st_pad3; + __blkcnt_t st_blocks; /* Number of 512-byte blocks allocated. */ + int st_pad4[14]; +}; +#endif /* N32 || N64 */ #endif /* Tell code we have these members. */ From andersen at uclibc.org Sat Nov 4 11:55:30 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 11:55:30 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips Message-ID: <20061104195530.C2E3B485D7@busybox.net> Author: andersen Date: 2006-11-04 11:55:30 -0800 (Sat, 04 Nov 2006) New Revision: 16505 Log: mips64 patch from Atsushi Nemoto: No pread64, pwrite64 syscall for N64 ABI. Make __libc_pread and __libc_pread64 use same syscall. Modified: trunk/uClibc/libc/sysdeps/linux/mips/pread_write.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/pread_write.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/pread_write.c 2006-11-04 19:54:32 UTC (rev 16504) +++ trunk/uClibc/libc/sysdeps/linux/mips/pread_write.c 2006-11-04 19:55:30 UTC (rev 16505) @@ -15,6 +15,7 @@ #include "../common/syscalls.h" #include #include +#include #ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ # ifdef __NR_pread @@ -26,9 +27,14 @@ #ifdef __NR_pread extern __typeof(pread) __libc_pread; -# ifdef __mips64 -_syscall4(ssize_t, pread, int, fd, void *, buf, size_t, count, off_t, offset); -# else /* !__mips64 */ +# if _MIPS_SIM == _MIPS_SIM_ABI64 +# define __NR___libc_pread __NR_pread +_syscall4(ssize_t, __libc_pread, int, fd, void *, buf, size_t, count, off_t, offset); +weak_alias (__libc_pread, pread) +# define __NR___libc_pread64 __NR_pread +_syscall4(ssize_t, __libc_pread64, int, fd, void *, buf, size_t, count, off64_t, offset); +weak_alias (__libc_pread64, pread64) +# else /* O32 || N32 */ # define __NR___syscall_pread __NR_pread static inline _syscall6(ssize_t, __syscall_pread, int, fd, void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); @@ -49,7 +55,7 @@ } weak_alias(__libc_pread64,pread64) # endif /* __UCLIBC_HAS_LFS__ */ -# endif /* !__mips64 */ +# endif /* O32 || N32 */ #endif /* __NR_pread */ @@ -65,9 +71,14 @@ #ifdef __NR_pwrite extern __typeof(pwrite) __libc_pwrite; -# ifdef __mips64 -_syscall4(ssize_t, pwrite, int, fd, const void *, buf, size_t, count, off_t, offset); -# else /* !__mips64 */ +# if _MIPS_SIM == _MIPS_SIM_ABI64 +# define __NR___libc_pwrite __NR_pwrite +_syscall4(ssize_t, __libc_pwrite, int, fd, const void *, buf, size_t, count, off_t, offset); +weak_alias (__libc_pwrite, pwrite) +# define __NR___libc_pwrite64 __NR_pwrite +_syscall4(ssize_t, __libc_pwrite64, int, fd, const void *, buf, size_t, count, off64_t, offset); +weak_alias (__libc_pwrite64, pwrite64) +# else /* O32 || N32 */ # define __NR___syscall_pwrite __NR_pwrite static inline _syscall6(ssize_t, __syscall_pwrite, int, fd, const void *, buf, size_t, count, int, dummy, off_t, offset_hi, off_t, offset_lo); @@ -88,5 +99,5 @@ } weak_alias(__libc_pwrite64,pwrite64) # endif /* __UCLIBC_HAS_LFS__ */ -# endif /* !__mips64 */ +# endif /* O32 || N32 */ #endif /* __NR_pwrite */ From andersen at uclibc.org Sat Nov 4 12:14:11 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 12:14:11 -0800 (PST) Subject: svn commit: trunk/uClibc/ldso/ldso/mips Message-ID: <20061104201411.6E495485DC@busybox.net> Author: andersen Date: 2006-11-04 12:14:10 -0800 (Sat, 04 Nov 2006) New Revision: 16506 Log: mips64 patch from Atsushi Nemoto: 64bit MIPS ELF format tweaks. (from glibc) Elf32/ElfW convertions. asm code adjustments. Modified: trunk/uClibc/ldso/ldso/mips/dl-startup.h trunk/uClibc/ldso/ldso/mips/dl-sysdep.h trunk/uClibc/ldso/ldso/mips/elfinterp.c trunk/uClibc/ldso/ldso/mips/resolve.S Changeset: Modified: trunk/uClibc/ldso/ldso/mips/dl-startup.h =================================================================== --- trunk/uClibc/ldso/ldso/mips/dl-startup.h 2006-11-04 19:55:30 UTC (rev 16505) +++ trunk/uClibc/ldso/ldso/mips/dl-startup.h 2006-11-04 20:14:10 UTC (rev 16506) @@ -6,6 +6,7 @@ */ +#include asm("" " .text\n" " .globl _start\n" @@ -17,23 +18,66 @@ " bal 0f\n" " nop\n" "0:\n" +#if _MIPS_SIM == _MIPS_SIM_ABI32 " .cpload $31\n" +#else /* N32 || N64 */ + " .cpsetup $31, $2, 0b\n" +#endif /* N32 || N64 */ " move $31, $25\n" " .set reorder\n" +#if _MIPS_SIM == _MIPS_SIM_ABI64 + " dla $4, _DYNAMIC\n" + " sd $4, -0x7ff0($28)\n" +#else /* O32 || N32 */ " la $4, _DYNAMIC\n" " sw $4, -0x7ff0($28)\n" +#endif /* O32 || N32 */ " move $4, $29\n" +#if _MIPS_SIM == _MIPS_SIM_ABI32 " subu $29, 16\n" +#endif +#if _MIPS_SIM == _MIPS_SIM_ABI64 + " dla $8, .coff\n" +#else /* O32 || N32 */ " la $8, .coff\n" +#endif /* O32 || N32 */ " bltzal $8, .coff\n" ".coff:\n" +#if _MIPS_SIM == _MIPS_SIM_ABI64 + " dsubu $8, $31, $8\n" + " dla $25, _dl_start\n" + " daddu $25, $8\n" +#else /* O32 || N32 */ " subu $8, $31, $8\n" " la $25, _dl_start\n" " addu $25, $8\n" +#endif /* O32 || N32 */ " jalr $25\n" +#if _MIPS_SIM == _MIPS_SIM_ABI32 " addiu $29, 16\n" +#endif " move $16, $28\n" " move $17, $2\n" +#if _MIPS_SIM == _MIPS_SIM_ABI64 + " ld $2, _dl_skip_args\n" + " beq $2, $0, 1f\n" + " ld $4, 0($29)\n" + " dsubu $4, $2\n" + " dsll $2, 2\n" + " daddu $29, $2\n" + " sd $4, 0($29)\n" + "1:\n" + " ld $5, 0($29)\n" + " dla $6, 8 ($29)\n" + " dsll $7, $5, 2\n" + " daddu $7, $7, $6\n" + " daddu $7, $7, 4\n" + " and $2, $29, -4 * 4\n" + " sd $29, -8($2)\n" + " dsubu $29, $2, 32\n" + " ld $29, 24($29)\n" + " dla $2, _dl_fini\n" +#else /* O32 || N32 */ " lw $2, _dl_skip_args\n" " beq $2, $0, 1f\n" " lw $4, 0($29)\n" @@ -50,9 +94,12 @@ " and $2, $29, -2 * 4\n" " sw $29, -4($2)\n" " subu $29, $2, 32\n" +#if _MIPS_SIM == _MIPS_SIM_ABI32 " .cprestore 16\n" +#endif " lw $29, 28($29)\n" " la $2, _dl_fini\n" +#endif /* O32 || N32 */ " move $25, $17\n" " jr $25\n" ".end _start\n" @@ -80,10 +127,10 @@ */ #define PERFORM_BOOTSTRAP_GOT(tpnt) \ do { \ - Elf32_Sym *sym; \ - Elf32_Addr i; \ + ElfW(Sym) *sym; \ + ElfW(Addr) i; \ register ElfW(Addr) gp __asm__ ("$28"); \ - Elf32_Addr *mipsgot = elf_mips_got_from_gpreg (gp); \ + ElfW(Addr) *mipsgot = elf_mips_got_from_gpreg (gp); \ \ /* Add load address displacement to all local GOT entries */ \ i = 2; \ @@ -92,18 +139,18 @@ \ /* Handle global GOT entries */ \ mipsgot += tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]; \ - sym = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB] + \ - tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; \ + sym = (ElfW(Sym) *) tpnt->dynamic_info[DT_SYMTAB] + \ + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; \ i = tpnt->dynamic_info[DT_MIPS_SYMTABNO_IDX] - tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX];\ \ while (i--) { \ if (sym->st_shndx == SHN_UNDEF || \ sym->st_shndx == SHN_COMMON) \ *mipsgot = tpnt->loadaddr + sym->st_value; \ - else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && \ + else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC && \ *mipsgot != sym->st_value) \ *mipsgot += tpnt->loadaddr; \ - else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) { \ + else if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) { \ if (sym->st_other == 0) \ *mipsgot += tpnt->loadaddr; \ } \ @@ -119,9 +166,14 @@ * Here is a macro to perform a relocation. This is only used when * bootstrapping the dynamic loader. */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 /* consult with glibc sysdeps/mips/dl-machine.h 1.69 */ +#define R_MIPS_BOOTSTRAP_RELOC ((R_MIPS_64 << 8) | R_MIPS_REL32) +#else /* N32 || O32 */ +#define R_MIPS_BOOTSTRAP_RELOC R_MIPS_REL32 +#endif #define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \ - switch(ELF32_R_TYPE((RELP)->r_info)) { \ - case R_MIPS_REL32: \ + switch(ELF_R_TYPE((RELP)->r_info)) { \ + case R_MIPS_BOOTSTRAP_RELOC: \ if (SYMTAB) { \ if (symtab_indexdynamic_info[DT_MIPS_GOTSYM_IDX])\ *REL += SYMBOL; \ Modified: trunk/uClibc/ldso/ldso/mips/dl-sysdep.h =================================================================== --- trunk/uClibc/ldso/ldso/mips/dl-sysdep.h 2006-11-04 19:55:30 UTC (rev 16505) +++ trunk/uClibc/ldso/ldso/mips/dl-sysdep.h 2006-11-04 20:14:10 UTC (rev 16506) @@ -8,6 +8,89 @@ /* Define this if the system uses RELOCA. */ #undef ELF_USES_RELOCA #include + +#ifdef __mips64 /* from glibc sysdeps/mips/elf/ldsodefs.h 1.4 */ +/* The 64-bit MIPS ELF ABI uses an unusual reloc format. Each + relocation entry specifies up to three actual relocations, all at + the same address. The first relocation which required a symbol + uses the symbol in the r_sym field. The second relocation which + requires a symbol uses the symbol in the r_ssym field. If all + three relocations require a symbol, the third one uses a zero + value. + + We define these structures in internal headers because we're not + sure we want to make them part of the ABI yet. Eventually, some of + this may move into elf/elf.h. */ + +/* An entry in a 64 bit SHT_REL section. */ + +typedef struct +{ + Elf32_Word r_sym; /* Symbol index */ + unsigned char r_ssym; /* Special symbol for 2nd relocation */ + unsigned char r_type3; /* 3rd relocation type */ + unsigned char r_type2; /* 2nd relocation type */ + unsigned char r_type1; /* 1st relocation type */ +} _Elf64_Mips_R_Info; + +typedef union +{ + Elf64_Xword r_info_number; + _Elf64_Mips_R_Info r_info_fields; +} _Elf64_Mips_R_Info_union; + +typedef struct +{ + Elf64_Addr r_offset; /* Address */ + _Elf64_Mips_R_Info_union r_info; /* Relocation type and symbol index */ +} Elf64_Mips_Rel; + +typedef struct +{ + Elf64_Addr r_offset; /* Address */ + _Elf64_Mips_R_Info_union r_info; /* Relocation type and symbol index */ + Elf64_Sxword r_addend; /* Addend */ +} Elf64_Mips_Rela; + +#define ELF64_MIPS_R_SYM(i) \ + ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) +#define ELF64_MIPS_R_TYPE(i) \ + (((_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1 \ + | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ + ).r_info_fields.r_type2 << 8) \ + | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ + ).r_info_fields.r_type3 << 16) \ + | ((Elf32_Word)(__extension__ (_Elf64_Mips_R_Info_union)(i) \ + ).r_info_fields.r_ssym << 24)) +#define ELF64_MIPS_R_INFO(sym, type) \ + (__extension__ (_Elf64_Mips_R_Info_union) \ + (__extension__ (_Elf64_Mips_R_Info) \ + { (sym), ELF64_MIPS_R_SSYM (type), \ + ELF64_MIPS_R_TYPE3 (type), \ + ELF64_MIPS_R_TYPE2 (type), \ + ELF64_MIPS_R_TYPE1 (type) \ + }).r_info_number) +/* These macros decompose the value returned by ELF64_MIPS_R_TYPE, and + compose it back into a value that it can be used as an argument to + ELF64_MIPS_R_INFO. */ +#define ELF64_MIPS_R_SSYM(i) (((i) >> 24) & 0xff) +#define ELF64_MIPS_R_TYPE3(i) (((i) >> 16) & 0xff) +#define ELF64_MIPS_R_TYPE2(i) (((i) >> 8) & 0xff) +#define ELF64_MIPS_R_TYPE1(i) ((i) & 0xff) +#define ELF64_MIPS_R_TYPEENC(type1, type2, type3, ssym) \ + ((type1) \ + | ((Elf32_Word)(type2) << 8) \ + | ((Elf32_Word)(type3) << 16) \ + | ((Elf32_Word)(ssym) << 24)) + +#undef ELF64_R_SYM +#define ELF64_R_SYM(i) ELF64_MIPS_R_SYM (i) +#undef ELF64_R_TYPE +#define ELF64_R_TYPE(i) ELF64_MIPS_R_TYPE (i) +#undef ELF64_R_INFO +#define ELF64_R_INFO(sym, type) ELF64_MIPS_R_INFO ((sym), (type)) +#endif /* __mips64 */ + #include #define ARCH_NUM 3 @@ -24,7 +107,7 @@ else if (dpnt->d_tag == DT_MIPS_SYMTABNO) \ dynamic[DT_MIPS_SYMTABNO_IDX] = dpnt->d_un.d_val; \ else if (dpnt->d_tag == DT_MIPS_RLD_MAP) \ - *(Elf32_Addr *)(dpnt->d_un.d_ptr) = (Elf32_Addr) debug_addr; \ + *(ElfW(Addr) *)(dpnt->d_un.d_ptr) = (ElfW(Addr)) debug_addr; \ } while (0) /* Initialization sequence for the application/library GOT. */ @@ -64,9 +147,15 @@ void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy); /* 4096 bytes alignment */ +#if _MIPS_SIM == _MIPS_SIM_ABI64 +#define PAGE_ALIGN (~0xfffUL) +#define ADDR_ALIGN 0xfffUL +#define OFFS_ALIGN (0x10000000000UL-0x1000) +#else /* O32 || N32 */ #define PAGE_ALIGN 0xfffff000 #define ADDR_ALIGN 0xfff #define OFFS_ALIGN 0x7ffff000 +#endif /* O32 || N32 */ #define elf_machine_type_class(type) ELF_RTYPE_CLASS_PLT /* MIPS does not have COPY relocs */ @@ -94,8 +183,13 @@ #define STRINGXP(X) __STRING(X) #define STRINGXV(X) STRINGV_(X) #define STRINGV_(...) # __VA_ARGS__ +#if _MIPS_SIM == _MIPS_SIM_ABI64 +#define PTR_LA dla +#define PTR_SUBU dsubu +#else #define PTR_LA la #define PTR_SUBU subu +#endif /* Return the run-time load address of the shared object. */ static inline ElfW(Addr) @@ -115,8 +209,8 @@ } static inline void -elf_machine_relative (Elf32_Addr load_off, const Elf32_Addr rel_addr, - Elf32_Word relative_count) +elf_machine_relative (ElfW(Addr) load_off, const ElfW(Addr) rel_addr, + ElfW(Word) relative_count) { - /* No REALTIVE relocs in MIPS? */ + /* No RELATIVE relocs in MIPS? */ } Modified: trunk/uClibc/ldso/ldso/mips/elfinterp.c =================================================================== --- trunk/uClibc/ldso/ldso/mips/elfinterp.c 2006-11-04 19:55:30 UTC (rev 16505) +++ trunk/uClibc/ldso/ldso/mips/elfinterp.c 2006-11-04 20:14:10 UTC (rev 16506) @@ -38,7 +38,7 @@ { unsigned long *got = (unsigned long *) (old_gpreg - OFFSET_GP_GOT); struct elf_resolve *tpnt = (struct elf_resolve *) got[1]; - Elf32_Sym *sym; + ElfW(Sym) *sym; char *strtab; unsigned long local_gotno; unsigned long gotsym; @@ -50,7 +50,7 @@ gotsym = tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; local_gotno = tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]; - sym = ((Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB]) + sym_index; + sym = ((ElfW(Sym) *) tpnt->dynamic_info[DT_SYMTAB]) + sym_index; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; symname = strtab + sym->st_name; @@ -93,8 +93,8 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt, unsigned long rel_addr, unsigned long rel_size) { - Elf32_Sym *symtab; - Elf32_Rel *rpnt; + ElfW(Sym) *symtab; + ElfW(Rel) *rpnt; char *strtab; unsigned long i; unsigned long *got; @@ -107,18 +107,18 @@ #endif /* Now parse the relocation information */ - rel_size = rel_size / sizeof(Elf32_Rel); - rpnt = (Elf32_Rel *) rel_addr; + rel_size = rel_size / sizeof(ElfW(Rel)); + rpnt = (ElfW(Rel) *) rel_addr; - symtab = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB]; + symtab = (ElfW(Sym) *) tpnt->dynamic_info[DT_SYMTAB]; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; got = (unsigned long *) tpnt->dynamic_info[DT_PLTGOT]; for (i = 0; i < rel_size; i++, rpnt++) { reloc_addr = (unsigned long *) (tpnt->loadaddr + (unsigned long) rpnt->r_offset); - reloc_type = ELF32_R_TYPE(rpnt->r_info); - symtab_index = ELF32_R_SYM(rpnt->r_info); + reloc_type = ELF_R_TYPE(rpnt->r_info); + symtab_index = ELF_R_SYM(rpnt->r_info); symbol_addr = 0; debug_sym(symtab,strtab,symtab_index); @@ -129,7 +129,11 @@ #endif switch (reloc_type) { +#if _MIPS_SIM == _MIPS_SIM_ABI64 + case (R_MIPS_64 << 8) | R_MIPS_REL32: +#else /* O32 || N32 */ case R_MIPS_REL32: +#endif /* O32 || N32 */ if (symtab_index) { if (symtab_index < tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]) *reloc_addr += @@ -174,7 +178,7 @@ /* Relocate the global GOT entries for the object */ void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy) { - Elf32_Sym *sym; + ElfW(Sym) *sym; char *strtab; unsigned long i, tmp_lazy; unsigned long *got_entry; @@ -188,7 +192,7 @@ /* Setup the loop variables */ got_entry = (unsigned long *) (tpnt->dynamic_info[DT_PLTGOT]) + tpnt->dynamic_info[DT_MIPS_LOCAL_GOTNO_IDX]; - sym = (Elf32_Sym *) tpnt->dynamic_info[DT_SYMTAB] + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; + sym = (ElfW(Sym) *) tpnt->dynamic_info[DT_SYMTAB] + tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; strtab = (char *) tpnt->dynamic_info[DT_STRTAB]; i = tpnt->dynamic_info[DT_MIPS_SYMTABNO_IDX] - tpnt->dynamic_info[DT_MIPS_GOTSYM_IDX]; @@ -200,7 +204,7 @@ /* Relocate the global GOT entries for the object */ while (i--) { if (sym->st_shndx == SHN_UNDEF) { - if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && sym->st_value && tmp_lazy) { + if (ELF_ST_TYPE(sym->st_info) == STT_FUNC && sym->st_value && tmp_lazy) { *got_entry = sym->st_value + (unsigned long) tpnt->loadaddr; } else { @@ -212,11 +216,11 @@ *got_entry = (unsigned long) _dl_find_hash(strtab + sym->st_name, tpnt->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT); } - else if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && + else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC && *got_entry != sym->st_value && tmp_lazy) { *got_entry += (unsigned long) tpnt->loadaddr; } - else if (ELF32_ST_TYPE(sym->st_info) == STT_SECTION) { + else if (ELF_ST_TYPE(sym->st_info) == STT_SECTION) { if (sym->st_other == 0) *got_entry += (unsigned long) tpnt->loadaddr; } Modified: trunk/uClibc/ldso/ldso/mips/resolve.S =================================================================== --- trunk/uClibc/ldso/ldso/mips/resolve.S 2006-11-04 19:55:30 UTC (rev 16505) +++ trunk/uClibc/ldso/ldso/mips/resolve.S 2006-11-04 20:14:10 UTC (rev 16506) @@ -12,12 +12,14 @@ * */ +#include .text .align 2 .globl _dl_runtime_resolve .type _dl_runtime_resolve, at function .ent _dl_runtime_resolve _dl_runtime_resolve: +#if _MIPS_SIM == _MIPS_SIM_ABI32 .frame $29, 40, $31 .set noreorder @@ -60,6 +62,51 @@ # Do a tail call to the original function addiu $29, 40 +#else /* N32 || N64 */ + .set noreorder + + # Save GP. + move $3, $28 + + # Save arguments and sp value on stack. + dsubu $29, 80 + + # Compute GP. + .set noreorder + .cpsetup $25, 0, _dl_runtime_resolve + .set reorder + + # Store function arguments from registers to stack + sd $15, 72($29) + sd $4, 8($29) + sd $5, 16($29) + sd $6, 24($29) + sd $7, 32($29) + sd $8, 40($29) + sd $9, 48($29) + sd $10, 56($29) + sd $11, 64($29) + + # Setup functions args and call __dl_runtime_resolve + move $4, $24 + move $5, $3 + jal __dl_runtime_resolve + + # Restore function arguments from stack to registers + ld $31, 72($29) + ld $4, 8($29) + ld $5, 16($29) + ld $6, 24($29) + ld $7, 32($29) + ld $8, 40($29) + ld $9, 48($29) + ld $10, 56($29) + ld $11, 64($29) + + # Do a tail call to the original function + .cpreturn + daddu $29, 80 +#endif /* N32 || N64 */ move $25, $2 jr $25 .end _dl_runtime_resolve From andersen at uclibc.org Sat Nov 4 12:17:03 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Sat, 4 Nov 2006 12:17:03 -0800 (PST) Subject: svn commit: trunk/uClibc: extra/Configs test Message-ID: <20061104201703.8F221485C5@busybox.net> Author: andersen Date: 2006-11-04 12:17:03 -0800 (Sat, 04 Nov 2006) New Revision: 16507 Log: mips64 patch from Atsushi Nemoto: Add selection of 3 ABI. CPU_CFLAGS is needed to generate correct sysnum.h. Fix test/Rules.mak. Modified: trunk/uClibc/Makefile.in trunk/uClibc/Rules.mak trunk/uClibc/extra/Configs/Config.mips trunk/uClibc/test/Rules.mak Changeset: Modified: trunk/uClibc/Makefile.in =================================================================== --- trunk/uClibc/Makefile.in 2006-11-04 20:14:10 UTC (rev 16506) +++ trunk/uClibc/Makefile.in 2006-11-04 20:17:03 UTC (rev 16507) @@ -94,7 +94,7 @@ cd $(top_builddir); \ tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null`; \ [ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \ - top_builddir=. CC="$(CC)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \ + top_builddir=. CC="$(CC) $(CPU_CFLAGS)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \ if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \ $(RM) $$tmp; \ else \ Modified: trunk/uClibc/Rules.mak =================================================================== --- trunk/uClibc/Rules.mak 2006-11-04 20:14:10 UTC (rev 16506) +++ trunk/uClibc/Rules.mak 2006-11-04 20:17:03 UTC (rev 16507) @@ -207,6 +207,17 @@ CPU_CFLAGS-$(CONFIG_MIPS_ISA_4)+=-mips4 -mtune=mips4 CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS32)+=-mips32 -mtune=mips32 CPU_CFLAGS-$(CONFIG_MIPS_ISA_MIPS64)+=-mips64 -mtune=mips32 + ifeq ($(strip $(ARCH_BIG_ENDIAN)),y) + CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-melf64btsmip + CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-melf32btsmip + endif + ifeq ($(strip $(ARCH_LITTLE_ENDIAN)),y) + CPU_LDFLAGS-$(CONFIG_MIPS_N64_ABI)+=-melf64ltsmip + CPU_LDFLAGS-$(CONFIG_MIPS_O32_ABI)+=-melf32ltsmip + endif + CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64 + CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32 + CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32 endif ifeq ($(TARGET_ARCH),nios) Modified: trunk/uClibc/extra/Configs/Config.mips =================================================================== --- trunk/uClibc/extra/Configs/Config.mips 2006-11-04 20:14:10 UTC (rev 16506) +++ trunk/uClibc/extra/Configs/Config.mips 2006-11-04 20:17:03 UTC (rev 16507) @@ -54,3 +54,21 @@ bool "MIPS64" endchoice + +choice + prompt "Target ABI" + default CONFIG_MIPS_O32_ABI + help + This is the ABI you wish to build use. Choose either O32, N32 + or N64. + +config CONFIG_MIPS_O32_ABI + bool "O32 ABI" + +config CONFIG_MIPS_N64_ABI + bool "N64 ABI" + +config CONFIG_MIPS_N32_ABI + bool "N32 ABI" + +endchoice Modified: trunk/uClibc/test/Rules.mak =================================================================== --- trunk/uClibc/test/Rules.mak 2006-11-04 20:14:10 UTC (rev 16506) +++ trunk/uClibc/test/Rules.mak 2006-11-04 20:17:03 UTC (rev 16507) @@ -30,8 +30,7 @@ -e 's/ppc/powerpc/g' \ -e 's/v850.*/v850/g' \ -e 's/sh[234]/sh/' \ - -e 's/mips-.*/mips/' \ - -e 's/mipsel-.*/mipsel/' \ + -e 's/mips.*/mips/' \ -e 's/cris.*/cris/' \ ) endif From bugs at busybox.net Sat Nov 4 15:58:30 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Sat, 4 Nov 2006 15:58:30 -0800 Subject: [buildroot 0001073]: Buildroot compilation failure Message-ID: A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=1073 ====================================================================== Reported By: benakiva Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1073 Category: Other Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 10-14-2006 07:53 PDT Last Modified: 11-04-2006 15:58 PST ====================================================================== Summary: Buildroot compilation failure Description: Buildroot compilation fails because of missing file busybox/Rules.mak can't be found in busybox snapshots. However, this file exists into busybox-1.2.1 release version. ====================================================================== ---------------------------------------------------------------------- benakiva - 10-14-06 08:10 ---------------------------------------------------------------------- This problem occured to me when compiling buildroot for powerpc architecture. Even, when I copy Rules.mak from busybox-1.2.1 into the busybox-snapshot I'm using it does not solve the problem. ---------------------------------------------------------------------- benoitcosials - 11-04-06 15:58 ---------------------------------------------------------------------- Hi, I saw in the CVSweb that we lost Rules.mak between 16306 and 16307. Last version of the files are 16170. I used it to compile buildroot snapshot(05-Nov-2006) from LFS live cd with success. Options: linux 2.6.12, gcc 4.1.1, binutils 2.17 May some CVS maintainers could say why this file was removed please ? Issue History Date Modified Username Field Change ====================================================================== 10-14-06 07:53 benakiva New Issue 10-14-06 07:53 benakiva Status new => assigned 10-14-06 07:53 benakiva Assigned To => uClibc 10-14-06 08:04 benakiva Issue Monitored: benakiva 10-14-06 08:08 benakiva File Added: bug.txt 10-14-06 08:10 benakiva Note Added: 0001702 10-30-06 16:03 zyqwert Issue Monitored: zyqwert 11-04-06 15:58 benoitcosials Note Added: 0001730 ====================================================================== From bugs at busybox.net Sun Nov 5 14:51:53 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Sun, 5 Nov 2006 14:51:53 -0800 Subject: [uClibc 0001081]: lfind/lsearch prototype error Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1081 ====================================================================== Reported By: uecasm Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1081 Category: Standards Compliance Reproducibility: always Severity: crash Priority: normal Status: assigned ====================================================================== Date Submitted: 11-05-2006 14:51 PST Last Modified: 11-05-2006 14:51 PST ====================================================================== Summary: lfind/lsearch prototype error Description: (I checked the code in 0.9.28 and it seems to have the same issue) In uClibc, the comparison function for lfind and lsearch is invoked using the array pointer followed by the key pointer. However, according to my Debian man page that's the wrong way around. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 11-05-06 14:51 uecasm New Issue 11-05-06 14:51 uecasm Status new => assigned 11-05-06 14:51 uecasm Assigned To => uClibc ====================================================================== From andersen at uclibc.org Mon Nov 6 09:46:45 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Mon, 6 Nov 2006 09:46:45 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips Message-ID: <20061106174645.5AAAA48579@busybox.net> Author: andersen Date: 2006-11-06 09:46:44 -0800 (Mon, 06 Nov 2006) New Revision: 16517 Log: mips64 patch from Atsushi Nemoto: We should use "PTR_LA" instead of "la" for N64 ABI. Modified: trunk/uClibc/libc/sysdeps/linux/mips/pipe.S Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/pipe.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/pipe.S 2006-11-05 19:47:33 UTC (rev 16516) +++ trunk/uClibc/libc/sysdeps/linux/mips/pipe.S 2006-11-06 17:46:44 UTC (rev 16517) @@ -19,7 +19,7 @@ syscall beqz a3, 1f #ifdef __PIC__ - la t9, __syscall_error + PTR_LA t9, __syscall_error jr t9 #else j __syscall_error From andersen at uclibc.org Mon Nov 6 09:49:24 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Mon, 6 Nov 2006 09:49:24 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/misc/sysvipc Message-ID: <20061106174924.DCEFD48584@busybox.net> Author: andersen Date: 2006-11-06 09:49:24 -0800 (Mon, 06 Nov 2006) New Revision: 16518 Log: mips64 patch from Atsushi Nemoto: We should not use old stype ipc_perm for 64-bit mips kernel. I suppose other 64-bit platforms shoule define __IPC_64 also and we can define it unconditionally, but not sure for other archs ... Modified: trunk/uClibc/libc/misc/sysvipc/ipc.h Changeset: Modified: trunk/uClibc/libc/misc/sysvipc/ipc.h =================================================================== --- trunk/uClibc/libc/misc/sysvipc/ipc.h 2006-11-06 17:46:44 UTC (rev 16517) +++ trunk/uClibc/libc/misc/sysvipc/ipc.h 2006-11-06 17:49:24 UTC (rev 16518) @@ -3,7 +3,7 @@ #include #include -#if __WORDSIZE == 32 || defined __alpha__ +#if __WORDSIZE == 32 || defined __alpha__ || defined __mips__ # define __IPC_64 0x100 #else # define __IPC_64 0x0 From bugs at busybox.net Tue Nov 7 02:32:15 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Tue, 7 Nov 2006 02:32:15 -0800 Subject: [buildroot 0000929]: MIPS build fail on gcc 4.0.2 Message-ID: A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=929 ====================================================================== Reported By: mcallegari1979 Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 929 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 07-02-2006 12:25 PDT Last Modified: 11-07-2006 02:32 PST ====================================================================== Summary: MIPS build fail on gcc 4.0.2 Description: Hi, I'm trying to compile buildroot (buildroot-20060702) for a MIPS EL architecture but it fails compiling the libstdc++ of several compilers (4.0.2, 4.1.0, 4.1.1) I'm using a FC4 (gcc 4.1.1). Same happens on FC5. Following the build messages...very similar to bug 0000925, considered fixed. Please help. Thanx in advance, Massimo /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/gcc/xgcc -shared-libgcc -B/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/gcc/ -nostdinc++ -L/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/src -L/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/src/.libs -B/home/develop/calmas/buildroot/build_mips/staging_dir/mips-linux-uclibc/bin/ -B/home/develop/calmas/buildroot/build_mips/staging_dir/mips-linux-uclibc/lib/ -isystem /home/develop/calmas/buildroot/build_mips/staging_dir/mips-linux-uclibc/include -isystem /home/develop/calmas/buildroot/build_mips/staging_dir/mips-linux-uclibc/sys-include -I/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/mips-linux-uclibc -I/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include -I/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2/libstdc++-v3/libsupc++ -g -Os -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2/libstdc++-v3/src/ext-inst.cc -fPIC -DPIC -o .libs/ext-inst.o In file included from /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2/libstdc++-v3/src/ext-inst.cc:34: /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:1085:21: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2325:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2332:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2338:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2345:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2352:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2359:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2367:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2375:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2383:19: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2390:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2390:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2390:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2394:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2394:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2394:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2399:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2399:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2399:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2404:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2404:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2404:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2409:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2409:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2409:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2414:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2414:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2414:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2419:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2419:40: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2419:54: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2424:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2428:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2432:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2436:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2440:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2444:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2448:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2454:31: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2455:29: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2462:31: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2479:22: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2480:20: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2486:31: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2497:22: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2498:20: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2504:31: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2520:32: error: macro "index" requires 2 arguments, but only 1 given In file included from /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:2897, from /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2/libstdc++-v3/src/ext-inst.cc:34: /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1665:67: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1667:26: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1667:55: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1669:28: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1669:44: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1669:63: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1671:27: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1671:45: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/ropeimpl.h:1671:63: error: macro "index" requires 2 arguments, but only 1 given /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:1085: error: expected ';' before 'const' /home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/include/ext/rope:1087: error: expected `;' before '_Rope_iterator_base' make[4]: *** [ext-inst.lo] Error 1 make[4]: Leaving directory `/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/develop/calmas/buildroot/toolchain_build_mips/gcc-4.0.2-final/mips-linux-uclibc/libstdc++-v3' make[1]: *** [all-target-libstdc++-v3] Error 2 ====================================================================== ---------------------------------------------------------------------- anemo - 07-05-06 00:18 ---------------------------------------------------------------------- This error can heppen by index() macro in uClibc/include/string.h. UCLIBC_SUSV3_LEGACY=y would be an quick workaroud. ---------------------------------------------------------------------- mcallegari1979 - 07-05-06 03:07 ---------------------------------------------------------------------- Hi anemo, thanx for the hint but now it breaks somewhere else during the building of GCC: **************************************************************** Current kernel version is 2.4.31 Using kernel headers from 2.4.31 for architecture 'mips' provided in directory /home/develop/calmas/buildroot/toolchain_build_mipsel/linux/ CC ldso/ldso/ldso.oS ldso/ldso/ldso.c:179: error: conflicting types for '_dl_get_ready_to_run' ./ldso/include/ldso.h:92: error: previous declaration of '_dl_get_ready_to_run' was here make[1]: *** [ldso/ldso/ldso.oS] Error 1 ************************************************************** I needed to patch ldso.h: extern void _dl_get_ready_to_run(struct elf_resolve *tpnt, ElfW(Addr) load_addr, ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv); Then it goes on... If the build of java compiler is enabled then it blocks again on libjava. In my case i don't need it so I disabled it. If I have any other info I'll post them here. Cheers by now Massimo ---------------------------------------------------------------------- bowerymarc - 07-16-06 18:53 ---------------------------------------------------------------------- I got the same bug trying to build gcc-3.4.3 for arm: /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/gcc/xgcc -shared-libgcc -B/home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/gcc/ -nostdinc++ -L/home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/src -L/home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/src/.libs -B/home/tools/buildroot/build_arm_nofpu/staging_dir/arm-linux-uclibc/bin/ -B/home/tools/buildroot/build_arm_nofpu/staging_dir/arm-linux-uclibc/lib/ -isystem /home/tools/buildroot/build_arm_nofpu/staging_dir/arm-linux-uclibc/include -isystem /home/tools/buildroot/build_arm_nofpu/staging_dir/arm-linux-uclibc/sys-include -I/home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/arm-linux-uclibc -I/home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include -I/home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3/libstdc++-v3/libsupc++ -g -Os -g -Os -fno-implicit-templates -Wall -W -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -c /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3/libstdc++-v3/src/ext-inst.cc -fPIC -DPIC -o .libs/ext-inst.o In file included from /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3/libstdc++-v3/src/ext-inst.cc:34: /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:934:18: macro "index" requires 2 arguments, but only 1 given In file included from /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3/libstdc++-v3/src/ext-inst.cc:34: /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:934: error: expected `;' before "const" /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:935: error: expected `;' before "_Rope_iterator_base" /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2011:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2013:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2015:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2017:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2019:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2021:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2024:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2027:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2030:36: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2035:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2035:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2035:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2037:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2037:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2037:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2040:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2040:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2040:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2043:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2043:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2043:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2046:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2046:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2046:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2049:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2049:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2049:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2052:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2052:50: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2052:64: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2056:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2058:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2060:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2062:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2064:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2067:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2069:37: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2073:42: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2074:40: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2078:42: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2093:23: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2094:21: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2098:42: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2107:61: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2107:76: macro "index" requires 2 arguments, but only 1 given /home/tools/buildroot/toolchain_build_arm_nofpu/gcc-3.4.3-final/arm-linux-uclibc/libstdc++-v3/include/ext/rope:2111:42: macro "index" requires 2 argumen