From bugs at busybox.net Fri Jan 4 00:52:02 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 00:52:02 -0800 Subject: [uClibc 0001849]: getcwd() problem on kernels without getcwd syscall Message-ID: <101f3ffe28b63ec75b3e2611ded049cc@busybox.net> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1849 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1849 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 00:52 PST Last Modified: 01-04-2008 00:52 PST ====================================================================== Summary: getcwd() problem on kernels without getcwd syscall Description: The getcwd() implementation in the absence of a getcwd syscall has an off-by-one allocation bug. As a result, sometimes the returned string has garbage at the end. I'm attaching a patch to fix the issue. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 00:52 michael_d New Issue 01-04-08 00:52 michael_d Status new => assigned 01-04-08 00:52 michael_d Assigned To => uClibc 01-04-08 00:52 michael_d File Added: uClibc-0.9.29-getcwd.diff ====================================================================== From bugs at busybox.net Fri Jan 4 01:10:50 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 01:10:50 -0800 Subject: [uClibc 0001854]: make menuconfig fails when libncurses is an as-needed stub Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1854 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1854 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 01:10 PST Last Modified: 01-04-2008 01:10 PST ====================================================================== Summary: make menuconfig fails when libncurses is an as-needed stub Description: On my systems, I have replaced most "*.so" files with linker scripts which reference the real libraries with in an AS_NEEDED( ) block. This makes my binaries neater in cases where dumb build scripts reference libraries that aren't really needed. However, when I try to configure a virgin uClibc tree, I get many errors linking "mconf", which cite undefined symbols that are obviously from ncurses. It appears the linker works left-to-right and decides when a library is needed or not at the moment it appears. Your Makefile puts "-lncurses" before any object files, so the linker never sees an ncurses symbol reference until it is too late. This problem apparently would also occur with a static libncurses -- hence most other projects are careful to put all "-l" options at the end of the linker invocation. I've attached a patch that moves the library options to the end of the line, allowing "make menuconfig" to work on my system. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 01:10 michael_d New Issue 01-04-08 01:10 michael_d Status new => assigned 01-04-08 01:10 michael_d Assigned To => uClibc 01-04-08 01:10 michael_d File Added: uClibc-0.9.29-conffix.diff ====================================================================== From bugs at busybox.net Fri Jan 4 02:57:41 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 02:57:41 -0800 Subject: [uClibc 0001859]: program_invocation_name and others not set with shared libc Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1859 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1859 Category: Shared Library Support Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 02:57 PST Last Modified: 01-04-2008 02:57 PST ====================================================================== Summary: program_invocation_name and others not set with shared libc Description: Consider the following program: #define _GNU_SOURCE #include #include #include extern char *__progname; int main (int argc, char **argv) { printf ("PISN = %s\nPIN = %s\n_PN = %s\n", program_invocation_short_name, program_invocation_name, __progname); /* assertion reveals the value of __uclibc_progname */ assert (0); } The output of the program should be as follows: $ progname PISN = progname PIN = ./progname _PN = progname progname: progname.c: 14: main: Assertion `0' failed. Aborted Yet the actual result on an unfixed, shared uClibc is: $ ./progname PISN = (null) PIN = (null) _PN = progname (null): progname.c: 14: main: Assertion `0' failed. Aborted uClibc tries to arrange for __progname to occupy the same memory address as program_invocation_short_name and the hidden variable __uclibc_progname. It also arranges for program_invocation_name to similarly overlap the hidden variable __progname_full. In __uClibc_main(), only one variable from each group is actually set. This would be fine if the magic to overlap the variables actually worked. But it does not when uClibc is a shared library. I've attached a patch which adds extra assignments so that all 5 variables are initialized. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 02:57 michael_d New Issue 01-04-08 02:57 michael_d Status new => assigned 01-04-08 02:57 michael_d Assigned To => uClibc 01-04-08 02:57 michael_d File Added: uClibc-0.9.29-progname.diff ====================================================================== From bugs at busybox.net Fri Jan 4 03:15:58 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 03:15:58 -0800 Subject: [uClibc 0001864]: obstack.h not compatible with modern GCC Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1864 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1864 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 03:15 PST Last Modified: 01-04-2008 03:15 PST ====================================================================== Summary: obstack.h not compatible with modern GCC Description: uClibc's obstack.h is apparently derived from an older GNU version which contains constructs that current versions of GCC will refuse to compile. Normally, this problem is invisible, because GCC's fixincludes process will automatically derive a safe version of obstack.h, which GCC will use in preference to the copy in /usr/include. However, the bug bit me when I was crossing over from glibc -- GCC's fixincludes process doesn't seem to run correctly when crosscompiling. It's a good idea to fix this in the library. I'm attaching a patch that makes exactly the same changes GCC's fixincludes does. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 03:15 michael_d New Issue 01-04-08 03:15 michael_d Status new => assigned 01-04-08 03:15 michael_d Assigned To => uClibc 01-04-08 03:15 michael_d File Added: uClibc-0.9.29-obstack.diff ====================================================================== From bugs at busybox.net Fri Jan 4 03:42:56 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 03:42:56 -0800 Subject: [uClibc 0001869]: error_at_line, etc. not compatible with GNU Message-ID: <3d161a323cfa4d3da4b23aafc7c75849@busybox.net> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1869 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1869 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 03:42 PST Last Modified: 01-04-2008 03:42 PST ====================================================================== Summary: error_at_line, etc. not compatible with GNU Description: The uClibc implementation of error_at_line() and related functions omits the program name from the error messages. This causes many spurious test-suite failures in packages such as coreutils, because error messages are no longer byte-for-byte identical to what the self-checks expect. I've attached a patch to make uClibc emit the name, so the tests don't spuriously fail. Note that issue http://busybox.net/bugs/view.php?id=1859 must be fixed first, otherwise the patch won't work when uClibc is shared, as __uclibc_progname would be uninitialized. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 03:42 michael_d New Issue 01-04-08 03:42 michael_d Status new => assigned 01-04-08 03:42 michael_d Assigned To => uClibc 01-04-08 03:42 michael_d File Added: uClibc-0.9.29-erroratl.diff ====================================================================== From bugs at busybox.net Fri Jan 4 06:39:42 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 06:39:42 -0800 Subject: [uClibc 0001874]: Problem with i386 syscall gcc-constraints Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1874 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1874 Category: Architecture Specific Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 06:39 PST Last Modified: 01-04-2008 06:39 PST ====================================================================== Summary: Problem with i386 syscall gcc-constraints Description: On an i386 platform with no rt_sigsuspend syscall (ie: Linux 2.0), compilation will halt on libc/sysdeps/linux/common/sigsuspend.os with a cryptic error message: "Error: non-constant expression in ".if" statement" I've investigated and found that the cause is that a literal '0' is being passed into a block of complex assembler macrology that is only prepared to deal with register names - '%eax', etc. In turn, that seems to be because of a typo in the GCC register constraints. The constraints for 2 and 3-argument syscalls includes a "C" constraint. To gcc, "C" means an SSE floating point constant -- an unlikely element in a syscall. I suspect the author meant to type "S" (%esi). I've attached a patch that changes those "C"s into "S"s, permitting compilation. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 06:39 michael_d New Issue 01-04-08 06:39 michael_d Status new => assigned 01-04-08 06:39 michael_d Assigned To => uClibc 01-04-08 06:39 michael_d File Added: uClibc-0.9.29-syscall.diff ====================================================================== From bugs at busybox.net Fri Jan 4 07:08:38 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 07:08:38 -0800 Subject: [uClibc 0001879]: ptsname() does not work in the no-TIOCGPTN case Message-ID: <93281f784339c5518896693f15bc86f8@bugs.uclibc.org> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1879 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1879 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 07:08 PST Last Modified: 01-04-2008 07:08 PST ====================================================================== Summary: ptsname() does not work in the no-TIOCGPTN case Description: When no TIOCGPTN definition is present in the kernel headers, the library's ptsname() function will not work. The libc/stdlib/ptsname_r.c file is the problem. This file includes a complicated nest of #if directives. One of these #if's has the opposite sense from what is required. Simply removing one character allows PTY-using programs such as "script" to work. I've done that in the attached patch. Note: to get the PTY-related functions working fully on an old kernel, it is also necessary to supply a /sbin/pt_chown program. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 07:08 michael_d New Issue 01-04-08 07:08 michael_d Status new => assigned 01-04-08 07:08 michael_d Assigned To => uClibc 01-04-08 07:08 michael_d File Added: uClibc-0.9.29-ptyfix.diff ====================================================================== From bugs at busybox.net Fri Jan 4 07:46:57 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 07:46:57 -0800 Subject: [uClibc 0001884]: printf() field-width limit is unacceptable Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1884 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1884 Category: Stdio Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 07:46 PST Last Modified: 01-04-2008 07:46 PST ====================================================================== Summary: printf() field-width limit is unacceptable Description: Uclibc includes code that tries to protect printf against large output widths. This code presents a problem, as it causes a spurious test failure in coreutils-6.9, specifically the test du/deref-args. While the feature that test is actually challenging is irrelevant to printf, it tries to create a 64k file with the command "printf %65536s x > 64k". Bash's printf builtin evidently punts to uClibc in this case, which silently treats the command as %6553s, producing a file of the wrong size. It's even worse in the current alpha coreutils-6.9.91. Among other test failures I haven't looked into yet, it has one test, "misc/printf-suprise", which verifies that "%20000000f" works under an rlimit constraint of 10000k. (Although you can weasel out of that one by arranging for printf() to return nonzero when overloaded.) I don't have a fix, save simply diking out the MAX_FIELD_WIDTH check. Note that coreutils-6.9 will show other test failures due to issue http://busybox.net/bugs/view.php?id=1869. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 07:46 michael_d New Issue 01-04-08 07:46 michael_d Status new => assigned 01-04-08 07:46 michael_d Assigned To => uClibc ====================================================================== From bugs at busybox.net Fri Jan 4 10:24:40 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 10:24:40 -0800 Subject: [uClibc 0001894]: can't compile 'memcpy' for mipsel Message-ID: <5a1b7b3aa6aa8f012aa2e9437de11bc0@bugs.uclibc.org> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=1894 ====================================================================== Reported By: alec_v Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1894 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: assigned ====================================================================== Date Submitted: 01-04-2008 10:24 PST Last Modified: 01-04-2008 10:24 PST ====================================================================== Summary: can't compile 'memcpy' for mipsel Description: AS libc/string/mips/memcpy.os libc/string/mips/memcpy.S:156:1: pasting "memcpy" and ":" does not give a valid preprocessing token make[2]: *** [libc/string/mips/memcpy.os] Error 1 make[1]: *** [lib/libc.so.0] Error 2 make[1]: Leaving directory `/home/alec/mips/buildroot-20080104/toolchain_build_mipsel/uClibc-0.9.29' make: *** [/home/alec/mips/buildroot-20080104/toolchain_build_mipsel/uClibc-0.9.29/lib/libc.a] Error 2 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 01-04-08 10:24 alec_v New Issue 01-04-08 10:24 alec_v Status new => assigned 01-04-08 10:24 alec_v Assigned To => uClibc ====================================================================== From vapier at uclibc.org Fri Jan 4 21:32:10 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 21:32:10 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/common Message-ID: <20080105053210.9047E12009F@busybox.net> Author: vapier Date: 2008-01-04 21:32:09 -0800 (Fri, 04 Jan 2008) New Revision: 20711 Log: michael_d in #1849 writes: The getcwd() implementation in the absence of a getcwd syscall has an off-by-one allocation bug. As a result, sometimes the returned string has garbage at the end. Modified: trunk/uClibc/libc/sysdeps/linux/common/getcwd.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/common/getcwd.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/getcwd.c 2008-01-05 03:26:41 UTC (rev 20710) +++ trunk/uClibc/libc/sysdeps/linux/common/getcwd.c 2008-01-05 05:32:09 UTC (rev 20711) @@ -165,7 +165,7 @@ cwd = recurser(buf, size, st.st_dev, st.st_ino); if (cwd) { - len = strlen(buf); + len = strlen(buf) + 1; __set_errno(olderrno); } return len; From bugs at busybox.net Fri Jan 4 21:32:34 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 21:32:34 -0800 Subject: [uClibc 0001849]: getcwd() problem on kernels without getcwd syscall Message-ID: <8f8f84794b8841a4cc1202f11ff40498@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1849 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1849 Category: Other Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 00:52 PST Last Modified: 01-04-2008 21:32 PST ====================================================================== Summary: getcwd() problem on kernels without getcwd syscall Description: The getcwd() implementation in the absence of a getcwd syscall has an off-by-one allocation bug. As a result, sometimes the returned string has garbage at the end. I'm attaching a patch to fix the issue. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 21:32 ---------------------------------------------------------------------- thanks, ive added your patch to svn Issue History Date Modified Username Field Change ====================================================================== 01-04-08 00:52 michael_d New Issue 01-04-08 00:52 michael_d Status new => assigned 01-04-08 00:52 michael_d Assigned To => uClibc 01-04-08 00:52 michael_d File Added: uClibc-0.9.29-getcwd.diff 01-04-08 21:32 vapier Note Added: 0003359 01-04-08 21:32 vapier Status assigned => closed 01-04-08 21:32 vapier Resolution open => fixed ====================================================================== From bugs at busybox.net Fri Jan 4 21:34:58 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 21:34:58 -0800 Subject: [uClibc 0001854]: make menuconfig fails when libncurses is an as-needed stub Message-ID: <03d69424854de632a40787b02d5413a0@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1854 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1854 Category: Other Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: duplicate Duplicate: 0 Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 01:10 PST Last Modified: 01-04-2008 21:34 PST ====================================================================== Summary: make menuconfig fails when libncurses is an as-needed stub Description: On my systems, I have replaced most "*.so" files with linker scripts which reference the real libraries with in an AS_NEEDED( ) block. This makes my binaries neater in cases where dumb build scripts reference libraries that aren't really needed. However, when I try to configure a virgin uClibc tree, I get many errors linking "mconf", which cite undefined symbols that are obviously from ncurses. It appears the linker works left-to-right and decides when a library is needed or not at the moment it appears. Your Makefile puts "-lncurses" before any object files, so the linker never sees an ncurses symbol reference until it is too late. This problem apparently would also occur with a static libncurses -- hence most other projects are careful to put all "-l" options at the end of the linker invocation. I've attached a patch that moves the library options to the end of the line, allowing "make menuconfig" to work on my system. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 21:34 ---------------------------------------------------------------------- thanks for the patch, but this was fixed sometime ago already dupe of http://busybox.net/bugs/view.php?id=1554 Issue History Date Modified Username Field Change ====================================================================== 01-04-08 01:10 michael_d New Issue 01-04-08 01:10 michael_d Status new => assigned 01-04-08 01:10 michael_d Assigned To => uClibc 01-04-08 01:10 michael_d File Added: uClibc-0.9.29-conffix.diff 01-04-08 21:34 vapier Note Added: 0003364 01-04-08 21:34 vapier Status assigned => closed 01-04-08 21:34 vapier Resolution open => duplicate ====================================================================== From bugs at busybox.net Fri Jan 4 21:53:36 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 21:53:36 -0800 Subject: [uClibc 0001894]: can't compile 'memcpy' for mipsel Message-ID: <9363b7bb7f9a51173ac10c661fde46b2@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1894 ====================================================================== Reported By: alec_v Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1894 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: closed Resolution: no change required Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 10:24 PST Last Modified: 01-04-2008 21:53 PST ====================================================================== Summary: can't compile 'memcpy' for mipsel Description: AS libc/string/mips/memcpy.os libc/string/mips/memcpy.S:156:1: pasting "memcpy" and ":" does not give a valid preprocessing token make[2]: *** [libc/string/mips/memcpy.os] Error 1 make[1]: *** [lib/libc.so.0] Error 2 make[1]: Leaving directory `/home/alec/mips/buildroot-20080104/toolchain_build_mipsel/uClibc-0.9.29' make: *** [/home/alec/mips/buildroot-20080104/toolchain_build_mipsel/uClibc-0.9.29/lib/libc.a] Error 2 ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 21:53 ---------------------------------------------------------------------- this is not a uClibc problem ... gcc-3.4.6 is broken when using -std=gnu99 in this case Issue History Date Modified Username Field Change ====================================================================== 01-04-08 10:24 alec_v New Issue 01-04-08 10:24 alec_v Status new => assigned 01-04-08 10:24 alec_v Assigned To => uClibc 01-04-08 21:53 vapier Note Added: 0003369 01-04-08 21:53 vapier Status assigned => closed 01-04-08 21:53 vapier Resolution open => no change required ====================================================================== From vapier at uclibc.org Fri Jan 4 21:55:23 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 21:55:23 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/i386/bits Message-ID: <20080105055523.7DAF012009E@busybox.net> Author: vapier Date: 2008-01-04 21:55:23 -0800 (Fri, 04 Jan 2008) New Revision: 20712 Log: michael_d writes in #1874: On an i386 platform with no rt_sigsuspend syscall (ie: Linux 2.0), compilation will halt on libc/sysdeps/linux/common/sigsuspend.os with a cryptic error message: "Error: non-constant expression in ".if" statement" I've investigated and found that the cause is that a literal '0' is being passed into a block of complex assembler macrology that is only prepared to deal with register names - '%eax', etc. In turn, that seems to be because of a typo in the GCC register constraints. The constraints for 2 and 3-argument syscalls includes a "C" constraint. To gcc, "C" means an SSE floating point constant -- an unlikely element in a syscall. I suspect the author meant to type "S" (%esi). Modified: trunk/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h 2008-01-05 05:32:09 UTC (rev 20711) +++ trunk/uClibc/libc/sysdeps/linux/i386/bits/syscalls.h 2008-01-05 05:55:23 UTC (rev 20712) @@ -197,9 +197,9 @@ #define ASMFMT_1(arg1) \ , "acdSD" (arg1) #define ASMFMT_2(arg1, arg2) \ - , "adCD" (arg1), "c" (arg2) + , "adSD" (arg1), "c" (arg2) #define ASMFMT_3(arg1, arg2, arg3) \ - , "aCD" (arg1), "c" (arg2), "d" (arg3) + , "aSD" (arg1), "c" (arg2), "d" (arg3) #define ASMFMT_4(arg1, arg2, arg3, arg4) \ , "aD" (arg1), "c" (arg2), "d" (arg3), "S" (arg4) #define ASMFMT_5(arg1, arg2, arg3, arg4, arg5) \ From bugs at busybox.net Fri Jan 4 21:55:38 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 21:55:38 -0800 Subject: [uClibc 0001874]: Problem with i386 syscall gcc-constraints Message-ID: <2fdc63c12c47398bfd3795898170ca57@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1874 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1874 Category: Architecture Specific Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 06:39 PST Last Modified: 01-04-2008 21:55 PST ====================================================================== Summary: Problem with i386 syscall gcc-constraints Description: On an i386 platform with no rt_sigsuspend syscall (ie: Linux 2.0), compilation will halt on libc/sysdeps/linux/common/sigsuspend.os with a cryptic error message: "Error: non-constant expression in ".if" statement" I've investigated and found that the cause is that a literal '0' is being passed into a block of complex assembler macrology that is only prepared to deal with register names - '%eax', etc. In turn, that seems to be because of a typo in the GCC register constraints. The constraints for 2 and 3-argument syscalls includes a "C" constraint. To gcc, "C" means an SSE floating point constant -- an unlikely element in a syscall. I suspect the author meant to type "S" (%esi). I've attached a patch that changes those "C"s into "S"s, permitting compilation. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 21:55 ---------------------------------------------------------------------- thanks, i've applied the patch to svn trunk Issue History Date Modified Username Field Change ====================================================================== 01-04-08 06:39 michael_d New Issue 01-04-08 06:39 michael_d Status new => assigned 01-04-08 06:39 michael_d Assigned To => uClibc 01-04-08 06:39 michael_d File Added: uClibc-0.9.29-syscall.diff 01-04-08 21:55 vapier Note Added: 0003374 01-04-08 21:55 vapier Status assigned => closed 01-04-08 21:55 vapier Resolution open => fixed ====================================================================== From bugs at busybox.net Fri Jan 4 21:58:26 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 21:58:26 -0800 Subject: [uClibc 0001859]: program_invocation_name and others not set with shared libc Message-ID: <0e718d1324c647be6caf163369c7bb62@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1859 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1859 Category: Shared Library Support Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 02:57 PST Last Modified: 01-04-2008 21:58 PST ====================================================================== Summary: program_invocation_name and others not set with shared libc Description: Consider the following program: #define _GNU_SOURCE #include #include #include extern char *__progname; int main (int argc, char **argv) { printf ("PISN = %s\nPIN = %s\n_PN = %s\n", program_invocation_short_name, program_invocation_name, __progname); /* assertion reveals the value of __uclibc_progname */ assert (0); } The output of the program should be as follows: $ progname PISN = progname PIN = ./progname _PN = progname progname: progname.c: 14: main: Assertion `0' failed. Aborted Yet the actual result on an unfixed, shared uClibc is: $ ./progname PISN = (null) PIN = (null) _PN = progname (null): progname.c: 14: main: Assertion `0' failed. Aborted uClibc tries to arrange for __progname to occupy the same memory address as program_invocation_short_name and the hidden variable __uclibc_progname. It also arranges for program_invocation_name to similarly overlap the hidden variable __progname_full. In __uClibc_main(), only one variable from each group is actually set. This would be fine if the magic to overlap the variables actually worked. But it does not when uClibc is a shared library. I've attached a patch which adds extra assignments so that all 5 variables are initialized. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 21:58 ---------------------------------------------------------------------- thanks for the patch, but this has already been fixed in svn dupe of 1310 Issue History Date Modified Username Field Change ====================================================================== 01-04-08 02:57 michael_d New Issue 01-04-08 02:57 michael_d Status new => assigned 01-04-08 02:57 michael_d Assigned To => uClibc 01-04-08 02:57 michael_d File Added: uClibc-0.9.29-progname.diff 01-04-08 21:58 vapier Note Added: 0003379 01-04-08 21:58 vapier Status assigned => closed 01-04-08 21:58 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Jan 4 22:03:12 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 22:03:12 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/misc/error Message-ID: <20080105060312.6165112C531@busybox.net> Author: vapier Date: 2008-01-04 22:03:12 -0800 (Fri, 04 Jan 2008) New Revision: 20713 Log: michael_d writes in #1869: make sure GNU error functions output 'program: ' as documented in the function api Modified: trunk/uClibc/libc/misc/error/error.c Changeset: Modified: trunk/uClibc/libc/misc/error/error.c =================================================================== --- trunk/uClibc/libc/misc/error/error.c 2008-01-05 05:55:23 UTC (rev 20712) +++ trunk/uClibc/libc/misc/error/error.c 2008-01-05 06:03:12 UTC (rev 20713) @@ -53,6 +53,8 @@ fflush (stdout); + fprintf (stderr, "%s: ", __uclibc_progname); + va_start (args, message); vfprintf (stderr, message, args); va_end (args); @@ -87,6 +89,8 @@ fflush (stdout); + fprintf (stderr, "%s:", __uclibc_progname); + if (file_name != NULL) fprintf (stderr, "%s:%d: ", file_name, line_number); From bugs at busybox.net Fri Jan 4 22:03:28 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 22:03:28 -0800 Subject: [uClibc 0001869]: error_at_line, etc. not compatible with GNU Message-ID: The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1869 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1869 Category: Other Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 03:42 PST Last Modified: 01-04-2008 22:03 PST ====================================================================== Summary: error_at_line, etc. not compatible with GNU Description: The uClibc implementation of error_at_line() and related functions omits the program name from the error messages. This causes many spurious test-suite failures in packages such as coreutils, because error messages are no longer byte-for-byte identical to what the self-checks expect. I've attached a patch to make uClibc emit the name, so the tests don't spuriously fail. Note that issue http://busybox.net/bugs/view.php?id=1859 must be fixed first, otherwise the patch won't work when uClibc is shared, as __uclibc_progname would be uninitialized. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 22:03 ---------------------------------------------------------------------- thanks, i've applied your changes to svn trunk Issue History Date Modified Username Field Change ====================================================================== 01-04-08 03:42 michael_d New Issue 01-04-08 03:42 michael_d Status new => assigned 01-04-08 03:42 michael_d Assigned To => uClibc 01-04-08 03:42 michael_d File Added: uClibc-0.9.29-erroratl.diff 01-04-08 22:03 vapier Note Added: 0003384 01-04-08 22:03 vapier Status assigned => closed 01-04-08 22:03 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Jan 4 22:07:49 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 22:07:49 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/stdlib Message-ID: <20080105060749.EF09912C534@busybox.net> Author: vapier Date: 2008-01-04 22:07:49 -0800 (Fri, 04 Jan 2008) New Revision: 20714 Log: michael_d writes in 1879: When no TIOCGPTN definition is present in the kernel headers, the library's ptsname() function will not work. The libc/stdlib/ptsname_r.c file is the problem. This file includes a complicated nest of #if directives. One of these #if's has the opposite sense from what is required. Modified: trunk/uClibc/libc/stdlib/ptsname.c Changeset: Modified: trunk/uClibc/libc/stdlib/ptsname.c =================================================================== --- trunk/uClibc/libc/stdlib/ptsname.c 2008-01-05 06:03:12 UTC (rev 20713) +++ trunk/uClibc/libc/stdlib/ptsname.c 2008-01-05 06:07:49 UTC (rev 20714) @@ -129,7 +129,7 @@ return ENOTTY; } #else -# if !defined TIOCGPTN +# if defined TIOCGPTN else if (errno == EINVAL) # endif { From bugs at busybox.net Fri Jan 4 22:08:25 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 22:08:25 -0800 Subject: [uClibc 0001879]: ptsname() does not work in the no-TIOCGPTN case Message-ID: <0fdb66c4c34e95f23e610536f4ce1d53@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1879 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1879 Category: Other Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 01-04-2008 07:08 PST Last Modified: 01-04-2008 22:08 PST ====================================================================== Summary: ptsname() does not work in the no-TIOCGPTN case Description: When no TIOCGPTN definition is present in the kernel headers, the library's ptsname() function will not work. The libc/stdlib/ptsname_r.c file is the problem. This file includes a complicated nest of #if directives. One of these #if's has the opposite sense from what is required. Simply removing one character allows PTY-using programs such as "script" to work. I've done that in the attached patch. Note: to get the PTY-related functions working fully on an old kernel, it is also necessary to supply a /sbin/pt_chown program. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 22:08 ---------------------------------------------------------------------- looks like in the process of adding control over the unix pty options, this incorrect ifdef was introduced but never noticed thanks, ive applied your fix to svn Issue History Date Modified Username Field Change ====================================================================== 01-04-08 07:08 michael_d New Issue 01-04-08 07:08 michael_d Status new => assigned 01-04-08 07:08 michael_d Assigned To => uClibc 01-04-08 07:08 michael_d File Added: uClibc-0.9.29-ptyfix.diff 01-04-08 22:08 vapier Note Added: 0003389 01-04-08 22:08 vapier Status assigned => closed 01-04-08 22:08 vapier Resolution open => fixed ====================================================================== From bugs at busybox.net Fri Jan 4 22:09:25 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 22:09:25 -0800 Subject: [uClibc 0001254]: [PATCH] clean up warnings caused by slighly improper version of wordsize.h for ia64 Message-ID: The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1254 ====================================================================== Reported By: ahs3 Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 1254 Category: Architecture Specific Reproducibility: always Severity: trivial Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 03-02-2007 16:09 PST Last Modified: 01-04-2008 22:09 PST ====================================================================== Summary: [PATCH] clean up warnings caused by slighly improper version of wordsize.h for ia64 Description: Just cleaning up compiler warnings -- in this case, the warning was that __WORDSIZE_COMPAT32 was not defined. Added the proper definition to libc/sysdeps/ia64/bits/wordsize.h to make the warning go away. ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 22:09 ---------------------------------------------------------------------- i'm pretty sure this was resolved on the mailing list some time ago ... if i'm wrong, please re-open Issue History Date Modified Username Field Change ====================================================================== 03-02-07 16:09 ahs3 New Issue 03-02-07 16:09 ahs3 Status new => assigned 03-02-07 16:09 ahs3 Assigned To => uClibc 03-02-07 16:09 ahs3 File Added: wordsize-warnings.patch 01-04-08 22:09 vapier Note Added: 0003394 01-04-08 22:09 vapier Status assigned => closed 01-04-08 22:09 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Jan 4 22:46:28 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 22:46:28 -0800 (PST) Subject: svn commit: trunk/uClibc Message-ID: <20080105064628.E985812C4D2@busybox.net> Author: vapier Date: 2008-01-04 22:46:28 -0800 (Fri, 04 Jan 2008) New Revision: 20715 Log: pop -m32 onto LDFLAGS/CFLAGS to make building on x86_64 multilib systems transparent Modified: trunk/uClibc/Rules.mak Changeset: Modified: trunk/uClibc/Rules.mak =================================================================== --- trunk/uClibc/Rules.mak 2008-01-05 06:07:49 UTC (rev 20714) +++ trunk/uClibc/Rules.mak 2008-01-05 06:46:28 UTC (rev 20715) @@ -168,6 +168,8 @@ ifeq ($(TARGET_ARCH),i386) OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,) OPTIMIZATION+=$(call check_gcc,-falign-jumps=0 -falign-loops=0,-malign-jumps=0 -malign-loops=0) + CPU_LDFLAGS-y+=-m32 + CPU_CFLAGS-y+=-m32 CPU_CFLAGS-$(CONFIG_386)+=-march=i386 CPU_CFLAGS-$(CONFIG_486)+=-march=i486 CPU_CFLAGS-$(CONFIG_ELAN)+=-march=i486 From vapier at uclibc.org Fri Jan 4 22:47:31 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 22:47:31 -0800 (PST) Subject: svn commit: trunk/uClibc: include/sys libc/misc/sysvipc libc/sysde etc... Message-ID: <20080105064731.10E3D12C4D2@busybox.net> Author: vapier Date: 2008-01-04 22:47:30 -0800 (Fri, 04 Jan 2008) New Revision: 20716 Log: implement semtimedop for #927 Added: trunk/uClibc/libc/misc/sysvipc/__syscall_ipc.c trunk/uClibc/libc/misc/sysvipc/semtimedop.c Removed: trunk/uClibc/libc/sysdeps/linux/common/__syscall_ipc.c Modified: trunk/uClibc/include/sys/sem.h trunk/uClibc/libc/misc/sysvipc/Makefile.in trunk/uClibc/libc/misc/sysvipc/ipc.h trunk/uClibc/libc/misc/sysvipc/msgq.c trunk/uClibc/libc/misc/sysvipc/sem.c trunk/uClibc/libc/misc/sysvipc/shm.c Changeset: Modified: trunk/uClibc/include/sys/sem.h =================================================================== --- trunk/uClibc/include/sys/sem.h 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/include/sys/sem.h 2008-01-05 06:47:30 UTC (rev 20716) @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995-1999, 2000, 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 @@ -30,6 +30,11 @@ /* Get system dependent definition of `struct semid_ds' and more. */ #include +#ifdef __USE_GNU +# define __need_timespec +# include +#endif + /* The following System V style IPC functions implement a semaphore handling. The definition is found in XPG2. */ @@ -53,6 +58,12 @@ /* Operate on semaphore. */ extern int semop (int __semid, struct sembuf *__sops, size_t __nsops) __THROW; +#ifdef __USE_GNU +/* Operate on semaphore with timeout. */ +extern int semtimedop (int __semid, struct sembuf *__sops, size_t __nsops, + __const struct timespec *__timeout) __THROW; +#endif + __END_DECLS #endif /* sys/sem.h */ Modified: trunk/uClibc/libc/misc/sysvipc/Makefile.in =================================================================== --- trunk/uClibc/libc/misc/sysvipc/Makefile.in 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/libc/misc/sysvipc/Makefile.in 2008-01-05 06:47:30 UTC (rev 20716) @@ -5,10 +5,10 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC := ftok.c +CSRC := ftok.c __syscall_ipc.c # multi source sem.c -CSRC += semget.c semctl.c semop.c +CSRC += semget.c semctl.c semop.c semtimedop.c # multi source shm.c CSRC += shmat.c shmctl.c shmdt.c shmget.c Copied: trunk/uClibc/libc/misc/sysvipc/__syscall_ipc.c (from rev 20709, trunk/uClibc/libc/sysdeps/linux/common/__syscall_ipc.c) =================================================================== --- trunk/uClibc/libc/misc/sysvipc/__syscall_ipc.c (rev 0) +++ trunk/uClibc/libc/misc/sysvipc/__syscall_ipc.c 2008-01-05 06:47:30 UTC (rev 20716) @@ -0,0 +1,17 @@ +/* vi: set sw=4 ts=4: */ +/* + * __syscall_ipc() for uClibc + * + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include + +#ifdef __NR_ipc +#define __NR___syscall_ipc __NR_ipc +#include "ipc.h" +_syscall6(int, __syscall_ipc, unsigned int, call, long, first, long, second, long, + third, void *, ptr, void *, fifth); +#endif Modified: trunk/uClibc/libc/misc/sysvipc/ipc.h =================================================================== --- trunk/uClibc/libc/misc/sysvipc/ipc.h 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/libc/misc/sysvipc/ipc.h 2008-01-05 06:47:30 UTC (rev 20716) @@ -12,14 +12,15 @@ #ifdef __NR_ipc /* The actual system call: all functions are multiplexed by this. */ -extern int __syscall_ipc (unsigned int __call, int __first, int __second, - int __third, void *__ptr) attribute_hidden; +extern int __syscall_ipc (unsigned int __call, long __first, long __second, + long __third, void *__ptr, void *__fifth) attribute_hidden; /* The codes for the functions to use the multiplexer `__syscall_ipc'. */ #define IPCOP_semop 1 #define IPCOP_semget 2 #define IPCOP_semctl 3 +#define IPCOP_semtimedop 4 #define IPCOP_msgsnd 11 #define IPCOP_msgrcv 12 #define IPCOP_msgget 13 Modified: trunk/uClibc/libc/misc/sysvipc/msgq.c =================================================================== --- trunk/uClibc/libc/misc/sysvipc/msgq.c 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/libc/misc/sysvipc/msgq.c 2008-01-05 06:47:30 UTC (rev 20716) @@ -15,7 +15,7 @@ #ifdef __NR_msgctl return __libc_msgctl(msqid, cmd | __IPC_64, buf); #else - return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf); + return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf, 0); #endif } #endif @@ -28,7 +28,7 @@ /* Get messages queue. */ int msgget (key_t key, int msgflg) { - return __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0); + return __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0, 0); } #endif #endif @@ -52,7 +52,7 @@ temp.r_msgtyp = msgtyp; temp.oldmsg = msgp; - return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp); + return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp, 0); } #endif #endif @@ -66,7 +66,7 @@ /* Send message to message queue. */ int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) { - return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp); + return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp, 0); } #endif #endif Modified: trunk/uClibc/libc/misc/sysvipc/sem.c =================================================================== --- trunk/uClibc/libc/misc/sysvipc/sem.c 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/libc/misc/sysvipc/sem.c 2008-01-05 06:47:30 UTC (rev 20716) @@ -53,7 +53,7 @@ #ifdef __NR_semctl return __semctl(semid, semnum, cmd | __IPC_64, arg.__pad); #else - return __syscall_ipc(IPCOP_semctl, semid, semnum, cmd | __IPC_64, &arg); + return __syscall_ipc(IPCOP_semctl, semid, semnum, cmd | __IPC_64, &arg, 0); #endif } #endif @@ -70,7 +70,7 @@ * with KEY. */ int semget (key_t key, int nsems, int semflg) { - return __syscall_ipc(IPCOP_semget, key, nsems, semflg, NULL); + return __syscall_ipc(IPCOP_semget, key, nsems, semflg, NULL, 0); } #endif #endif @@ -84,7 +84,22 @@ /* Perform user-defined atomical operation of array of semaphores. */ int semop (int semid, struct sembuf *sops, size_t nsops) { - return __syscall_ipc(IPCOP_semop, semid, (int) nsops, 0, sops); + return __syscall_ipc(IPCOP_semop, semid, (int) nsops, 0, sops, 0); } #endif #endif + +#ifdef L_semtimedop + +#ifdef __NR_semtimedop +_syscall6(int, semtimedop, int, semid, struct sembuf *, sops, size_t, nsops, const struct timespec *, timeout); + +#else + +int semtimedop(int semid, struct sembuf *sops, size_t nsops, + const struct timespec *timeout) +{ + return __syscall_ipc(IPCOP_semtimedop, semid, nsops, 0, sops, timeout); +} +#endif +#endif Added: trunk/uClibc/libc/misc/sysvipc/semtimedop.c =================================================================== --- trunk/uClibc/libc/misc/sysvipc/semtimedop.c (rev 0) +++ trunk/uClibc/libc/misc/sysvipc/semtimedop.c 2008-01-05 06:47:30 UTC (rev 20716) @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_semtimedop +#include "sem.c" Modified: trunk/uClibc/libc/misc/sysvipc/shm.c =================================================================== --- trunk/uClibc/libc/misc/sysvipc/shm.c 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/libc/misc/sysvipc/shm.c 2008-01-05 06:47:30 UTC (rev 20716) @@ -45,7 +45,7 @@ int retval; unsigned long raddr; - retval = __syscall_ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr); + retval = __syscall_ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr, 0); return ((unsigned long int) retval > -(unsigned long int) SHMLBA ? (void *) retval : (void *) raddr); } @@ -63,7 +63,7 @@ #ifdef __NR_shmctl return __libc_shmctl(shmid, cmd | __IPC_64, buf); #else - return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf); + return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf, 0); #endif } #endif @@ -77,7 +77,7 @@ #else int shmdt (const void *shmaddr) { - return __syscall_ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr); + return __syscall_ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr, 0); } #endif #endif @@ -90,7 +90,7 @@ #else int shmget (key_t key, size_t size, int shmflg) { - return __syscall_ipc(IPCOP_shmget, key, size, shmflg, NULL); + return __syscall_ipc(IPCOP_shmget, key, size, shmflg, NULL, 0); } #endif #endif Deleted: trunk/uClibc/libc/sysdeps/linux/common/__syscall_ipc.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/__syscall_ipc.c 2008-01-05 06:46:28 UTC (rev 20715) +++ trunk/uClibc/libc/sysdeps/linux/common/__syscall_ipc.c 2008-01-05 06:47:30 UTC (rev 20716) @@ -1,17 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * __syscall_ipc() for uClibc - * - * Copyright (C) 2000-2006 Erik Andersen - * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ - -#include - -#ifdef __NR_ipc -#define __NR___syscall_ipc __NR_ipc -#include "../../../misc/sysvipc/ipc.h" -_syscall5(int, __syscall_ipc, unsigned int, call, int, first, int, second, int, - third, void *, ptr); -#endif From bugs at busybox.net Fri Jan 4 22:49:22 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 22:49:22 -0800 Subject: [uClibc 0000927]: No support for semtimedop(2) Message-ID: <4977b4aba3701086755a606b41199ba3@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=927 ====================================================================== Reported By: sh4d0wstr1f3 Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 927 Category: Architecture Specific Reproducibility: N/A Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 06-27-2006 09:32 PDT Last Modified: 01-04-2008 22:49 PST ====================================================================== Summary: No support for semtimedop(2) Description: The patch provided adds support for _syscall6 under x86. It also allows use of the semtimedop(2) system call. ====================================================================== ---------------------------------------------------------------------- vapier - 10-06-06 23:06 ---------------------------------------------------------------------- ive already added syscall6 support for x86 ... i dont really like the proposed patch for semtimedop though as it adds pointless overhead of a 6th argument to all ipc functions but one ---------------------------------------------------------------------- vapier - 01-04-08 22:49 ---------------------------------------------------------------------- the only other option would be to have two sets of multiplexed calls (one for 5 args and one for 6 args), but that added more in byte size than just tacking on a 6th arg everywhere you added "static inline" to the semtimedop syscall which is incorrect ... it wouldnt actually export a symbol in the libc ive fixed things up and committed to svn trunk ... thanks Issue History Date Modified Username Field Change ====================================================================== 06-27-06 09:32 sh4d0wstr1f3 New Issue 06-27-06 09:32 sh4d0wstr1f3 Status new => assigned 06-27-06 09:32 sh4d0wstr1f3 Assigned To => uClibc 06-27-06 09:32 sh4d0wstr1f3 File Added: semtimedop.df 10-06-06 23:06 vapier Note Added: 0001687 10-06-06 23:06 vapier Summary No support for semtimedop(2) / _syscall6 => No support for semtimedop(2) 01-04-08 22:49 vapier Note Added: 0003399 01-04-08 22:49 vapier Status assigned => closed 01-04-08 22:49 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Jan 4 23:06:08 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 23:06:08 -0800 (PST) Subject: svn commit: trunk/uClibc/extra/scripts Message-ID: <20080105070608.7B6DA12C52C@busybox.net> Author: vapier Date: 2008-01-04 23:06:08 -0800 (Fri, 04 Jan 2008) New Revision: 20717 Log: zen in #938 writes: I had occasion to look at the uClibc script "getent" and felt compelled to clean out the cargo-cult programming style. I believe that this version is clearer, and I've added some minor features while I was in there: * usage clause, if no arguments or "--help" requested * original version appears to have been intending to "exit 2" on failure to match, but didn't * basic, probably good enough, support for ethers and netgroups * faster ;-) [as if that matters for this script] Modified: trunk/uClibc/extra/scripts/getent Changeset: Modified: trunk/uClibc/extra/scripts/getent =================================================================== --- trunk/uClibc/extra/scripts/getent 2008-01-05 06:47:30 UTC (rev 20716) +++ trunk/uClibc/extra/scripts/getent 2008-01-05 07:06:08 UTC (rev 20717) @@ -1,73 +1,43 @@ #!/bin/sh +# $Header: /var/cvs/uClibc/extra/scripts/getent,v 1.2 2005/02/02 14:18:01 solar Exp $ # -# Copyright (C) 2000-2006 Erik Andersen +# Closely (not perfectly) emulate the behavior of glibc's getent utility # -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# +#passwd|shadow|group|aliases|hosts|networks|ethers|netgroup|protocols|services|rpc +# only returns the first match (by design) +# dns based search is not supported (hosts,networks) +# case-insensitive matches not supported (ethers; others?) +# may return false-positives (hosts,protocols,rpc,services,ethers) -# Script to replicate the `getent` binary that comes with glibc +export PATH="${PATH}:/bin:/usr/bin" -search_entry() { - if [ -e "$1" ] ; then - /bin/egrep -v "^#" $1 | /bin/sed 's/#.*$//' | /bin/egrep "${string}" | /bin/sed -n 1p - retval=$? - [ "$retval" = 0 ] || retval=2 - else - retval=2 - fi -} - -if [ -z "$1" ] ; then - echo "getent: wrong number of arguments" 1>&2 - exit 1 -fi - file="/etc/$1" -string="dummy" +case $1 in + passwd|group) + match="^$2:\|^[^:]*:[^:]*:$2:" ;; + shadow) + match="^$2:" ;; + networks|netgroup) + match="^[[:space:]]*$2\>" ;; + hosts|protocols|rpc|services|ethers) + match="\<$2\>" ;; + aliases) + match="^[[:space:]]*$2[[:space:]]*:" ;; + ""|-h|--help) + echo "USAGE: $0 database [key]" + exit 0 ;; + *) + echo "$0: Unknown database: $1" 1>&2 + exit 1 ;; +esac if [ ! -f "$file" ] ; then - echo "Unknown database: $1" 1>&2 - exit 1 + echo "$0: Could not find database file for $1" 1>&2 + exit 1 fi -#aliases|ethers|group|hosts|netgroup|networks|passwd|protocols|rpc|services|shadow) -# dns based search is not supported for hosts|networks -# ethers|netgroup (not done, needed)? -# it returns only the first match -case $1 in - passwd) - string="(^\<$2\>:|^.*:.*:\<$2\>:.*:.*:.*:.*)" - ;; - group) - string="(^|:)\<$2\>:" - ;; - shadow) - string="^\<$2\>:" - ;; - aliases) - if [ -f /etc/postfix/aliases ] ; then - file="/etc/postfix/aliases" - elif [ -f /etc/mail/aliases ] ; then - file="/etc/mail/aliases" - fi - string="^\<$2\>:" - ;; - networks) - string="^\<$2\>" - ;; - hosts|protocols|rpc|services) - string="\<$2\>" - ;; - *) - echo "Unknown database: $1" - exit 1 - ;; -esac - -if [ -z "$2" ] ; then - exec cat $file +if [ $# -eq 1 ] ; then + exec cat "$file" else - search_entry "$file" "$2" + sed "s/#.*//; /$match/q; d" "$file" | grep . || exit 2 fi - -exit $retval From bugs at busybox.net Fri Jan 4 23:06:58 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 23:06:58 -0800 Subject: [uClibc 0000938]: getent: minor feature additions and code clean-up Message-ID: The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=938 ====================================================================== Reported By: zen Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 938 Category: New Features Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 07-08-2006 17:08 PDT Last Modified: 01-04-2008 23:06 PST ====================================================================== Summary: getent: minor feature additions and code clean-up Description: I had occasion to look at the uClibc script "getent" and felt compelled to clean out the cargo-cult programming style. I believe that this version is clearer, and I've added some minor features while I was in there: * usage clause, if no arguments or "--help" requested * original version appears to have been intending to "exit 2" on failure to match, but didn't * basic, probably good enough, support for ethers and netgroups * faster ;-) [as if that matters for this script] ====================================================================== ---------------------------------------------------------------------- psm - 07-10-06 02:20 ---------------------------------------------------------------------- Anything you do the script should behave as the getent binary from glibc I don't really see the need for NIS related stuff ---------------------------------------------------------------------- zen - 07-10-06 03:07 ---------------------------------------------------------------------- 1) If the script in uClibc-0.9.28 behaved like that in glibc, then this one does too; if it didn't then this one doesn't either. If you're asking me to fix something that is broken, please be more clear about the request? An example of a feature that behaves differently (or is missing) would be helpful as a starting point. 2) If by "NIS related stuff" you're referring to "ethers and netgroups", that was prompted by a comment in the 0.9.28 file about "not implemented", and my implementation was simply to add those two files to one of the case branches (the one already handling hosts|protocols|rpc|services). Perhaps it'd be strange for someone to have a /etc/netgroups file and want to query it with getent, but the code to (minimally) support it is trivial, so why not? ---------------------------------------------------------------------- psm - 07-10-06 03:20 ---------------------------------------------------------------------- I am the "author" of that file, despite the header part, I have also added the comment about missing features. I originally tried to make the script behave as glibc-2.2.5's, some changes where though later necessary to it (see svn logs) I haven't checked if you took the .28 or svn version as starting point, svn is for sure better (I haven't even compared yet what you did, I commented only on the comments you provided). Ethers and netgroups are not ok iirc by simply adding them to the existing check, I can't recall though why ---------------------------------------------------------------------- zen - 07-10-06 14:00 ---------------------------------------------------------------------- Version: I thought I was taking the .28 version, but it turns out that the Gentoo emerge of uClibc that I'm using actually patches the getent script to align with what is currently at the head of svn (except for the lead-in comment). But... you're critiquing it and you didn't even *look* at it? Really, this was just intended as a _minor_ tweak. Look at the code. Perhaps my commentary made it sound like I am proposing more elaborate changes than I really am. Here is the fragment that most offended me in the original: /bin/egrep -v "^#" $1 | /bin/sed 's/#.*$//' | /bin/egrep "${string}" | /bin/sed -n 1p That is just silly. First off, there is a bug in that retval is set based on the $? of that line, which will always be zero unless something is very broken (like /bin/sed missing), but it is clear that the intent is that if the entry is not found that retval should be 2. Second off, it is just clumsy. Here is my rewrite: /bin/sed "s/#.*//; /$match/q; d" "$file" | grep . (the grep here is just to detect a non-match). The $match (formerly ${string}) expression looks a little different; this is accounted for in the attached code. While I was "fixing" that, I also adressed the fact that the code had several redundant and/or extraneous conditionals. The new code is much more straightforward. And all of this discussion is more verbose and less clear than the code itself. What I'm hearing so far is this: 1) instead of deleting the comment about "ethers|netgroup (not done, needed)?" I should instead change it to "ethers|netgroup (not completely correct)" (okay, sure, that makes sense) 2) for you to consider looking at the code I should research what exactly glibc does with *its* getent, and add at least some of the missing functionality/compatabilty to this lightweight script, without any hints about what is considered broken with the existing implementation (surely this isn't right?) ---------------------------------------------------------------------- psm - 07-10-06 14:18 ---------------------------------------------------------------------- I finally looked at what you did and the only "requirement" it should fullfil: work with busybox ash (maybe msh) as shell and busybox's implementation of sed/grep ---------------------------------------------------------------------- psm - 07-10-06 14:35 ---------------------------------------------------------------------- networks fails ---------------------------------------------------------------------- psm - 07-10-06 15:17 ---------------------------------------------------------------------- could you explain why you removed \< \> ? ---------------------------------------------------------------------- zen - 07-10-06 18:19 ---------------------------------------------------------------------- networks: oops -- I obviously didn't read the original code properly (and never personally use the file), and thought matches looked like shadow (with the trailing ":"); fixed in new version (attached). I also note that the netgroup file is keyed in the same format, so moved its case-match entry. \< \> -- for the most part their use was redundant: for a properly keyed database file, $foo\>: and $foo: will always match the same thing, and similarly for ^\<$foo and ^$foo (because for real keys $foo is all "word" characters, and neither ^ nor : match as word characters). I find the extra metacharacters distracting; YMMV. For passwd,group I tightened up the matching patterns to only match in the username and [ug]id fields; for aliases (and now networks and netgroup) I've loosened the pattern to allow whitespace surrounding the key. compatability: Tested in a busybox-only environment. While my version does demand more of sed's RE engine (which busybox sed handles fine), my version uses fewer features of the shell than the original, so it should work with any of the targeted shells. I note that I happened to use "grep" intead of "egrep" for no particular reason; if egrep is preferred for any reason, use that. ---------------------------------------------------------------------- vapier - 01-04-08 23:06 ---------------------------------------------------------------------- i made a few tweaks (like removing the hard coded paths and tweaking style), but otherwise committed the new version thanks! Issue History Date Modified Username Field Change ====================================================================== 07-08-06 17:08 zen New Issue 07-08-06 17:08 zen Status new => assigned 07-08-06 17:08 zen Assigned To => uClibc 07-08-06 17:08 zen File Added: getent 07-10-06 02:20 psm Note Added: 0001505 07-10-06 03:06 zen Note Added: 0001506 07-10-06 03:07 zen Note Edited: 0001506 07-10-06 03:20 psm Note Added: 0001507 07-10-06 14:00 zen Note Added: 0001509 07-10-06 14:18 psm Note Added: 0001510 07-10-06 14:35 psm Note Added: 0001511 07-10-06 15:17 psm Note Added: 0001513 07-10-06 18:19 zen Note Added: 0001514 07-10-06 18:21 zen Issue Monitored: zen 07-10-06 18:21 zen Issue End Monitor: zen 07-10-06 18:23 zen File Added: getent-v2 01-04-08 23:06 vapier Note Added: 0003404 01-04-08 23:06 vapier Status assigned => closed 01-04-08 23:06 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Jan 4 23:16:35 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 23:16:35 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/misc/syslog Message-ID: <20080105071635.CA5F512009E@busybox.net> Author: vapier Date: 2008-01-04 23:16:35 -0800 (Fri, 04 Jan 2008) New Revision: 20718 Log: krichy writes in 292: I noticed, that in libc/misc/syslog/syslog.c when the syslog socket is opened, the close-on-exec flag is not set, as it is in gnu libc. This enables that behavior. Modified: trunk/uClibc/libc/misc/syslog/syslog.c Changeset: Modified: trunk/uClibc/libc/misc/syslog/syslog.c =================================================================== --- trunk/uClibc/libc/misc/syslog/syslog.c 2008-01-05 07:06:08 UTC (rev 20717) +++ trunk/uClibc/libc/misc/syslog/syslog.c 2008-01-05 07:16:35 UTC (rev 20718) @@ -165,7 +165,7 @@ if ((LogFile = socket(AF_UNIX, logType, 0)) == -1) { goto DONE; } - /* fcntl(LogFile, F_SETFD, 1); */ + fcntl(LogFile, F_SETFD, 1); } } From bugs at busybox.net Fri Jan 4 23:16:54 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 23:16:54 -0800 Subject: [uClibc 0000292]: syslog socket close-on-exec flag Message-ID: The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=292 ====================================================================== Reported By: krichy Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 292 Category: Standards Compliance Reproducibility: always Severity: feature Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 06-06-2005 01:56 PDT Last Modified: 01-04-2008 23:16 PST ====================================================================== Summary: syslog socket close-on-exec flag Description: I noticed, that in libc/misc/syslog/syslog.c when the syslog socket is opened, the close-on-exec flag is not set, as it is in gnu libc. I think that is a minor bug only, but i would like to know the reasons why it is that way? ====================================================================== ---------------------------------------------------------------------- vapier - 01-04-08 23:16 ---------------------------------------------------------------------- current svn trunk now enables close-on-exec Issue History Date Modified Username Field Change ====================================================================== 06-06-05 01:56 krichy New Issue 01-04-08 23:16 vapier Note Added: 0003409 01-04-08 23:16 vapier Status assigned => closed 01-04-08 23:16 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Fri Jan 4 23:18:36 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Fri, 4 Jan 2008 23:18:36 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/misc/syslog Message-ID: <20080105071836.024A012009E@busybox.net> Author: vapier Date: 2008-01-04 23:18:36 -0800 (Fri, 04 Jan 2008) New Revision: 20719 Log: blah, enable the stupid hidden proto for fcntl Modified: trunk/uClibc/libc/misc/syslog/syslog.c Changeset: Modified: trunk/uClibc/libc/misc/syslog/syslog.c =================================================================== --- trunk/uClibc/libc/misc/syslog/syslog.c 2008-01-05 07:16:35 UTC (rev 20718) +++ trunk/uClibc/libc/misc/syslog/syslog.c 2008-01-05 07:18:36 UTC (rev 20719) @@ -91,7 +91,7 @@ libc_hidden_proto(strlen) libc_hidden_proto(strncpy) libc_hidden_proto(open) -/*libc_hidden_proto(fcntl)*/ +libc_hidden_proto(fcntl) libc_hidden_proto(socket) libc_hidden_proto(close) libc_hidden_proto(write) From bugs at busybox.net Fri Jan 4 23:21:51 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 4 Jan 2008 23:21:51 -0800 Subject: [uClibc 0000936]: arm920t build fails due to gcc not allowing `bx` Message-ID: <5a76f83de8af4012b9bae987002427a0@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=936 ====================================================================== Reported By: bjdooks Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 936 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: closed Resolution: fixed Fixed in Version: ====================================================================== Date Submitted: 07-07-2006 07:22 PDT Last Modified: 01-04-2008 23:21 PST ====================================================================== Summary: arm920t build fails due to gcc not allowing `bx` Description: selecting arm920t in buildroot and allowing uClibc to use BX causes the compiler to fail to build ldso.sO with the error that BX is not supported by the processor. The fix is to change ARM920T to -march=armv4t (armv4 with thumb) as this is the correct mode for any ARM9 cpu with the T suffix. affixed is a patch to change -march=armv4 to -march=armv4t for ARM920T and ARM922T. ====================================================================== ---------------------------------------------------------------------- shc - 09-11-06 00:09 ---------------------------------------------------------------------- This bug also applies to ARM720T arch. Fixed when changing to -march=armv4t for ARM720T. ---------------------------------------------------------------------- vapier - 01-04-08 23:21 ---------------------------------------------------------------------- this should be fixed in current svn Issue History Date Modified Username Field Change ====================================================================== 07-07-06 07:22 bjdooks New Issue 07-07-06 07:22 bjdooks Status new => assigned 07-07-06 07:22 bjdooks Assigned To => uClibc 07-07-06 07:22 bjdooks File Added: uclibc-arm-thumb.patch 09-11-06 00:09 shc Note Added: 0001631 10-09-06 12:22 jruere Issue Monitored: jruere 01-04-08 23:21 vapier Note Added: 0003414 01-04-08 23:21 vapier Status assigned => closed 01-04-08 23:21 vapier Resolution open => fixed ====================================================================== From vapier at uclibc.org Sat Jan 5 00:00:34 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 00:00:34 -0800 (PST) Subject: svn commit: trunk/uClibc/ldso/include Message-ID: <20080105080034.29BA41200FD@busybox.net> Author: vapier Date: 2008-01-05 00:00:33 -0800 (Sat, 05 Jan 2008) New Revision: 20720 Log: whitespace only: fix indentation Modified: trunk/uClibc/ldso/include/dl-string.h Changeset: Modified: trunk/uClibc/ldso/include/dl-string.h =================================================================== --- trunk/uClibc/ldso/include/dl-string.h 2008-01-05 07:18:36 UTC (rev 20719) +++ trunk/uClibc/ldso/include/dl-string.h 2008-01-05 08:00:33 UTC (rev 20720) @@ -286,7 +286,7 @@ * This requires that load_addr must already be defined... */ #if defined(mc68000) || defined(__arm__) || defined(__thumb__) || \ defined(__mips__) || defined(__sh__) || defined(__powerpc__) || \ - defined(__avr32__) + defined(__avr32__) # define CONSTANT_STRING_GOT_FIXUP(X) \ if ((X) < (const char *) load_addr) (X) += load_addr # define NO_EARLY_SEND_STDERR From vapier at uclibc.org Sat Jan 5 00:08:26 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 00:08:26 -0800 (PST) Subject: svn commit: trunk/uClibc/extra/Configs Message-ID: <20080105080826.D2BB512C53A@busybox.net> Author: vapier Date: 2008-01-05 00:08:26 -0800 (Sat, 05 Jan 2008) New Revision: 20721 Log: not everyone is a ninja: explicitly state that people should convert from sys_errlist[] to strerror() Modified: trunk/uClibc/extra/Configs/Config.in Changeset: Modified: trunk/uClibc/extra/Configs/Config.in =================================================================== --- trunk/uClibc/extra/Configs/Config.in 2008-01-05 08:00:33 UTC (rev 20720) +++ trunk/uClibc/extra/Configs/Config.in 2008-01-05 08:08:26 UTC (rev 20721) @@ -1115,6 +1115,8 @@ Most people will answer N. + Application writers: use the strerror(3) function. + config UCLIBC_HAS_SIGNUM_MESSAGES bool "Include the signum message text in the library" default y From vapier at uclibc.org Sat Jan 5 00:16:23 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 00:16:23 -0800 (PST) Subject: svn commit: trunk/uClibc/libm Message-ID: <20080105081623.6E0A012C4BA@busybox.net> Author: vapier Date: 2008-01-05 00:16:23 -0800 (Sat, 05 Jan 2008) New Revision: 20722 Log: Brian Austin writes: This patch adds MAVERICK CRUNCH FPU support for the Cirrus Logic EP93XX ARM9 Procs. Modified: trunk/uClibc/libm/math_private.h Changeset: Modified: trunk/uClibc/libm/math_private.h =================================================================== --- trunk/uClibc/libm/math_private.h 2008-01-05 08:08:26 UTC (rev 20721) +++ trunk/uClibc/libm/math_private.h 2008-01-05 08:16:23 UTC (rev 20722) @@ -35,13 +35,14 @@ ints. */ /* - * Math on arm is special: + * Math on arm is special (read: stupid): * For FPA, float words are always big-endian. - * For VFP, floats words follow the memory system mode. + * For VFP, float words follow the memory system mode. + * For Maverick, float words are always little-endian. */ -#if (__BYTE_ORDER == __BIG_ENDIAN) || \ - (!defined(__VFP_FP__) && (defined(__arm__) || defined(__thumb__))) +#if !defined(__MAVERICK__) && ((__BYTE_ORDER == __BIG_ENDIAN) || \ + (!defined(__VFP_FP__) && (defined(__arm__) || defined(__thumb__)))) typedef union { From vapier at uclibc.org Sat Jan 5 00:34:39 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 00:34:39 -0800 (PST) Subject: svn commit: trunk/uClibc/include Message-ID: <20080105083439.1483E120119@busybox.net> Author: vapier Date: 2008-01-05 00:34:38 -0800 (Sat, 05 Jan 2008) New Revision: 20723 Log: give EM_AVR32 a little comment Modified: trunk/uClibc/include/elf.h Changeset: Modified: trunk/uClibc/include/elf.h =================================================================== --- trunk/uClibc/include/elf.h 2008-01-05 08:16:23 UTC (rev 20722) +++ trunk/uClibc/include/elf.h 2008-01-05 08:34:38 UTC (rev 20723) @@ -354,6 +354,7 @@ /* NIOS magic number - no EABI available. */ #define EM_NIOS32 0xFEBB +/* AVR32 magic number from ATMEL */ #define EM_AVR32 0x18ad /* V850 backend magic number. Written in the absense of an ABI. */ From vapier at uclibc.org Sat Jan 5 00:59:10 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 00:59:10 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/common/bits Message-ID: <20080105085910.217891200FD@busybox.net> Author: vapier Date: 2008-01-05 00:59:09 -0800 (Sat, 05 Jan 2008) New Revision: 20724 Log: add BOTHER define from termios2 Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/termios.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/termios.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/bits/termios.h 2008-01-05 08:34:38 UTC (rev 20723) +++ trunk/uClibc/libc/sysdeps/linux/common/bits/termios.h 2008-01-05 08:59:09 UTC (rev 20724) @@ -154,6 +154,7 @@ #ifdef __USE_MISC # define CBAUDEX 0010000 #endif +#define BOTHER 0010000 #define B57600 0010001 #define B115200 0010002 #define B230400 0010003 From vapier at uclibc.org Sat Jan 5 01:22:59 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 01:22:59 -0800 (PST) Subject: svn commit: trunk/uClibc/test/string Message-ID: <20080105092259.37F9D1200FD@busybox.net> Author: vapier Date: 2008-01-05 01:22:58 -0800 (Sat, 05 Jan 2008) New Revision: 20725 Log: patch from Mats Erik Andersson for better catching edge cases in optimized string functions Modified: trunk/uClibc/test/string/tester.c Changeset: Modified: trunk/uClibc/test/string/tester.c =================================================================== --- trunk/uClibc/test/string/tester.c 2008-01-05 08:59:09 UTC (rev 20724) +++ trunk/uClibc/test/string/tester.c 2008-01-05 09:22:58 UTC (rev 20725) @@ -1087,15 +1087,31 @@ static void test_memcmp (void) { + int i, cnt = 1; + char one[21], two[21]; + it = "memcmp"; - check(memcmp("a", "a", 1) == 0, 1); /* Identity. */ - check(memcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */ - check(memcmp("abcd", "abce", 4) < 0, 3); /* Honestly unequal. */ - check(memcmp("abce", "abcd", 4) > 0, 4); - check(memcmp("alph", "beta", 4) < 0, 5); - check(memcmp("a\203", "a\003", 2) > 0, 6); - check(memcmp("abce", "abcd", 3) == 0, 7); /* Count limited. */ - check(memcmp("abc", "def", 0) == 0, 8); /* Zero count. */ + check(memcmp("a", "a", 1) == 0, cnt++); /* Identity. */ + check(memcmp("abc", "abc", 3) == 0, cnt++); /* Multicharacter. */ + check(memcmp("abcd", "abcf", 4) < 0, cnt++); /* Honestly unequal. */ + check(memcmp("abcf", "abcd", 4) > 0, cnt++); + check(memcmp("alph", "cold", 4) < 0, cnt++); + check(memcmp("a\203", "a\003", 2) > 0, cnt++); + check(memcmp("a\003", "a\203", 2) < 0, cnt++); + check(memcmp("a\003bc", "a\203bc", 2) < 0, cnt++); + check(memcmp("abc\203", "abc\003", 4) > 0, cnt++); + check(memcmp("abc\003", "abc\203", 4) < 0, cnt++); + check(memcmp("abcf", "abcd", 3) == 0, cnt++); /* Count limited. */ + check(memcmp("abc", "def", 0) == 0, cnt++); /* Zero count. */ + /* Comparisons with shifting 4-byte boundaries. */ + for (i=0; i<4; i++) + { + char *a = one + i, *b = two + i; + strncpy( a, "--------11112222", 16); + strncpy( b, "--------33334444", 16); + check( memcmp(b, a, 16) > 0, cnt++); + check( memcmp(a, b, 16) < 0, cnt++); + } } static void From vapier at uclibc.org Sat Jan 5 01:24:46 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 01:24:46 -0800 (PST) Subject: svn commit: trunk/uClibc: libc/sysdeps/linux/arm libc/sysdeps/linu etc... Message-ID: <20080105092446.0E1A01200FD@busybox.net> Author: vapier Date: 2008-01-05 01:24:45 -0800 (Sat, 05 Jan 2008) New Revision: 20726 Log: whitespace only: touchups from Hans-Christian Egtvedt Modified: trunk/uClibc/libc/sysdeps/linux/arm/sigrestorer.S trunk/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h trunk/uClibc/libcrypt/md5.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/arm/sigrestorer.S =================================================================== --- trunk/uClibc/libc/sysdeps/linux/arm/sigrestorer.S 2008-01-05 09:22:58 UTC (rev 20725) +++ trunk/uClibc/libc/sysdeps/linux/arm/sigrestorer.S 2008-01-05 09:24:45 UTC (rev 20726) @@ -18,7 +18,7 @@ #include #include - + /* If no SA_RESTORER function was specified by the application we use one of these. This avoids the need for the kernel to synthesise a return instruction on the stack, which would involve expensive cache flushes. Modified: trunk/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h 2008-01-05 09:22:58 UTC (rev 20725) +++ trunk/uClibc/libc/sysdeps/linux/sh/sys/ucontext.h 2008-01-05 09:24:45 UTC (rev 20726) @@ -88,7 +88,7 @@ typedef struct { unsigned int oldmask; - + /* CPU registers */ gregset_t gregs; unsigned int pc; @@ -105,7 +105,7 @@ unsigned int fpscr; unsigned int fpul; unsigned int ownedfp; -#endif +#endif } mcontext_t; /* Userlevel context. */ Modified: trunk/uClibc/libcrypt/md5.c =================================================================== --- trunk/uClibc/libcrypt/md5.c 2008-01-05 09:22:58 UTC (rev 20725) +++ trunk/uClibc/libcrypt/md5.c 2008-01-05 09:24:45 UTC (rev 20726) @@ -28,8 +28,8 @@ * edited for clarity and style only. * * ---------------------------------------------------------------------------- - * The md5_crypt() function was taken from freeBSD's libcrypt and contains - * this license: + * The md5_crypt() function was taken from freeBSD's libcrypt and contains + * this license: * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think @@ -38,7 +38,7 @@ * $FreeBSD: src/lib/libcrypt/crypt.c,v 1.7.2.1 1999/08/29 14:56:33 peter Exp $ * * ---------------------------------------------------------------------------- - * On April 19th, 2001 md5_crypt() was modified to make it reentrant + * On April 19th, 2001 md5_crypt() was modified to make it reentrant * by Erik Andersen * * @@ -99,7 +99,7 @@ #define MD5_MAGIC_STR "$1$" #define MD5_MAGIC_LEN (sizeof(MD5_MAGIC_STR) - 1) static const unsigned char __md5__magic[] = MD5_MAGIC_STR; - /* This string is magic for this algorithm. Having + /* This string is magic for this algorithm. Having it this way, we can get better later on */ static const unsigned char __md5_itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; @@ -333,7 +333,7 @@ __md5_Decode (x, block, 64); - a = state[0]; b = state[1]; c = state[2]; d = state[3]; + a = state[0]; b = state[1]; c = state[2]; d = state[3]; #if MD5_SIZE_OVER_SPEED > 2 pc = C; pp = P; ps = S - 4; From vapier at uclibc.org Sat Jan 5 01:27:38 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 01:27:38 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/stdio Message-ID: <20080105092738.1FB591200FD@busybox.net> Author: vapier Date: 2008-01-05 01:27:37 -0800 (Sat, 05 Jan 2008) New Revision: 20727 Log: patch from Hans-Christian Egtvedt to silence some spurious signed warnings Modified: trunk/uClibc/libc/stdio/_scanf.c trunk/uClibc/libc/stdio/_vfprintf.c trunk/uClibc/libc/stdio/vsnprintf.c Changeset: Modified: trunk/uClibc/libc/stdio/_scanf.c =================================================================== --- trunk/uClibc/libc/stdio/_scanf.c 2008-01-05 09:24:45 UTC (rev 20726) +++ trunk/uClibc/libc/stdio/_scanf.c 2008-01-05 09:27:37 UTC (rev 20727) @@ -731,7 +731,7 @@ sc->decpt = __UCLIBC_CURLOCALE_DATA.decimal_point; sc->decpt_len = __UCLIBC_CURLOCALE_DATA.decimal_point_len; #else /* __UCLIBC_HAS_LOCALE__ */ - sc->fake_decpt = sc->decpt = decpt_str; + sc->fake_decpt = sc->decpt = (unsigned char *) decpt_str; sc->decpt_len = 1; #endif /* __UCLIBC_HAS_LOCALE__ */ #ifdef __UCLIBC_HAS_WCHAR__ @@ -2087,7 +2087,7 @@ } ++psfs->cnt; _store_inttype(psfs->cur_ptr, psfs->dataargtype, - (uintmax_t) STRTOUIM(buf, NULL, base, 1-usflag)); + (uintmax_t) STRTOUIM((char *) buf, NULL, base, 1-usflag)); } return 0; } @@ -2101,7 +2101,7 @@ p = sc->fake_decpt; do { if (!*p) { - strcpy(b, sc->decpt); + strcpy((char *) b, (char *) sc->decpt); b += sc->decpt_len; break; } @@ -2236,7 +2236,7 @@ { __fpmax_t x; char *e; - x = __strtofpmax(buf, &e, exp_adjust); + x = __strtofpmax((char *) buf, &e, exp_adjust); assert(!*e); if (psfs->store) { if (psfs->dataargtype & PA_FLAG_LONG_LONG) { Modified: trunk/uClibc/libc/stdio/_vfprintf.c =================================================================== --- trunk/uClibc/libc/stdio/_vfprintf.c 2008-01-05 09:24:45 UTC (rev 20726) +++ trunk/uClibc/libc/stdio/_vfprintf.c 2008-01-05 09:27:37 UTC (rev 20727) @@ -1427,7 +1427,7 @@ FMT_TYPE pad[1]; *pad = padchar; - while (todo && (OUTNSTR(stream, pad, 1) == 1)) { + while (todo && (OUTNSTR(stream, (const unsigned char *) pad, 1) == 1)) { --todo; } @@ -1831,7 +1831,7 @@ } } #else /* __UCLIBC_HAS_WCHAR__ */ - if (_outnstr(stream, s, slen) != slen) { + if (_outnstr(stream, (const unsigned char *) s, slen) != slen) { return -1; } #endif /* __UCLIBC_HAS_WCHAR__ */ @@ -1886,7 +1886,7 @@ { count = -1; } else if (_PPFS_init(&ppfs, format) < 0) { /* Bad format string. */ - OUTNSTR(stream, (const FMT_TYPE *) ppfs.fmtpos, + OUTNSTR(stream, (const unsigned char *) ppfs.fmtpos, STRLEN((const FMT_TYPE *)(ppfs.fmtpos))); #if defined(L_vfprintf) && !defined(NDEBUG) fprintf(stderr,"\nIMbS: \"%s\"\n\n", format); @@ -1901,7 +1901,7 @@ } if (format-s) { /* output any literal text in format string */ - if ( (r = OUTNSTR(stream, s, format-s)) != (format-s)) { + if ( (r = OUTNSTR(stream, (const unsigned char *) s, format-s)) != (format-s)) { count = -1; break; } Modified: trunk/uClibc/libc/stdio/vsnprintf.c =================================================================== --- trunk/uClibc/libc/stdio/vsnprintf.c 2008-01-05 09:24:45 UTC (rev 20726) +++ trunk/uClibc/libc/stdio/vsnprintf.c 2008-01-05 09:27:37 UTC (rev 20727) @@ -55,8 +55,8 @@ /* Set these last since __bufputc initialization depends on * __user_locking and only gets set if user locking is on. */ - f.__bufstart = buf; - f.__bufend = buf + size; + f.__bufstart = (unsigned char *) buf; + f.__bufend = (unsigned char *) buf + size; __STDIO_STREAM_INIT_BUFREAD_BUFPOS(&f); __STDIO_STREAM_DISABLE_GETC(&f); __STDIO_STREAM_ENABLE_PUTC(&f); From vapier at uclibc.org Sat Jan 5 02:05:28 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 02:05:28 -0800 (PST) Subject: svn commit: trunk/uClibc: extra/Configs include ldso/include ldso etc... Message-ID: <20080105100528.570011200FD@busybox.net> Author: vapier Date: 2008-01-05 02:05:27 -0800 (Sat, 05 Jan 2008) New Revision: 20728 Log: Chris Zankel writes: The following patches add support for the Xtensa processor architecture to uClibc. They are based on a recent SVN checkout (12/05/2007). The first patch (attached to this post) adds Xtensa support to various shared configuration and make files. The following patches then include the Xtensa specific files and directories. I welcome any feedback and would appreciate it if you could include the patches into the mainline tree. I am certainly committed to maintain the port. Bob Wilson was kind enough to review the patches. Some notes about the architecture: Xtensa is a configurable and extensible processor architecture developed by Tensilica. For more information, please visit: www.linux-xtensa.org. Added: trunk/uClibc/extra/Configs/Config.xtensa trunk/uClibc/ldso/ldso/xtensa/ trunk/uClibc/ldso/ldso/xtensa/dl-debug.h trunk/uClibc/ldso/ldso/xtensa/dl-startup.h trunk/uClibc/ldso/ldso/xtensa/dl-syscalls.h trunk/uClibc/ldso/ldso/xtensa/dl-sysdep.h trunk/uClibc/ldso/ldso/xtensa/elfinterp.c trunk/uClibc/ldso/ldso/xtensa/resolve.S trunk/uClibc/libc/string/xtensa/ trunk/uClibc/libc/string/xtensa/Makefile trunk/uClibc/libc/string/xtensa/memcpy.S trunk/uClibc/libc/string/xtensa/memset.S trunk/uClibc/libc/string/xtensa/strcmp.S trunk/uClibc/libc/string/xtensa/strcpy.S trunk/uClibc/libc/string/xtensa/strlen.S trunk/uClibc/libc/string/xtensa/strncpy.S trunk/uClibc/libc/sysdeps/linux/xtensa/ trunk/uClibc/libc/sysdeps/linux/xtensa/Makefile trunk/uClibc/libc/sysdeps/linux/xtensa/Makefile.arch trunk/uClibc/libc/sysdeps/linux/xtensa/__longjmp.S trunk/uClibc/libc/sysdeps/linux/xtensa/__syscall_error.c trunk/uClibc/libc/sysdeps/linux/xtensa/bits/ trunk/uClibc/libc/sysdeps/linux/xtensa/bits/endian.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/fcntl.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/ipc.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/kernel_types.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/mathdef.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/mman.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/msq.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/setjmp.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/shm.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/sigcontextinfo.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/stackinfo.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/stat.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/syscalls.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_arch_features.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/uClibc_page.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/wordsize.h trunk/uClibc/libc/sysdeps/linux/xtensa/bits/xtensa-config.h trunk/uClibc/libc/sysdeps/linux/xtensa/brk.c trunk/uClibc/libc/sysdeps/linux/xtensa/bsd-_setjmp.S trunk/uClibc/libc/sysdeps/linux/xtensa/bsd-setjmp.S trunk/uClibc/libc/sysdeps/linux/xtensa/clone.S trunk/uClibc/libc/sysdeps/linux/xtensa/crt1.S trunk/uClibc/libc/sysdeps/linux/xtensa/crti.S trunk/uClibc/libc/sysdeps/linux/xtensa/crtn.S trunk/uClibc/libc/sysdeps/linux/xtensa/fork.c trunk/uClibc/libc/sysdeps/linux/xtensa/mmap.S trunk/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise.c trunk/uClibc/libc/sysdeps/linux/xtensa/posix_fadvise64.c trunk/uClibc/libc/sysdeps/linux/xtensa/pread_write.c trunk/uClibc/libc/sysdeps/linux/xtensa/setjmp.S trunk/uClibc/libc/sysdeps/linux/xtensa/sys/ trunk/uClibc/libc/sysdeps/linux/xtensa/sys/procfs.h trunk/uClibc/libc/sysdeps/linux/xtensa/sys/ptrace.h trunk/uClibc/libc/sysdeps/linux/xtensa/sys/ucontext.h trunk/uClibc/libc/sysdeps/linux/xtensa/syscall.S trunk/uClibc/libc/sysdeps/linux/xtensa/sysdep.h trunk/uClibc/libc/sysdeps/linux/xtensa/vfork.S trunk/uClibc/libc/sysdeps/linux/xtensa/windowspill.S trunk/uClibc/libpthread/linuxthreads.old/sysdeps/xtensa/ trunk/uClibc/libpthread/linuxthreads.old/sysdeps/xtensa/pt-machine.h Modified: trunk/uClibc/Rules.mak trunk/uClibc/extra/Configs/Config.in trunk/uClibc/include/elf.h trunk/uClibc/ldso/include/dl-string.h trunk/uClibc/test/Rules.mak Changeset: Sorry, the patch is too large to include (5465 lines). Please use ViewCVS to see it! http://uclibc.org/cgi-bin/viewcvs.cgi?view=rev&root=svn&rev=20728 From vapier at uclibc.org Sat Jan 5 02:40:03 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 02:40:03 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux: bfin common Message-ID: <20080105104003.5C14712C56F@busybox.net> Author: vapier Date: 2008-01-05 02:40:03 -0800 (Sat, 05 Jan 2008) New Revision: 20729 Log: if an arch does not provide __NR_mmap, fall back to __NR_mmap2 (this just generalizes what Blackfin was already doing) Removed: trunk/uClibc/libc/sysdeps/linux/bfin/mmap.c Modified: trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch trunk/uClibc/libc/sysdeps/linux/common/mmap.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch =================================================================== --- trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch 2008-01-05 10:05:27 UTC (rev 20728) +++ trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch 2008-01-05 10:40:03 UTC (rev 20729) @@ -5,7 +5,7 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC := brk.c bsdsetjmp.c clone.c syscall.c mmap.c +CSRC := brk.c bsdsetjmp.c clone.c syscall.c SSRC := __longjmp.S setjmp.S bsd-_setjmp.S vfork.S Deleted: trunk/uClibc/libc/sysdeps/linux/bfin/mmap.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/bfin/mmap.c 2008-01-05 10:05:27 UTC (rev 20728) +++ trunk/uClibc/libc/sysdeps/linux/bfin/mmap.c 2008-01-05 10:40:03 UTC (rev 20729) @@ -1,24 +0,0 @@ -/* Use new style mmap for bfin */ - -#include -#include -#include -#include -#include - -#define __NR___syscall_mmap2 __NR_mmap2 -inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, - size_t, len, int, prot, int, flags, int, fd, off_t, offset); - -libc_hidden_proto(mmap) - -__ptr_t mmap(__ptr_t addr, size_t len, int prot, - int flags, int fd, __off_t offset) -{ - if (offset & ~PAGE_MASK) { - return NULL; - } - return __syscall_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); -} - -libc_hidden_def(mmap) Modified: trunk/uClibc/libc/sysdeps/linux/common/mmap.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/mmap.c 2008-01-05 10:05:27 UTC (rev 20728) +++ trunk/uClibc/libc/sysdeps/linux/common/mmap.c 2008-01-05 10:40:03 UTC (rev 20729) @@ -10,6 +10,7 @@ #include #include #include +#include #ifdef __NR_mmap @@ -41,4 +42,32 @@ #endif libc_hidden_def(mmap) + +#elif defined(__NR_mmap2) + +libc_hidden_proto(mmap) + +#define __NR___syscall_mmap2 __NR_mmap2 +static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, + size_t, len, int, prot, int, flags, int, fd, off_t, offset); + +/* Some architectures always use 12 as page shift for mmap2() eventhough the + * real PAGE_SHIFT != 12. Other architectures use the same value as + * PAGE_SHIFT... + */ +# ifndef MMAP2_PAGE_SHIFT +# define MMAP2_PAGE_SHIFT 12 +# endif + +__ptr_t mmap(__ptr_t addr, size_t len, int prot, int flags, int fd, __off_t offset) +{ + if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) { + __set_errno(EINVAL); + return MAP_FAILED; + } + return __syscall_mmap2(addr, len, prot, flags, fd, offset >> MMAP2_PAGE_SHIFT); +} + +libc_hidden_def(mmap) + #endif From vapier at uclibc.org Sat Jan 5 02:40:51 2008 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 5 Jan 2008 02:40:51 -0800 (PST) Subject: svn commit: trunk/uClibc Message-ID: <20080105104051.39B8812C570@busybox.net> Author: vapier Date: 2008-01-05 02:40:51 -0800 (Sat, 05 Jan 2008) New Revision: 20730 Log: update my e-mail address Modified: trunk/uClibc/MAINTAINERS Changeset: Modified: trunk/uClibc/MAINTAINERS =================================================================== --- trunk/uClibc/MAINTAINERS 2008-01-05 10:40:03 UTC (rev 20729) +++ trunk/uClibc/MAINTAINERS 2008-01-05 10:40:51 UTC (rev 20730) @@ -34,8 +34,8 @@ BFIN N: Mike Frysinger -E: michael.frysinger at analog.com -W: http://blackfin.uclinux.org +E: vapier.adi at gmail.com +W: http://blackfin.uclinux.org/ S: Maintained From aldot at uclibc.org Sat Jan 5 03:24:00 2008 From: aldot at uclibc.org (aldot at uclibc.org) Date: Sat, 5 Jan 2008 03:24:00 -0800 (PST) Subject: svn commit: trunk/uClibc/libpthread: linuxthreads linuxthreads/sysdeps/alpha etc... Message-ID: <20080105112400.0620712C4BE@busybox.net> Author: aldot Date: 2008-01-05 03:24:00 -0800 (Sat, 05 Jan 2008) New Revision: 20731 Log: - fixup gnu_inline vs. C99 inline - add missing header guards while at it Modified: trunk/uClibc/libpthread/linuxthreads.old/sysdeps/alpha/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/bfin/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/frv/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/h8300/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/i386/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/ia64/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/m68k/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/mips/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/nios/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/nios2/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/powerpc/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/sh/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/v850/pt-machine.h trunk/uClibc/libpthread/linuxthreads.old/sysdeps/x86_64/pt-machine.h trunk/uClibc/libpthread/linuxthreads/internals.h trunk/uClibc/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/arm/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/cris/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/i386/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/mips/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/sh/pt-machine.h trunk/uClibc/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h Changeset: Modified: trunk/uClibc/libpthread/linuxthreads/internals.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/internals.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/internals.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -531,9 +531,9 @@ # define __manager_thread __pthread_manager_threadp #endif -extern __always_inline pthread_descr +static __always_inline pthread_descr check_thread_self (void); -extern __always_inline pthread_descr +static __always_inline pthread_descr check_thread_self (void) { pthread_descr self = thread_self (); Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/alpha/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -23,8 +23,14 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif #ifdef __linux__ @@ -33,9 +39,6 @@ # include #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ #define CURRENT_STACK_FRAME stack_pointer Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/arm/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/arm/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/arm/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -22,13 +22,16 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* This will not work on ARM1 or ARM2 because SWP is lacking on those machines. Unfortunately we have no way to detect this at compile time; let's hope nobody tries to use one. */ Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/avr32/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -11,6 +11,14 @@ #include +#ifndef PT_EI +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif +#endif + static inline int _test_and_set (int *p, int v) __THROW { @@ -26,10 +34,6 @@ return result; } -#ifndef PT_EI -# define PT_EI extern inline -#endif - extern long int testandset (int *spinlock); extern int __compare_and_swap (long int *p, long int oldval, long int newval); Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/cris/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/cris/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/cris/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -21,13 +21,16 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - PT_EI long int testandset (int *spinlock) { Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/hppa/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -22,15 +22,17 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include #include #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ #define CURRENT_STACK_FRAME stack_pointer Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/i386/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/i386/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/i386/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -29,12 +29,17 @@ #ifndef __ASSEMBLER__ #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif +/* extern long int testandset (int *spinlock); extern int __compare_and_swap (long int *p, long int oldval, long int newval); - +*/ /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ #define CURRENT_STACK_FRAME __builtin_frame_address (0) Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -21,15 +21,17 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include #include #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Make sure gcc doesn't try to be clever and move things around on us. We need to use _exactly_ the address the user gave us, not some alias that contains the same information. */ Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/m68k/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -22,13 +22,16 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Spinlock implementation; required. */ PT_EI long int testandset (int *spinlock) Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/mips/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/mips/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/mips/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -24,17 +24,18 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include #include #include #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - - /* Spinlock implementation; required. */ PT_EI long int Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/sh/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/sh/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/sh/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -22,14 +22,17 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef __ASSEMBLER__ #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Spinlock implementation; required. */ PT_EI long int testandset (int *spinlock) Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads/sysdeps/x86_64/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -21,6 +21,8 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +# include + #ifndef __ASSEMBLER__ # include /* For offsetof. */ # include /* For abort(). */ @@ -28,12 +30,13 @@ # ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif # endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ # define CURRENT_STACK_FRAME stack_pointer Modified: trunk/uClibc/libpthread/linuxthreads.old/sysdeps/alpha/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/sysdeps/alpha/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads.old/sysdeps/alpha/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -23,8 +23,14 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif #ifdef __linux__ @@ -33,9 +39,6 @@ # include #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* Get some notion of the current stack. Need not be exactly the top of the stack, just something somewhere in the current frame. */ #define CURRENT_STACK_FRAME stack_pointer Modified: trunk/uClibc/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads.old/sysdeps/arm/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -22,13 +22,16 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif -extern long int testandset (int *spinlock); -extern int __compare_and_swap (long int *p, long int oldval, long int newval); - /* This will not work on ARM1 or ARM2 because SWP is lacking on those machines. Unfortunately we have no way to detect this at compile time; let's hope nobody tries to use one. */ Modified: trunk/uClibc/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads.old/sysdeps/avr32/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -11,6 +11,14 @@ #include +#ifndef PT_EI +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif +#endif + static inline int _test_and_set (int *p, int v) { Modified: trunk/uClibc/libpthread/linuxthreads.old/sysdeps/bfin/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/sysdeps/bfin/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads.old/sysdeps/bfin/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -21,6 +21,8 @@ #ifndef _PT_MACHINE_H #define _PT_MACHINE_H 1 +#include + #ifndef PT_EI # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) # define PT_EI static inline __attribute__((always_inline)) Modified: trunk/uClibc/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h =================================================================== --- trunk/uClibc/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h 2008-01-05 10:40:51 UTC (rev 20730) +++ trunk/uClibc/libpthread/linuxthreads.old/sysdeps/cris/pt-machine.h 2008-01-05 11:24:00 UTC (rev 20731) @@ -17,9 +17,17 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _PT_MACHINE_H +#define _PT_MACHINE_H 1 +#include + #ifndef PT_EI -# define PT_EI extern inline __attribute__ ((always_inline)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) +# define PT_EI static inline __attribute__((always_inline)) +# else +# define PT_EI extern inline __attribute__((always_inline)) +# endif #endif PT_EI long int @@ -62