From bugs at busybox.net Fri Dec 1 09:54:34 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 09:54:34 -0800 Subject: [buildroot 0001107]: Gcc make failed Message-ID: <3219f25fb6415e7d44f5ad626f2aa80d@bugs.busybox.net> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=1107 ====================================================================== Reported By: AndyI Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1107 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 11-30-2006 05:21 PST Last Modified: 12-01-2006 09:54 PST ====================================================================== Summary: Gcc make failed Description: CYGWIN_NT-5.1 andrey 1.5.22(0.156/4/2) 2006-11-13 17:01 i686 Cygwin mkdir -p /buildroot/toolchain_build_mips/gcc-3.4.2-initial (cd /buildroot/toolchain_build_mips/gcc-3.4.2-initial; PATH=/opt/toolchains/uclibc/bin:/buildroot/toolchain_build_mips/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Program Files/Far:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/fpd26:/cygdrive/c/Program Files/Support Tools/ \ CC="gcc" \ /buildroot/toolchain_build_mips/gcc-3.4.2/configure \ --prefix=/opt/toolchains/uclibc \ --build=i386-pc-cygwin \ --host=i386-pc-cygwin \ --target=mips-linux-uclibc \ --enable-languages=c \ --with-sysroot=/buildroot/toolchain_build_mips/uClibc_dev/ \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ --disable-shared \ --disable-nls \ --enable-threads \ --disable-multilib \ \ \ ); /bin/sh: Files/Far:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/fpd26:/cygdrive/c/Program: No such file or directory make: *** [/buildroot/toolchain_build_mips/gcc-3.4.2-initial/.configured] Error 127 ====================================================================== ---------------------------------------------------------------------- AndyI - 11-30-06 06:26 ---------------------------------------------------------------------- gcc-uclibc-3.x.mk line 120 (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \ gcc-uclibc-3.x.mk line 142 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc gcc-uclibc-3.x.mk line 146 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc gcc-uclibc-3.x.mk line 176 (cd $(GCC_BUILD_DIR2); PATH='$(TARGET_PATH)' \ gcc-uclibc-3.x.mk line 198 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all PATH='$(TARGET_PATH)' ? ---------------------------------------------------------------------- bernhardf - 12-01-06 09:54 ---------------------------------------------------------------------- AFAIK windows is not supported. Either you provide patches to fix the problem while not breaking unix or i'll close this report. Thanks for your understanding. cheers, Issue History Date Modified Username Field Change ====================================================================== 11-30-06 05:21 AndyI New Issue 11-30-06 05:21 AndyI Status new => assigned 11-30-06 05:21 AndyI Assigned To => uClibc 11-30-06 05:22 AndyI Issue Monitored: AndyI 11-30-06 05:30 AndyI Issue End Monitor: AndyI 11-30-06 05:36 AndyI Note Added: 0001844 11-30-06 05:40 AndyI Note Edited: 0001844 11-30-06 05:51 AndyI Note Edited: 0001844 11-30-06 06:19 AndyI Note Edited: 0001844 11-30-06 06:26 AndyI Note Edited: 0001844 12-01-06 09:54 bernhardf Note Added: 0001845 ====================================================================== From bugs at busybox.net Fri Dec 1 09:55:25 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 09:55:25 -0800 Subject: [buildroot 0001041]: Upgrade for udev package to version 100 Message-ID: <0ce0c5dda78b6cb76b50cfe34c03172c@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=1041 ====================================================================== Reported By: ynezz Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1041 Category: New Features Reproducibility: always Severity: feature Priority: normal Status: closed Resolution: open Fixed in Version: ====================================================================== Date Submitted: 09-20-2006 14:24 PDT Last Modified: 12-01-2006 09:55 PST ====================================================================== Summary: Upgrade for udev package to version 100 Description: Upgrade for udev package to version 100 ====================================================================== ---------------------------------------------------------------------- bernhardf - 12-01-06 09:55 ---------------------------------------------------------------------- Fixed in r16746. Issue History Date Modified Username Field Change ====================================================================== 09-20-06 14:24 ynezz New Issue 09-20-06 14:24 ynezz Status new => assigned 09-20-06 14:24 ynezz Assigned To => uClibc 09-20-06 14:24 ynezz File Added: udev_v100.patch.gz 09-20-06 14:30 ynezz Issue Monitored: ynezz 12-01-06 09:55 bernhardf Status assigned => closed 12-01-06 09:55 bernhardf Note Added: 0001846 ====================================================================== From bugs at busybox.net Fri Dec 1 09:57:48 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 09:57:48 -0800 Subject: [buildroot 0000290]: (buildroot) udev doesn't manage /dev when it's configured [patch included] Message-ID: <9ed52aeb85bbf098e45349bac860184f@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=290 ====================================================================== Reported By: db Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 290 Category: Other Reproducibility: always Severity: block Priority: normal Status: closed Resolution: open Fixed in Version: ====================================================================== Date Submitted: 06-06-2005 00:09 PDT Last Modified: 12-01-2006 09:57 PST ====================================================================== Summary: (buildroot) udev doesn't manage /dev when it's configured [patch included] Description: As is well known by now, "devfs" is about to be removed from Linux 2.6 kernels. Plus it turns out that embedded systems tend to use that more than most other systems, for various reasons ... including systems that buildroot makes. Buildroot hasn't yet been able to rely on "udev" since it doesn't turn it on. It just sits there dead, doing nothing useful. This patch provides a basic working integration of udev-058 (current) with buildroot, and has been tested with Linux 2.6.12-rc5 on two ARM9 cores. The model is a basic one (no initramfs or initrd), and it just sets up a ramfs /dev holding the system's device nodes. The integration will likely be improved or tweaked in system-specific ways. And it seems like udev hasn't yet been tuned for work on embedded systems either... ====================================================================== ---------------------------------------------------------------------- andersen - 06-09-05 03:08 ---------------------------------------------------------------------- I note that udev.mk is trying to run mkdev. This is bad, because mkdev requires root, and buildroot should never be run as root, lest a typo might result in nuking something in your build system. It would be far better to fix the buildroot tar target to use fakeroot rather than kluding in calls to mkdev and running as root. A version of busybox mkdevs that uses the device tables used for cramfs, jffs2, and ext2 targets could make generating needed device nodes with fakeroot a pretty simple task. The busybox makedevs + busybox/patches/makdevs_table.diff would do the trick... Anyway, for now I've nuked the mkdev calls. ---------------------------------------------------------------------- db - 06-09-05 13:03 ---------------------------------------------------------------------- Hmm, I see this patch has been partially integrated; thanks. The result is still an un-bootable system however: - The resulting root fs images -- the raw build_*/root image as well as the root_fs_*.tar image -- aren't bootable because of the missing device nodes. OK, you've explained why you don't like that, but the result is still an un-bootable image. - You changed when the UDEV init script is run, so that it's too late. It's got to run _before_ the "mount -a", since it's providing a whole new /dev/ file system. This matters for things like accessing the /dev/pts files so "ssh" works, as well as (on systems that care) /dev/shm. I've got a patch fixing these two, which I'll add here after I've had time to test this with the other stuff I've got in the works. (No, I can't use jffs2 or cramfs images. The development cycle starts with NFS root, and jffs2 comes later. Also, that busybox makdevs_table.diff won't solve the problem, since the resulting filesystem doesn't boot far enough to run busybox ... it's missing the console, so Linux chokes, as well as two files needed by the C runtime.) ---------------------------------------------------------------------- db - 06-14-05 22:38 ---------------------------------------------------------------------- Here's the patch I'm using on top of current SVN. ---------------------------------------------------------------------- andersen - 06-24-05 00:39 ---------------------------------------------------------------------- The result is still an un-bootable system however since you did not read my suggestion about using fakeroot and possibly makedevs. :-) Your br2-udev-v2.patch is not acceptible since it relies on using 'mknod', which requires that buildroot be run as root. If you run buildroot as root then the next time someone (me, you, anyone) makes a small typo, your entire build system could be completely destroyed. I don't want that on my conscience, and you certainly don't want that to happen the night before you have to ship a product or are about to demo your last 6 months of work to a client..... Please come up with a different solution. I recommend taking a look at target/tar/tarroot.mk and/or target/squashfs/squashfsroot.mk for acceptible methods of creating device nodes for the target. ---------------------------------------------------------------------- pnoffke - 08-08-05 02:18 ---------------------------------------------------------------------- I think a way to fix this is as follows: If udev is selected for the target, use a different device table. I've modified target/generic/Makefile.in, and created a udev device table in target/generic/udev_table.txt. I also modified my inittab, init.d/rcS, and package/udev/init-udev (i.e. S10udev). Now, rcS is the first thing run, which mounts /proc and /sys without updating mtab, followed by remounting the root filesystem in read-write mode and updating the mtab. Finally, the init scripts are run, with udev being the first (assuming there's no script less than S10) if it's used. Also, the S10udev script was changed to correctly parse the output of /proc/mounts when looking for /sys. I'm not sure if I'm doing things in the correct order, so please have a quick read of the inittab and scripts and let me know if there's anything horribly wrong. I am not yet able to use svn (for doing a diff and producing patches) from behind my company's firewall, so I will just upload the modified/new files. For naming clarity, it might be better to rename the device_table.txt file to devfs_table.txt, and update Makefile.in accordingly. ---------------------------------------------------------------------- pnoffke - 08-11-05 16:42 ---------------------------------------------------------------------- I should have mentioned that the devices are created only when building a tar/ext2/jffs2/... image of your root filesystem. It relies on fakeroot/makedevs to create the devices. It's also in keeping with allowing buildroot to be run as a non-root user. ---------------------------------------------------------------------- bernhardf - 12-01-06 09:57 ---------------------------------------------------------------------- hmz. Thanks for the patches, but udev was added a long time ago. It was updated to udev-100 in r16746. Thanks alot for the patches and the report anyway. Cheers, Issue History Date Modified Username Field Change ====================================================================== 06-06-05 00:09 db New Issue 06-06-05 00:09 db File Added: br2-udev.patch 06-09-05 03:08 andersen Note Added: 0000239 06-09-05 13:03 db Note Added: 0000241 06-14-05 22:38 db Note Added: 0000243 06-14-05 22:39 db File Added: br2-udev-v2.patch 06-24-05 00:39 andersen Note Added: 0000255 08-07-05 22:00 pnoffke Note Added: 0000391 08-07-05 22:01 pnoffke File Added: udev_table.txt 08-07-05 22:02 pnoffke File Added: Makefile.in 08-07-05 22:10 pnoffke Issue Monitored: pnoffke 08-07-05 23:00 pnoffke Note Edited: 0000391 08-08-05 01:52 pnoffke Note Edited: 0000391 08-08-05 01:53 pnoffke File Added: inittab 08-08-05 01:53 pnoffke File Added: rcS 08-08-05 02:13 pnoffke File Added: S10udev 08-08-05 02:18 pnoffke Note Edited: 0000391 08-11-05 16:42 pnoffke Note Added: 0000406 12-01-06 09:57 bernhardf Status assigned => closed 12-01-06 09:57 bernhardf Note Added: 0001847 ====================================================================== From bugs at busybox.net Fri Dec 1 09:59:55 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 09:59:55 -0800 Subject: [buildroot 0000803]: Buildroot stops Message-ID: <1580c79bceddebf6fa4c4fcb5dfeca2a@bugs.busybox.net> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=803 ====================================================================== Reported By: Zhukov Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 803 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 03-28-2006 02:51 PST Last Modified: 12-01-2006 09:59 PST ====================================================================== Summary: Buildroot stops Description: Buildroot (version ~ march 20-24), configured for arm920t stops: the reason is some little-big endian incompatibility. Notes: 1. Make 3.80 used. 2. I don't change anything about endians (little endian set by default). ... LD libuClibc-0.9.28.so /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_udivsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_udivsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_umodsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_umodsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_modsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_modsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_dvmd_lnx.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_dvmd_lnx.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divdi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divdi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_moddi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_moddi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_clz.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_clz.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: BFD 2.16.1 assertion fail /home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/binutils-2.16.1/bfd/elf32-arm.c:2890 /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: BFD 2.16.1 assertion fail /home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/binutils-2.16.1/bfd/elf32-arm.c:2890 make[2]: *** [lib/libc.so] Error 1 make[1]: *** [lib/libc.so.0] Error 2 make[1]: Leaving directory `/home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/uClibc' make: *** [/home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/uClibc/lib/libc.a] Error 2 ====================================================================== ---------------------------------------------------------------------- bernhardf - 12-01-06 09:59 ---------------------------------------------------------------------- I think that this is fixed with current buildroot and current uClibc-snapshot. I shall close this report unless i hear that there are any current failures in this respect withing two weeks. thanks, Issue History Date Modified Username Field Change ====================================================================== 03-28-06 02:51 Zhukov New Issue 03-28-06 02:51 Zhukov Status new => assigned 03-28-06 02:51 Zhukov Assigned To => uClibc 03-28-06 02:51 Zhukov File Added: .config 06-01-06 20:51 KsenZ Issue Monitored: KsenZ 12-01-06 09:59 bernhardf Note Added: 0001848 ====================================================================== From bugs at busybox.net Fri Dec 1 10:05:26 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 10:05:26 -0800 Subject: [buildroot 0000818]: GDB fails to compile Message-ID: <6f7c314b447a8f9ae9d35073d0a625c3@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=818 ====================================================================== Reported By: blurgk Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 818 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: closed Resolution: open Fixed in Version: ====================================================================== Date Submitted: 04-07-2006 04:54 PDT Last Modified: 12-01-2006 10:05 PST ====================================================================== Summary: GDB fails to compile Description: GDB 6.4 fails to compile for ARM. When enabling "Build GDB debugger for the Target", it gives the following error: make[3]: Entering directory `/usr/src/buildroot-20060308/build_arm/gdb-6.4-target/gdb' rm -f gdb /usr/src/buildroot-20060308/build_arm/staging_dir/bin/arm-linux-uclibc-gcc -g -O2 -Os -pipe \ -o gdb gdb.o libgdb.a \ ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ../libiberty/libiberty.a -lncurses -lm ../libiberty/libiberty.a -ldl -rdynamic libgdb.a(breakpoint.o): In function `watchpoint_check': /usr/src/buildroot-20060308/toolchain_build_arm/gdb-6.4/gdb/breakpoint.c:2560: undefined reference to `async_reason_lookup' libgdb.a(breakpoint.o): In function `print_it_typical': /usr/src/buildroot-20060308/toolchain_build_arm/gdb-6.4/gdb/breakpoint.c:2118: undefined reference to `async_reason_lookup' /usr/src/buildroot-20060308/toolchain_build_arm/gdb-6.4/gdb/breakpoint.c:2254: undefined reference to `async_reason_lookup' /usr/src/buildroot-20060308/toolchain_build_arm/gdb-6.4/gdb/breakpoint.c:2276: undefined reference to `async_reason_lookup' /usr/src/buildroot-20060308/toolchain_build_arm/gdb-6.4/gdb/breakpoint.c:2294: undefined reference to `async_reason_lookup' libgdb.a(breakpoint.o):/usr/src/buildroot-20060308/toolchain_build_arm/gdb-6.4/gdb/breakpoint.c:2310: more undefined references to `async_reason_lookup' follow collect2: ld returned 1 exit status make[3]: *** [gdb] Error 1 make[3]: Leaving directory `/usr/src/buildroot-20060308/build_arm/gdb-6.4-target/gdb' make[2]: *** [all-gdb] Error 2 make[2]: Leaving directory `/usr/src/buildroot-20060308/build_arm/gdb-6.4-target' make[1]: *** [all] Error 2 make[1]: Leaving directory `/usr/src/buildroot-20060308/build_arm/gdb-6.4-target' make: *** [/usr/src/buildroot-20060308/build_arm/gdb-6.4-target/gdb/gdb] Error ====================================================================== ---------------------------------------------------------------------- blurgk - 04-18-06 04:13 ---------------------------------------------------------------------- This problem is solved by disabling the disable GDBMI option: http://bugs.uclibc.org/view.php?id=602 ---------------------------------------------------------------------- bernhardf - 12-01-06 10:05 ---------------------------------------------------------------------- Looks like this was fixed by sjhill in r15611. Thanks for your report. Issue History Date Modified Username Field Change ====================================================================== 04-07-06 04:54 blurgk New Issue 04-07-06 04:54 blurgk Status new => assigned 04-07-06 04:54 blurgk Assigned To => uClibc 04-18-06 04:13 blurgk Note Added: 0001307 12-01-06 10:05 bernhardf Status assigned => closed 12-01-06 10:05 bernhardf Note Added: 0001849 ====================================================================== From bugs at busybox.net Fri Dec 1 10:06:34 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 10:06:34 -0800 Subject: [buildroot 0001102]: sqlite build can't find "readline" Message-ID: <9e15183ced71a201f9e35c8f638e37ca@bugs.busybox.net> The following issue requires your FEEDBACK. ====================================================================== http://busybox.net/bugs/view.php?id=1102 ====================================================================== Reported By: znmeb Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1102 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: feedback ====================================================================== Date Submitted: 11-22-2006 17:17 PST Last Modified: 12-01-2006 10:06 PST ====================================================================== Summary: sqlite build can't find "readline" Description: /data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/staging_dir/bin/i686-linux-uclibc-gcc -Os -pipe -DOS_UNIX=1 -DHAVE_USLEEP=1 -DHAVE_FDATASYNC=1 -I. -I./src -DNDEBUG -DTHREADSAFE=1 -DSQLITE_THREAD_OVERRIDE_LOCK=-1 -DSQLITE_OMIT_CURSOR -DHAVE_READLINE=1 -I/data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/staging_dir/usr/include -o .libs/sqlite3 ./src/shell.c ./.libs/libsqlite3.so -lpthread -L/data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/root/usr/lib -L/data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/root/lib -lncurses -lreadline ./src/shell.c:45:32: readline/readline.h: No such file or directory ./src/shell.c:46:31: readline/history.h: No such file or directory ./src/shell.c: In function `one_input_line': ./src/shell.c:206: warning: assignment makes pointer from integer without a cast make[1]: *** [sqlite3] Error 1 make[1]: Leaving directory `/data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/sqlite-3.3.8' make: *** [/data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/sqlite-3.3.8/sqlite3] Error 2 ====================================================================== ---------------------------------------------------------------------- bernhardf - 11-23-06 01:18 ---------------------------------------------------------------------- Did you select BR2_READLINE ? If so, did readline build correctly? Is there a lib*readline* in your /data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/root/lib? Is there a readline.h in /data1/vgrails/RailsOnAStick/GenericBuildroot/buildroot/build_i686/staging_dir/usr/include/readline/ ? ---------------------------------------------------------------------- znmeb - 11-23-06 20:13 ---------------------------------------------------------------------- In the original attempt, I did have "readline" selected, but I didn't see whether it built correctly or not. I just re-ran everything one step at a time and I think I know what happened. The default "make defconfig" gives you a target architecture of i386 but it gives you a target architecture variant of i686. I think that killed the build of readline. I just re-ran the build of readline and then the build of sqlite with both of them set to i386 and both builds worked. So I'm going to try readline again with the default and capture a log file. Issue History Date Modified Username Field Change ====================================================================== 11-22-06 17:17 znmeb New Issue 11-22-06 17:17 znmeb Status new => assigned 11-22-06 17:17 znmeb Assigned To => uClibc 11-22-06 17:18 znmeb Issue Monitored: znmeb 11-23-06 01:18 bernhardf Note Added: 0001790 11-23-06 20:13 znmeb Note Added: 0001800 12-01-06 10:06 bernhardf Status assigned => feedback ====================================================================== From bugs at busybox.net Fri Dec 1 10:07:10 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 10:07:10 -0800 Subject: [buildroot 0001107]: Gcc make failed Message-ID: <4826faa48aee7c7081406e184801baea@bugs.busybox.net> The following issue requires your FEEDBACK. ====================================================================== http://busybox.net/bugs/view.php?id=1107 ====================================================================== Reported By: AndyI Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1107 Category: Other Reproducibility: always Severity: minor Priority: normal Status: feedback ====================================================================== Date Submitted: 11-30-2006 05:21 PST Last Modified: 12-01-2006 10:07 PST ====================================================================== Summary: Gcc make failed Description: CYGWIN_NT-5.1 andrey 1.5.22(0.156/4/2) 2006-11-13 17:01 i686 Cygwin mkdir -p /buildroot/toolchain_build_mips/gcc-3.4.2-initial (cd /buildroot/toolchain_build_mips/gcc-3.4.2-initial; PATH=/opt/toolchains/uclibc/bin:/buildroot/toolchain_build_mips/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Program Files/Far:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/fpd26:/cygdrive/c/Program Files/Support Tools/ \ CC="gcc" \ /buildroot/toolchain_build_mips/gcc-3.4.2/configure \ --prefix=/opt/toolchains/uclibc \ --build=i386-pc-cygwin \ --host=i386-pc-cygwin \ --target=mips-linux-uclibc \ --enable-languages=c \ --with-sysroot=/buildroot/toolchain_build_mips/uClibc_dev/ \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ --disable-shared \ --disable-nls \ --enable-threads \ --disable-multilib \ \ \ ); /bin/sh: Files/Far:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/fpd26:/cygdrive/c/Program: No such file or directory make: *** [/buildroot/toolchain_build_mips/gcc-3.4.2-initial/.configured] Error 127 ====================================================================== ---------------------------------------------------------------------- AndyI - 11-30-06 06:26 ---------------------------------------------------------------------- gcc-uclibc-3.x.mk line 120 (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \ gcc-uclibc-3.x.mk line 142 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc gcc-uclibc-3.x.mk line 146 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc gcc-uclibc-3.x.mk line 176 (cd $(GCC_BUILD_DIR2); PATH='$(TARGET_PATH)' \ gcc-uclibc-3.x.mk line 198 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all PATH='$(TARGET_PATH)' ? ---------------------------------------------------------------------- bernhardf - 12-01-06 09:54 ---------------------------------------------------------------------- AFAIK windows is not supported. Either you provide patches to fix the problem while not breaking unix or i'll close this report. Thanks for your understanding. cheers, Issue History Date Modified Username Field Change ====================================================================== 11-30-06 05:21 AndyI New Issue 11-30-06 05:21 AndyI Status new => assigned 11-30-06 05:21 AndyI Assigned To => uClibc 11-30-06 05:22 AndyI Issue Monitored: AndyI 11-30-06 05:30 AndyI Issue End Monitor: AndyI 11-30-06 05:36 AndyI Note Added: 0001844 11-30-06 05:40 AndyI Note Edited: 0001844 11-30-06 05:51 AndyI Note Edited: 0001844 11-30-06 06:19 AndyI Note Edited: 0001844 11-30-06 06:26 AndyI Note Edited: 0001844 12-01-06 09:54 bernhardf Note Added: 0001845 12-01-06 10:07 bernhardf Status assigned => feedback ====================================================================== From bugs at busybox.net Fri Dec 1 10:07:41 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 10:07:41 -0800 Subject: [buildroot 0000803]: Buildroot stops Message-ID: <2402924838f061bb0a103235c8aeb084@bugs.busybox.net> The following issue requires your FEEDBACK. ====================================================================== http://busybox.net/bugs/view.php?id=803 ====================================================================== Reported By: Zhukov Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 803 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: feedback ====================================================================== Date Submitted: 03-28-2006 02:51 PST Last Modified: 12-01-2006 10:07 PST ====================================================================== Summary: Buildroot stops Description: Buildroot (version ~ march 20-24), configured for arm920t stops: the reason is some little-big endian incompatibility. Notes: 1. Make 3.80 used. 2. I don't change anything about endians (little endian set by default). ... LD libuClibc-0.9.28.so /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_udivsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_udivsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_umodsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_umodsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_modsi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_modsi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_dvmd_lnx.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_dvmd_lnx.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divdi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_divdi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_moddi3.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_moddi3.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_clz.o): compiled for a little endian system and target is big endian /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: failed to merge target specific data of file /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/lib/gcc/arm-linux-uclibc/3.4.2/libgcc.a(_clz.o) /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: BFD 2.16.1 assertion fail /home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/binutils-2.16.1/bfd/elf32-arm.c:2890 /home/andrew/BusyBox_uClibc/buildroot/build_arm/staging_dir/bin/arm-linux-uclibc-ld: BFD 2.16.1 assertion fail /home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/binutils-2.16.1/bfd/elf32-arm.c:2890 make[2]: *** [lib/libc.so] Error 1 make[1]: *** [lib/libc.so.0] Error 2 make[1]: Leaving directory `/home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/uClibc' make: *** [/home/andrew/BusyBox_uClibc/buildroot/toolchain_build_arm/uClibc/lib/libc.a] Error 2 ====================================================================== ---------------------------------------------------------------------- bernhardf - 12-01-06 09:59 ---------------------------------------------------------------------- I think that this is fixed with current buildroot and current uClibc-snapshot. I shall close this report unless i hear that there are any current failures in this respect withing two weeks. thanks, Issue History Date Modified Username Field Change ====================================================================== 03-28-06 02:51 Zhukov New Issue 03-28-06 02:51 Zhukov Status new => assigned 03-28-06 02:51 Zhukov Assigned To => uClibc 03-28-06 02:51 Zhukov File Added: .config 06-01-06 20:51 KsenZ Issue Monitored: KsenZ 12-01-06 09:59 bernhardf Note Added: 0001848 12-01-06 10:07 bernhardf Status assigned => feedback ====================================================================== From bugs at busybox.net Fri Dec 1 10:08:12 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 10:08:12 -0800 Subject: [buildroot 0000997]: system mounted on /dev/root Message-ID: <82c6df39d5188b28c7f31d9f7b3cb4b6@bugs.busybox.net> The following issue has been CLOSED ====================================================================== http://busybox.net/bugs/view.php?id=997 ====================================================================== Reported By: amja Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 997 Category: Architecture Specific Reproducibility: always Severity: minor Priority: normal Status: closed Resolution: open Fixed in Version: ====================================================================== Date Submitted: 08-16-2006 13:10 PDT Last Modified: 12-01-2006 10:08 PST ====================================================================== Summary: system mounted on /dev/root Description: I'm playing about with buildroot at the moment. I've no real need for embedded linux but was interested in seeing how minimal a system I could use. When I try to boot into the system the root filesystem is /dev/root and mounted read-only. I tried build root a few months ago and don't recall this being a problem. Google turns up nothing that appears to be relevant. If I am booting with a 2.4 kernel (vmlinuz-ide-2.4.31 from slackware 10.2) I can mount /dev/hda on /mnt and then use pivot_root to get a new root. If I boot a 2.6 kernel (vmlinuz-2.4.12-24mdk from mandriva 2006) I get a device busy message if I try the above. ====================================================================== ---------------------------------------------------------------------- amja - 08-17-06 09:18 ---------------------------------------------------------------------- I've tried a busybox snapshot (20060817) which seems to solve the problem. I'm still experiemntimg with various combinations of uClibc, busybox and buildroot. Issue History Date Modified Username Field Change ====================================================================== 08-16-06 13:10 amja New Issue 08-16-06 13:10 amja Status new => assigned 08-16-06 13:10 amja Assigned To => uClibc 08-17-06 09:18 amja Note Added: 0001569 12-01-06 10:08 bernhardf Status assigned => closed ====================================================================== From bugs at busybox.net Fri Dec 1 10:12:29 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 10:12:29 -0800 Subject: [buildroot 0000881]: Buildroot new feature: Generate initramfs description file of root filesystem for initial kernel ramdisk Message-ID: <6596ec3825bd300430e0838c97b46882@bugs.busybox.net> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=881 ====================================================================== Reported By: fred Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 881 Category: New Features Reproducibility: N/A Severity: feature Priority: normal Status: assigned ====================================================================== Date Submitted: 05-24-2006 16:27 PDT Last Modified: 12-01-2006 10:12 PST ====================================================================== Summary: Buildroot new feature: Generate initramfs description file of root filesystem for initial kernel ramdisk Description: This patch contains a new target "initramfs" which builds a description file for the initial kernel ramdisk. I use this together with kernel 2.6.12. The mechanism is based on a shell script "gen_initramfs_list.sh" which is provided together with the kernel. The description file is then used to build a cpio filesystem via the gen_init_cpio tool during the kernel build. This is inspired by the procedure described here: http://www.student.tue.nl/Q/t.f.a.wilms/adm5120/ That procedure produces an ext2 filesystem with buildroot. Then this filesystem is mounted in the kernel build directory where "gen_initramfs_list.sh" produces a filesystem description file which is used then by gen_init_cpio to produce the cpio filesystem. This procedure requires root rights to mount the filesystem. The idea is to produce the filesystem description file directly from buildroot. Then the complete kernel including rootfilesystem as ramdisk can be build as normal user. The patch adds a new target and modifies the config.in file in the target directory. ====================================================================== ---------------------------------------------------------------------- bernhardf - 12-01-06 10:12 ---------------------------------------------------------------------- That's an excellent idea except for the mount. Please be so kind and update the patch to select tarroot # or however the creation of a tarball is named or just ln -s the build_$()/root to the dir gen_initramfs expects. Also, it's easier for me if you could (also) send the patch with a copy'n paste of the adjusted description above to the mailing-list. TIA! Issue History Date Modified Username Field Change ====================================================================== 05-24-06 16:27 fred New Issue 05-24-06 16:27 fred Status new => assigned 05-24-06 16:27 fred Assigned To => uClibc 05-24-06 16:27 fred File Added: buildroot_initramfs_target.patch 12-01-06 10:12 bernhardf Note Added: 0001850 ====================================================================== From bugs at busybox.net Fri Dec 1 12:16:10 2006 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 1 Dec 2006 12:16:10 -0800 Subject: [buildroot 0001107]: Gcc make failed Message-ID: A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=1107 ====================================================================== Reported By: AndyI Assigned To: uClibc ====================================================================== Project: buildroot Issue ID: 1107 Category: Other Reproducibility: always Severity: minor Priority: normal Status: feedback ====================================================================== Date Submitted: 11-30-2006 05:21 PST Last Modified: 12-01-2006 12:16 PST ====================================================================== Summary: Gcc make failed Description: CYGWIN_NT-5.1 andrey 1.5.22(0.156/4/2) 2006-11-13 17:01 i686 Cygwin mkdir -p /buildroot/toolchain_build_mips/gcc-3.4.2-initial (cd /buildroot/toolchain_build_mips/gcc-3.4.2-initial; PATH=/opt/toolchains/uclibc/bin:/buildroot/toolchain_build_mips/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/Program Files/Far:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/fpd26:/cygdrive/c/Program Files/Support Tools/ \ CC="gcc" \ /buildroot/toolchain_build_mips/gcc-3.4.2/configure \ --prefix=/opt/toolchains/uclibc \ --build=i386-pc-cygwin \ --host=i386-pc-cygwin \ --target=mips-linux-uclibc \ --enable-languages=c \ --with-sysroot=/buildroot/toolchain_build_mips/uClibc_dev/ \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ --disable-shared \ --disable-nls \ --enable-threads \ --disable-multilib \ \ \ ); /bin/sh: Files/Far:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/fpd26:/cygdrive/c/Program: No such file or directory make: *** [/buildroot/toolchain_build_mips/gcc-3.4.2-initial/.configured] Error 127 ====================================================================== ---------------------------------------------------------------------- AndyI - 11-30-06 06:26 ---------------------------------------------------------------------- gcc-uclibc-3.x.mk line 120 (cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) \ gcc-uclibc-3.x.mk line 142 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) all-gcc gcc-uclibc-3.x.mk line 146 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR1) install-gcc gcc-uclibc-3.x.mk line 176 (cd $(GCC_BUILD_DIR2); PATH='$(TARGET_PATH)' \ gcc-uclibc-3.x.mk line 198 PATH=$(TARGET_PATH) $(MAKE) -C $(GCC_BUILD_DIR2) all PATH='$(TARGET_PATH)' ? ---------------------------------------------------------------------- bernhardf - 12-01-06 09:54 ---------------------------------------------------------------------- AFAIK windows is not supported. Either you provide patches to fix the problem while not breaking unix or i'll close this report. Thanks for your understanding. cheers, ---------------------------------------------------------------------- AndyI - 12-01-06 12:16 ---------------------------------------------------------------------- Here a patch. Issue History Date Modified Username Field Change ====================================================================== 11-30-06 05:21 AndyI New Issue 11-30-06 05:21 AndyI Status new => assigned 11-30-06 05:21 AndyI Assigned To => uClibc 11-30-06 05:22 AndyI Issue Monitored: AndyI 11-30-06 05:30 AndyI Issue End Monitor: AndyI 11-30-06 05:36 AndyI Note Added: 0001844 11-30-06 05:40 AndyI Note Edited: 0001844 11-30-06 05:51 AndyI Note Edited: 0001844 11-30-06 06:19 AndyI Note Edited: 0001844 11-30-06 06:26 AndyI Note Edited: 0001844 12-01-06 09:54 bernhardf Note Added: 0001845 12-01-06 10:07 bernhardf Status assigned => feedback 12-01-06 12:15 AndyI File Added: cygwin_path.patch 12-01-06 12:16 AndyI Note Added: 0001852 ====================================================================== From sjhill at uclibc.org Fri Dec 1 17:42:12 2006 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Fri, 1 Dec 2006 17:42:12 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/common/bits Message-ID: <20061202014212.1A1DC48587@busybox.net> Author: sjhill Date: 2006-12-01 17:42:11 -0800 (Fri, 01 Dec 2006) New Revision: 16748 Log: Remove definition of TIMER_MAX which breaks builds of GCC-4.2 and in glibc code it is not defined. Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h 2006-12-01 21:34:20 UTC (rev 16747) +++ trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h 2006-12-02 01:42:11 UTC (rev 16748) @@ -73,9 +73,6 @@ /* Minimum size for a thread. We are free to choose a reasonable value. */ #define PTHREAD_STACK_MIN 16384 -/* Maximum number of POSIX timers available. */ -#define TIMER_MAX 256 - /* Maximum number of timer expiration overruns. */ #define DELAYTIMER_MAX 2147483647 From sjhill at uclibc.org Fri Dec 1 18:01:58 2006 From: sjhill at uclibc.org (sjhill at uclibc.org) Date: Fri, 1 Dec 2006 18:01:58 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/misc/pthread Message-ID: <20061202020158.2B3484858F@busybox.net> Author: sjhill Date: 2006-12-01 18:01:57 -0800 (Fri, 01 Dec 2006) New Revision: 16749 Log: Modified: trunk/uClibc/libc/misc/pthread/weaks.c Changeset: Modified: trunk/uClibc/libc/misc/pthread/weaks.c =================================================================== --- trunk/uClibc/libc/misc/pthread/weaks.c 2006-12-02 01:42:11 UTC (rev 16748) +++ trunk/uClibc/libc/misc/pthread/weaks.c 2006-12-02 02:01:57 UTC (rev 16749) @@ -35,3 +35,8 @@ weak_alias (__pthread_return_0, __pthread_mutex_lock) weak_alias (__pthread_return_0, __pthread_mutex_trylock) weak_alias (__pthread_return_0, __pthread_mutex_unlock) +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +weak_alias (__pthread_return_0, __pthread_mutexattr_init) +weak_alias (__pthread_return_0, __pthread_mutexattr_destroy) +weak_alias (__pthread_return_0, __pthread_mutexattr_settype) +#endif From vapier at uclibc.org Sat Dec 2 11:19:38 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 2 Dec 2006 11:19:38 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/common/bits Message-ID: <20061202191938.854AE48619@busybox.net> Author: vapier Date: 2006-12-02 11:19:38 -0800 (Sat, 02 Dec 2006) New Revision: 16765 Log: PTHREAD_THREADS_MAX is supposed to be in pthread-specific dir, but for now it lives in bits/uClibc_local_lim.h Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h 2006-12-02 19:02:21 UTC (rev 16764) +++ trunk/uClibc/libc/sysdeps/linux/common/bits/local_lim.h 2006-12-02 19:19:38 UTC (rev 16765) @@ -63,8 +63,6 @@ /* The number of threads per process. */ #define _POSIX_THREAD_THREADS_MAX 64 -/* This is the value this implementation supports. */ -#define PTHREAD_THREADS_MAX 16384 /* Maximum amount by which a process can descrease its asynchronous I/O priority level. */ From vapier at uclibc.org Sat Dec 2 11:31:41 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 2 Dec 2006 11:31:41 -0800 (PST) Subject: svn commit: trunk/uClibc/test/string Message-ID: <20061202193141.7E40548630@busybox.net> Author: vapier Date: 2006-12-02 11:31:40 -0800 (Sat, 02 Dec 2006) New Revision: 16766 Log: fix building when susv3 legacy stuff is disabled Modified: trunk/uClibc/test/string/tester.c Changeset: Modified: trunk/uClibc/test/string/tester.c =================================================================== --- trunk/uClibc/test/string/tester.c 2006-12-02 19:19:38 UTC (rev 16765) +++ trunk/uClibc/test/string/tester.c 2006-12-02 19:31:40 UTC (rev 16766) @@ -40,6 +40,12 @@ # undef __TEST_BSD_FUNCS__ #endif +#if defined(__UCLIBC_SUSV3_LEGACY__) || defined(__UCLIBC_SUSV3_LEGACY__) +# define __TEST_SUSV3_LEGACY__ +#else +# undef __TEST_SUSV3_LEGACY__ +#endif + #define STREQ(a, b) (strcmp((a), (b)) == 0) const char *it = ""; /* Routine name for message routines. */ @@ -646,6 +652,7 @@ static void test_index (void) { +#ifdef __TEST_SUSV3_LEGACY__ it = "index"; check (index ("abcd", 'z') == NULL, 1); /* Not found. */ (void) strcpy (one, "abcd"); @@ -658,6 +665,7 @@ (void) strcpy (one, ""); check (index (one, 'b') == NULL, 7); /* Empty string. */ check (index (one, '\0') == one, 8); /* NUL in empty string. */ +#endif } static void @@ -738,6 +746,7 @@ static void test_rindex (void) { +#ifdef __TEST_SUSV3_LEGACY__ it = "rindex"; check (rindex ("abcd", 'z') == NULL, 1); /* Not found. */ (void) strcpy (one, "abcd"); @@ -750,6 +759,7 @@ (void) strcpy (one, ""); check (rindex (one, 'b') == NULL, 7); /* Empty string. */ check (rindex (one, '\0') == one, 8); /* NUL in empty string. */ +#endif } static void @@ -1346,6 +1356,7 @@ static void test_bcopy (void) { +#ifdef __TEST_SUSV3_LEGACY__ /* Much like memcpy. Berklix manual is silent about overlap, so don't test it. */ it = "bcopy"; @@ -1365,11 +1376,13 @@ (void) bcopy(one, two, 9); equal(two, "hi there", 4); /* Just paranoia. */ equal(one, "hi there", 5); /* Stomped on source? */ +#endif } static void test_bzero (void) { +#ifdef __TEST_SUSV3_LEGACY__ it = "bzero"; (void) strcpy(one, "abcdef"); bzero(one+2, 2); @@ -1380,6 +1393,7 @@ (void) strcpy(one, "abcdef"); bzero(one+2, 0); equal(one, "abcdef", 4); /* Zero-length copy. */ +#endif } static void @@ -1409,6 +1423,7 @@ static void test_bcmp (void) { +#ifdef __TEST_SUSV3_LEGACY__ it = "bcmp"; check(bcmp("a", "a", 1) == 0, 1); /* Identity. */ check(bcmp("abc", "abc", 3) == 0, 2); /* Multicharacter. */ @@ -1417,6 +1432,7 @@ check(bcmp("alph", "beta", 4) != 0, 5); check(bcmp("abce", "abcd", 3) == 0, 6); /* Count limited. */ check(bcmp("abc", "def", 0) == 0, 8); /* Zero count. */ +#endif } static void From vapier at uclibc.org Sat Dec 2 11:32:05 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 2 Dec 2006 11:32:05 -0800 (PST) Subject: svn commit: trunk/uClibc/test/setjmp Message-ID: <20061202193205.C10C348630@busybox.net> Author: vapier Date: 2006-12-02 11:32:05 -0800 (Sat, 02 Dec 2006) New Revision: 16767 Log: update ignores Modified: trunk/uClibc/test/setjmp/ Changeset: Property changes on: trunk/uClibc/test/setjmp ___________________________________________________________________ Name: svn:ignore - bug269-setjmp jmpbug tst-setjmp *_glibc *.gdb *.out + bug269-setjmp jmpbug sigjmpbug tst-setjmp tst-vfork-longjmp *_glibc *.gdb *.out From vapier at uclibc.org Sat Dec 2 18:50:46 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sat, 2 Dec 2006 18:50:46 -0800 (PST) Subject: svn commit: trunk/uClibc/test/string Message-ID: <20061203025046.D9E99485FB@busybox.net> Author: vapier Date: 2006-12-02 18:50:45 -0800 (Sat, 02 Dec 2006) New Revision: 16772 Log: second SUSV3 legacy check should be for macros as pointed out by psm Modified: trunk/uClibc/test/string/tester.c Changeset: Modified: trunk/uClibc/test/string/tester.c =================================================================== --- trunk/uClibc/test/string/tester.c 2006-12-02 20:47:36 UTC (rev 16771) +++ trunk/uClibc/test/string/tester.c 2006-12-03 02:50:45 UTC (rev 16772) @@ -40,7 +40,7 @@ # undef __TEST_BSD_FUNCS__ #endif -#if defined(__UCLIBC_SUSV3_LEGACY__) || defined(__UCLIBC_SUSV3_LEGACY__) +#if defined(__UCLIBC_SUSV3_LEGACY__) || defined(__UCLIBC_SUSV3_LEGACY_MACROS__) # define __TEST_SUSV3_LEGACY__ #else # undef __TEST_SUSV3_LEGACY__ From landley at uclibc.org Sun Dec 3 10:22:07 2006 From: landley at uclibc.org (landley at uclibc.org) Date: Sun, 3 Dec 2006 10:22:07 -0800 (PST) Subject: svn commit: trunk/uClibc/extra/Configs Message-ID: <20061203182207.AA3DB48653@busybox.net> Author: landley Date: 2006-12-03 10:22:06 -0800 (Sun, 03 Dec 2006) New Revision: 16773 Log: Patch from Jim Gifford (of Cross Linux From Scratch) fixing the Mips failures from Mike's nightly builds. Modified: trunk/uClibc/extra/Configs/Config.mips Changeset: Modified: trunk/uClibc/extra/Configs/Config.mips =================================================================== --- trunk/uClibc/extra/Configs/Config.mips 2006-12-03 02:50:45 UTC (rev 16772) +++ trunk/uClibc/extra/Configs/Config.mips 2006-12-03 18:22:06 UTC (rev 16773) @@ -67,8 +67,10 @@ config CONFIG_MIPS_N64_ABI bool "N64 ABI" + select CONFIG_MIPS_ISA_3 config CONFIG_MIPS_N32_ABI bool "N32 ABI" + select CONFIG_MIPS_ISA_3 endchoice From vapier at uclibc.org Sun Dec 3 11:52:49 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sun, 3 Dec 2006 11:52:49 -0800 (PST) Subject: svn commit: trunk/uClibc/extra/Configs Message-ID: <20061203195249.B6D5948675@busybox.net> Author: vapier Date: 2006-12-03 11:52:48 -0800 (Sun, 03 Dec 2006) New Revision: 16774 Log: revert previous change Modified: trunk/uClibc/extra/Configs/Config.mips Changeset: Modified: trunk/uClibc/extra/Configs/Config.mips =================================================================== --- trunk/uClibc/extra/Configs/Config.mips 2006-12-03 18:22:06 UTC (rev 16773) +++ trunk/uClibc/extra/Configs/Config.mips 2006-12-03 19:52:48 UTC (rev 16774) @@ -67,10 +67,8 @@ config CONFIG_MIPS_N64_ABI bool "N64 ABI" - select CONFIG_MIPS_ISA_3 config CONFIG_MIPS_N32_ABI bool "N32 ABI" - select CONFIG_MIPS_ISA_3 endchoice From vapier at uclibc.org Sun Dec 3 12:10:28 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sun, 3 Dec 2006 12:10:28 -0800 (PST) Subject: svn commit: trunk/uClibc/extra/Configs Message-ID: <20061203201028.ED1894868A@busybox.net> Author: vapier Date: 2006-12-03 12:10:28 -0800 (Sun, 03 Dec 2006) New Revision: 16775 Log: list ABI first and tweak ISA defaults with suggestions from Jim Gifford Modified: trunk/uClibc/extra/Configs/Config.mips Changeset: Modified: trunk/uClibc/extra/Configs/Config.mips =================================================================== --- trunk/uClibc/extra/Configs/Config.mips 2006-12-03 19:52:48 UTC (rev 16774) +++ trunk/uClibc/extra/Configs/Config.mips 2006-12-03 20:10:28 UTC (rev 16775) @@ -19,8 +19,28 @@ string choice + prompt "Target ABI" + default CONFIG_MIPS_O32_ABI + help + This is the ABI you wish to build use. Choose either O32, N32 + or N64. + +config CONFIG_MIPS_O32_ABI + bool "O32 ABI" + +config CONFIG_MIPS_N32_ABI + bool "N32 ABI" + +config CONFIG_MIPS_N64_ABI + bool "N64 ABI" + +endchoice + +choice prompt "Target Processor Architecture" - default CONFIG_MIPS_ISA_1 + default CONFIG_MIPS_ISA_1 if CONFIG_MIPS_O32_ABI + default CONFIG_MIPS_ISA_3 if CONFIG_MIPS_N32_ABI + default CONFIG_MIPS_ISA_3 if CONFIG_MIPS_N64_ABI help This selects the instruction set architecture of your MIPS CPU. This information is used for optimizing purposes. To build a library that @@ -54,21 +74,3 @@ bool "MIPS64" endchoice - -choice - prompt "Target ABI" - default CONFIG_MIPS_O32_ABI - help - This is the ABI you wish to build use. Choose either O32, N32 - or N64. - -config CONFIG_MIPS_O32_ABI - bool "O32 ABI" - -config CONFIG_MIPS_N64_ABI - bool "N64 ABI" - -config CONFIG_MIPS_N32_ABI - bool "N32 ABI" - -endchoice From vapier at uclibc.org Sun Dec 3 12:13:25 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Sun, 3 Dec 2006 12:13:25 -0800 (PST) Subject: svn commit: trunk/uClibc/extra/Configs Message-ID: <20061203201325.D24CB4869A@busybox.net> Author: vapier Date: 2006-12-03 12:13:25 -0800 (Sun, 03 Dec 2006) New Revision: 16776 Log: make ABI into a list Modified: trunk/uClibc/extra/Configs/Config.arm Changeset: Modified: trunk/uClibc/extra/Configs/Config.arm =================================================================== --- trunk/uClibc/extra/Configs/Config.arm 2006-12-03 20:10:28 UTC (rev 16775) +++ trunk/uClibc/extra/Configs/Config.arm 2006-12-03 20:13:25 UTC (rev 16776) @@ -17,16 +17,24 @@ config LIBGCC_CFLAGS string -config CONFIG_ARM_EABI - bool "Use ARM EABI" - default n +choice + prompt "Target ABI" + default CONFIG_ARM_OABI help - If you choose "Y" here, functions and constants required by the - ARM EABI will be built into the library. You should choose "Y" + If you choose "EABI" here, functions and constants required by the + ARM EABI will be built into the library. You should choose "EABI" if your compiler uses the ARM EABI, in which case you will also - need a kernel supporting the EABI system call interface, or "N" + need a kernel supporting the EABI system call interface, or "OABI" for a compiler using the old Linux ABI. +config CONFIG_ARM_OABI + bool "OABI" + +config CONFIG_ARM_EABI + bool "EABI" + +endchoice + config USE_BX bool "Use BX in function return" default y From vapier at uclibc.org Tue Dec 5 17:53:40 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 5 Dec 2006 17:53:40 -0800 (PST) Subject: svn commit: trunk/uClibc Message-ID: <20061206015340.C01AD48593@busybox.net> Author: vapier Date: 2006-12-05 17:53:40 -0800 (Tue, 05 Dec 2006) New Revision: 16785 Log: note test subdir problems with multilib Modified: trunk/uClibc/TODO Changeset: Modified: trunk/uClibc/TODO =================================================================== --- trunk/uClibc/TODO 2006-12-05 12:57:41 UTC (rev 16784) +++ trunk/uClibc/TODO 2006-12-06 01:53:40 UTC (rev 16785) @@ -36,6 +36,9 @@ *) bug in getopt handling: http://bugs.uclibc.org/view.php?id=61 http://www.uclibc.org/lists/uclibc/2006-January/013851.html + *) Should integrate test subdir better ... need to propagate CPU + CFLAGS/LDFLAGS to the build/link for target binaries so that when we have + a multilib toolchain, the proper ABI is selected. TODO list for the uClibc 1.0.0 release: From vapier at uclibc.org Tue Dec 5 17:55:59 2006 From: vapier at uclibc.org (vapier at uclibc.org) Date: Tue, 5 Dec 2006 17:55:59 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/m68k/bits Message-ID: <20061206015559.C597C48595@busybox.net> Author: vapier Date: 2006-12-05 17:55:59 -0800 (Tue, 05 Dec 2006) New Revision: 16786 Log: pulling in kernel config.h wont fly Modified: trunk/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_page.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_page.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_page.h 2006-12-06 01:53:40 UTC (rev 16785) +++ trunk/uClibc/libc/sysdeps/linux/m68k/bits/uClibc_page.h 2006-12-06 01:55:59 UTC (rev 16786) @@ -20,15 +20,21 @@ #ifndef _UCLIBC_PAGE_H #define _UCLIBC_PAGE_H +/* #include +*/ /* PAGE_SHIFT determines the page size */ +/* #ifndef CONFIG_SUN3 +*/ #define PAGE_SHIFT (12) +/* #else #define PAGE_SHIFT (13) #endif +*/ #define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) From andersen at uclibc.org Wed Dec 6 12:22:43 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Wed, 6 Dec 2006 12:22:43 -0800 (PST) Subject: svn commit: trunk/uClibc: ldso/include libc/sysdeps/linux/alpha/bi etc... Message-ID: <20061206202243.B3D9F4857F@busybox.net> Author: andersen Date: 2006-12-06 12:22:42 -0800 (Wed, 06 Dec 2006) New Revision: 16789 Log: bits/kernel_stat.h is for internal uClibc use only, fix a few other minor include file issues Modified: trunk/uClibc/ldso/include/dl-syscall.h trunk/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/bfin/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/common/pread_write.c trunk/uClibc/libc/sysdeps/linux/common/syscalls.h trunk/uClibc/libc/sysdeps/linux/cris/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/frv/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/nios2/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/sh/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/sh64/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/v850/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h trunk/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h Changeset: Modified: trunk/uClibc/ldso/include/dl-syscall.h =================================================================== --- trunk/uClibc/ldso/include/dl-syscall.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/ldso/include/dl-syscall.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -11,7 +11,8 @@ /* Pull in the arch specific syscall implementation */ #include /* For MAP_ANONYMOUS -- differs between platforms */ -#include +#define _SYS_MMAN_H 1 +#include /* Pull in whatever this particular arch's kernel thinks the kernel version of * struct stat should look like. It turns out that each arch has a different * opinion on the subject, and different kernel revs use different names... */ Modified: trunk/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/alpha/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/arm/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/bfin/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/bfin/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/bfin/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/common/pread_write.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/pread_write.c 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/common/pread_write.c 2006-12-06 20:22:42 UTC (rev 16789) @@ -24,6 +24,8 @@ extern __typeof(pwrite64) __libc_pwrite64; #endif +#include + #ifdef __NR_pread # define __NR___syscall_pread __NR_pread Modified: trunk/uClibc/libc/sysdeps/linux/common/syscalls.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/syscalls.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/common/syscalls.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -21,3 +21,4 @@ # undef __USE_FILE_OFFSET64 #endif +#include Modified: trunk/uClibc/libc/sysdeps/linux/cris/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/cris/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/cris/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -3,6 +3,10 @@ #ifndef _CRIS_STAT_H #define _CRIS_STAT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + struct __old_kernel_stat { unsigned short st_dev; unsigned short st_ino; Modified: trunk/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/e1/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/frv/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/frv/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/frv/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/h8300/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/hppa/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -4,6 +4,10 @@ #ifndef _PARISC_STAT_H #define _PARISC_STAT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + struct kernel_stat { unsigned int st_dev; /* dev_t is 32 bits on parisc */ ino_t st_ino; /* 32 bits */ Modified: trunk/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/i386/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/ia64/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -4,6 +4,10 @@ #ifndef _ASM_IA64_STAT_H #define _ASM_IA64_STAT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* * Modified 1998, 1999 * David Mosberger-Tang , Hewlett-Packard Co Modified: trunk/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/m68k/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/microblaze/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -3,6 +3,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + struct kernel_stat { __kernel_dev_t st_dev; Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/nios2/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/nios2/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/nios2/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/powerpc/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/sh/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/sh/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/sh/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/sh64/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/sh64/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/sh64/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -3,6 +3,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + struct kernel_stat { unsigned short st_dev; unsigned short __pad1; Modified: trunk/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/sparc/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct kernel_stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/v850/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/v850/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/v850/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -3,6 +3,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + struct kernel_stat { __kernel_dev_t st_dev; Modified: trunk/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/vax/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -1,6 +1,10 @@ #ifndef _BITS_STAT_STRUCT_H #define _BITS_STAT_STRUCT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + /* This file provides whatever this particular arch's kernel thinks * struct stat should look like... It turns out each arch has a * different opinion on the subject... */ Modified: trunk/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h 2006-12-06 15:29:00 UTC (rev 16788) +++ trunk/uClibc/libc/sysdeps/linux/x86_64/bits/kernel_stat.h 2006-12-06 20:22:42 UTC (rev 16789) @@ -4,6 +4,10 @@ #ifndef _ASM_X86_64_STAT_H #define _ASM_X86_64_STAT_H +#ifndef _LIBC +#error bits/kernel_stat.h is for internal uClibc use only! +#endif + #define STAT_HAVE_NSEC 1 struct kernel_stat { From andersen at uclibc.org Wed Dec 6 12:46:21 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Wed, 6 Dec 2006 12:46:21 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/common Message-ID: <20061206204621.0372548582@busybox.net> Author: andersen Date: 2006-12-06 12:46:21 -0800 (Wed, 06 Dec 2006) New Revision: 16790 Log: prepare to later remove bits/kernel_types.h from bits/types.h Modified: trunk/uClibc/libc/sysdeps/linux/common/getdents.c trunk/uClibc/libc/sysdeps/linux/common/getdents64.c Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/common/getdents.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/getdents.c 2006-12-06 20:22:42 UTC (rev 16789) +++ trunk/uClibc/libc/sysdeps/linux/common/getdents.c 2006-12-06 20:46:21 UTC (rev 16790) @@ -15,6 +15,7 @@ #include #include #include +#include /* With newer versions of linux, the getdents syscall returns d_type * information after the name field. Someday, we should add support for Modified: trunk/uClibc/libc/sysdeps/linux/common/getdents64.c =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/getdents64.c 2006-12-06 20:22:42 UTC (rev 16789) +++ trunk/uClibc/libc/sysdeps/linux/common/getdents64.c 2006-12-06 20:46:21 UTC (rev 16790) @@ -16,6 +16,7 @@ #include #include #include +#include #if defined __UCLIBC_HAS_LFS__ && defined __NR_getdents64 From andersen at uclibc.org Wed Dec 6 13:46:57 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Wed, 6 Dec 2006 13:46:57 -0800 (PST) Subject: svn commit: trunk/uClibc/libc/sysdeps/linux/mips/bits Message-ID: <20061206214657.3E0DB4858F@busybox.net> Author: andersen Date: 2006-12-06 13:46:56 -0800 (Wed, 06 Dec 2006) New Revision: 16791 Log: update from mjn3 Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h Changeset: Modified: trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h 2006-12-06 20:46:21 UTC (rev 16790) +++ trunk/uClibc/libc/sysdeps/linux/mips/bits/socket.h 2006-12-06 21:46:56 UTC (rev 16791) @@ -268,8 +268,8 @@ + CMSG_ALIGN (sizeof (struct cmsghdr))) #define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len)) -extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr, - struct cmsghdr *__cmsg) __THROW; +extern struct cmsghdr * __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, + struct cmsghdr *__cmsg)) __THROW; #ifdef __USE_EXTERN_INLINES # ifndef _EXTERN_INLINE # define _EXTERN_INLINE extern __inline From andersen at uclibc.org Wed Dec 6 14:41:22 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Wed, 6 Dec 2006 14:41:22 -0800 (PST) Subject: svn commit: trunk/uClibc/libc: stdio sysdeps/linux/common/bits Message-ID: <20061206224122.80DB84858E@busybox.net> Author: andersen Date: 2006-12-06 14:41:21 -0800 (Wed, 06 Dec 2006) New Revision: 16793 Log: stdio update from mjn3 Modified: trunk/uClibc/libc/stdio/_READ.c trunk/uClibc/libc/stdio/_WRITE.c trunk/uClibc/libc/stdio/_fopen.c trunk/uClibc/libc/stdio/_stdio.c trunk/uClibc/libc/stdio/_stdio.h trunk/uClibc/libc/stdio/_vfprintf.c trunk/uClibc/libc/stdio/fclose.c trunk/uClibc/libc/stdio/fcloseall.c trunk/uClibc/libc/stdio/fflush.c trunk/uClibc/libc/stdio/flockfile.c trunk/uClibc/libc/stdio/freopen.c trunk/uClibc/libc/stdio/ftello.c trunk/uClibc/libc/stdio/ftrylockfile.c trunk/uClibc/libc/stdio/funlockfile.c trunk/uClibc/libc/stdio/setvbuf.c trunk/uClibc/libc/stdio/vdprintf.c trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h Changeset: Modified: trunk/uClibc/libc/stdio/_READ.c =================================================================== --- trunk/uClibc/libc/stdio/_READ.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/_READ.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -44,7 +44,7 @@ #warning EINTR? #endif /* RETRY: */ - if ((rv = __READ(stream, buf, bufsize)) <= 0) { + if ((rv = __READ(stream, (char *) buf, bufsize)) <= 0) { if (rv == 0) { __STDIO_STREAM_SET_EOF(stream); } else { Modified: trunk/uClibc/libc/stdio/_WRITE.c =================================================================== --- trunk/uClibc/libc/stdio/_WRITE.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/_WRITE.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -49,7 +49,7 @@ return bufsize; } stodo = (todo <= SSIZE_MAX) ? todo : SSIZE_MAX; - if ((rv = __WRITE(stream, buf, stodo)) >= 0) { + if ((rv = __WRITE(stream, (char *) buf, stodo)) >= 0) { #ifdef __UCLIBC_MJN3_ONLY__ #warning TODO: Make custom stream write return check optional. #endif Modified: trunk/uClibc/libc/stdio/_fopen.c =================================================================== --- trunk/uClibc/libc/stdio/_fopen.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/_fopen.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -198,11 +198,24 @@ #endif #ifdef __STDIO_HAS_OPENLIST - __STDIO_THREADLOCK_OPENLIST; - stream->__nextopen = _stdio_openlist; /* New files are inserted at */ - _stdio_openlist = stream; /* the head of the list. */ - __STDIO_THREADUNLOCK_OPENLIST; +#if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS) + if (!(stream->__modeflags & __FLAG_FREEFILE)) + { + /* An freopen call so the file was never removed from the list. */ + } + else #endif + { + /* We have to lock the del mutex in case another thread wants to fclose() + * the last file. */ + __STDIO_THREADLOCK_OPENLIST_DEL; + __STDIO_THREADLOCK_OPENLIST_ADD; + stream->__nextopen = _stdio_openlist; /* New files are inserted at */ + _stdio_openlist = stream; /* the head of the list. */ + __STDIO_THREADUNLOCK_OPENLIST_ADD; + __STDIO_THREADUNLOCK_OPENLIST_DEL; + } +#endif __STDIO_STREAM_VALIDATE(stream); Modified: trunk/uClibc/libc/stdio/_stdio.c =================================================================== --- trunk/uClibc/libc/stdio/_stdio.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/_stdio.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -154,8 +154,12 @@ FILE *_stdio_openlist = _stdio_streams; # ifdef __UCLIBC_HAS_THREADS__ -pthread_mutex_t _stdio_openlist_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; -int _stdio_openlist_delflag = 0; +pthread_mutex_t _stdio_openlist_add_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +#ifdef __STDIO_BUFFERS +pthread_mutex_t _stdio_openlist_del_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +volatile int _stdio_openlist_use_count = 0; +int _stdio_openlist_del_count = 0; +#endif # endif #endif @@ -187,7 +191,11 @@ * locked, then I suppose there is a chance that a pointer in the * chain might be corrupt due to a partial store. */ - __stdio_init_mutex(&_stdio_openlist_lock); + __stdio_init_mutex(&_stdio_openlist_add_lock); +#warning check +#ifdef __STDIO_BUFFERS + __stdio_init_mutex(&_stdio_openlist_del_lock); +#endif /* Next we need to worry about the streams themselves. If a stream * is currently locked, then it may be in an invalid state. So we @@ -195,7 +203,7 @@ * Then we reinitialize the locks. */ for (ptr = _stdio_openlist ; ptr ; ptr = ptr->__nextopen ) { - if (__STDIO_ALWAYS_THREADTRYLOCK(ptr)) { + if (__STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(ptr)) { /* The stream is already locked, so we don't want to touch it. * However, if we have custom streams, we can't just close it * or leave it locked since a custom stream may be stacked Modified: trunk/uClibc/libc/stdio/_stdio.h =================================================================== --- trunk/uClibc/libc/stdio/_stdio.h 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/_stdio.h 2006-12-06 22:41:21 UTC (rev 16793) @@ -23,22 +23,78 @@ #ifdef __UCLIBC_HAS_THREADS__ #include -#define __STDIO_THREADLOCK_OPENLIST \ - __pthread_mutex_lock(&_stdio_openlist_lock) +#define __STDIO_THREADLOCK_OPENLIST_ADD \ + do { \ + struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ + _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ + __pthread_mutex_unlock, \ + &_stdio_openlist_add_lock); \ + __pthread_mutex_lock(&_stdio_openlist_add_lock); \ -#define __STDIO_THREADUNLOCK_OPENLIST \ - __pthread_mutex_unlock(&_stdio_openlist_lock) +#define __STDIO_THREADUNLOCK_OPENLIST_ADD \ + _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1); \ + } while (0) -#define __STDIO_THREADTRYLOCK_OPENLIST \ - __pthread_mutex_trylock(&_stdio_openlist_lock) -#else +#ifdef __STDIO_BUFFERS -#define __STDIO_THREADLOCK_OPENLIST ((void)0) -#define __STDIO_THREADUNLOCK_OPENLIST ((void)0) +#define __STDIO_THREADLOCK_OPENLIST_DEL \ + do { \ + struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ + _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ + __pthread_mutex_unlock, \ + &_stdio_openlist_del_lock); \ + __pthread_mutex_lock(&_stdio_openlist_del_lock); \ +#define __STDIO_THREADUNLOCK_OPENLIST_DEL \ + _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1); \ + } while (0) + +#define __STDIO_OPENLIST_INC_USE \ +do { \ + __STDIO_THREADLOCK_OPENLIST_DEL; \ + ++_stdio_openlist_use_count; \ + __STDIO_THREADUNLOCK_OPENLIST_DEL; \ +} while (0) + +extern void _stdio_openlist_dec_use(void); + +#define __STDIO_OPENLIST_DEC_USE \ + _stdio_openlist_dec_use() + +#define __STDIO_OPENLIST_INC_DEL_CNT \ +do { \ + __STDIO_THREADLOCK_OPENLIST_DEL; \ + ++_stdio_openlist_del_count; \ + __STDIO_THREADUNLOCK_OPENLIST_DEL; \ +} while (0) + +#define __STDIO_OPENLIST_DEC_DEL_CNT \ +do { \ + __STDIO_THREADLOCK_OPENLIST_DEL; \ + --_stdio_openlist_del_count; \ + __STDIO_THREADUNLOCK_OPENLIST_DEL; \ +} while (0) + #endif +#endif /* __UCLIBC_HAS_THREADS__ */ + +#ifndef __STDIO_THREADLOCK_OPENLIST_ADD +#define __STDIO_THREADLOCK_OPENLIST_ADD ((void)0) +#define __STDIO_THREADUNLOCK_OPENLIST_ADD ((void)0) +#endif + +#ifndef __STDIO_THREADLOCK_OPENLIST_DEL +#define __STDIO_THREADLOCK_OPENLIST_DEL ((void)0) +#define __STDIO_THREADUNLOCK_OPENLIST_DEL ((void)0) +/* #define __STDIO_OPENLIST_USE_CNT() (0) */ +#define __STDIO_OPENLIST_INC_USE ((void)0) +#define __STDIO_OPENLIST_DEC_USE ((void)0) +#define __STDIO_OPENLIST_INC_DEL_CNT ((void)0) +#define __STDIO_OPENLIST_DEC_DEL_CNT ((void)0) +#endif + #define __UNDEFINED_OR_NONPORTABLE ((void)0) /**********************************************************************/ Modified: trunk/uClibc/libc/stdio/_vfprintf.c =================================================================== --- trunk/uClibc/libc/stdio/_vfprintf.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/_vfprintf.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -1234,7 +1234,7 @@ } len = buflen; } - return r + OUTNSTR(fp, (const char *) buf, len); + return r + OUTNSTR(fp, (const unsigned char *) buf, len); } #endif /* __STDIO_PRINTF_FLOAT */ Modified: trunk/uClibc/libc/stdio/fclose.c =================================================================== --- trunk/uClibc/libc/stdio/fclose.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/fclose.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -16,30 +16,36 @@ int rv = 0; __STDIO_AUTO_THREADLOCK_VAR; - /* First, remove the file from the open file list. */ -#ifdef __STDIO_HAS_OPENLIST - { - register FILE *ptr; +#ifdef __UCLIBC_MJN3_ONLY__ +#warning REMINDER: dead code... but may want to simply check and not remove +#endif +/* #ifdef __STDIO_HAS_OPENLIST */ +/* #if !defined(__UCLIBC_HAS_THREADS__) || !defined(__STDIO_BUFFERS) */ +/* /\* First, remove the file from the open file list. *\/ */ +/* { */ +/* register FILE *ptr; */ - __STDIO_THREADLOCK_OPENLIST; - if ((ptr = _stdio_openlist) == stream) { - _stdio_openlist = stream->__nextopen; - } else { - while (ptr) { - if (ptr->__nextopen == stream) { - ptr->__nextopen = stream->__nextopen; - break; - } - ptr = ptr->__nextopen; - } - } - __STDIO_THREADUNLOCK_OPENLIST; +/* __STDIO_THREADLOCK_OPENLIST; */ +/* if ((ptr = _stdio_openlist) == stream) { */ +/* #warning does a mod!!! */ +/* _stdio_openlist = stream->__nextopen; */ +/* } else { */ +/* while (ptr) { */ +/* if (ptr->__nextopen == stream) { */ +/* ptr->__nextopen = stream->__nextopen; */ +/* break; */ +/* } */ +/* ptr = ptr->__nextopen; */ +/* } */ +/* } */ +/* __STDIO_THREADUNLOCK_OPENLIST; */ - if (!ptr) { /* Did not find stream in the open file list! */ - return EOF; - } - } -#endif +/* if (!ptr) { /\* Did not find stream in the open file list! *\/ */ +/* return EOF; */ +/* } */ +/* } */ +/* #endif */ +/* #endif */ __STDIO_AUTO_THREADLOCK(stream); @@ -62,6 +68,11 @@ * Since a file can't be both readonly and writeonly, that makes * an effective signal. It also has the benefit of disabling * transitions to either reading or writing. */ +#if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS) + /* Before we mark the file as closed, make sure we increment the openlist use count + * so it isn't freed under us while still cleaning up. */ + __STDIO_OPENLIST_INC_USE; +#endif stream->__modeflags &= (__FLAG_FREEBUF|__FLAG_FREEFILE); stream->__modeflags |= (__FLAG_READONLY|__FLAG_WRITEONLY); @@ -84,7 +95,16 @@ __STDIO_AUTO_THREADUNLOCK(stream); __STDIO_STREAM_FREE_BUFFER(stream); +#ifdef __UCLIBC_MJN3_ONLY__ +#warning REMINDER: inefficient - locks and unlocks twice and walks whole list +#endif +#if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS) + /* inefficient - locks/unlocks twice and walks whole list */ + __STDIO_OPENLIST_INC_DEL_CNT; + __STDIO_OPENLIST_DEC_USE; /* This with free the file if necessary. */ +#else __STDIO_STREAM_FREE_FILE(stream); +#endif return rv; } Modified: trunk/uClibc/libc/stdio/fcloseall.c =================================================================== --- trunk/uClibc/libc/stdio/fcloseall.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/fcloseall.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -24,15 +24,40 @@ #ifdef __STDIO_HAS_OPENLIST int retval = 0; + FILE *f; - __STDIO_THREADLOCK_OPENLIST; - while (_stdio_openlist) { - if (fclose(_stdio_openlist)) { - retval = EOF; + __STDIO_OPENLIST_INC_USE; + +#ifdef __UCLIBC_MJN3_ONLY__ +#warning REMINDER: should probably have a get_head() operation +#endif + __STDIO_THREADLOCK_OPENLIST_ADD; + f = _stdio_openlist; + __STDIO_THREADUNLOCK_OPENLIST_ADD; + + while (f) { +#ifdef __UCLIBC_MJN3_ONLY__ +#warning REMINDER: should probably have a get_next() operation +#endif + FILE *n = f->__nextopen; + __STDIO_AUTO_THREADLOCK_VAR; + + __STDIO_AUTO_THREADLOCK(f); + /* Only call fclose on the stream if it is not already closed. */ + if ((f->__modeflags & (__FLAG_READONLY|__FLAG_WRITEONLY)) + != (__FLAG_READONLY|__FLAG_WRITEONLY) + ) { + if (fclose(f)) { + retval = EOF; + } } + __STDIO_AUTO_THREADUNLOCK(f); + + f = n; } - __STDIO_THREADUNLOCK_OPENLIST; + __STDIO_OPENLIST_DEC_USE; + return retval; #else Modified: trunk/uClibc/libc/stdio/fflush.c =================================================================== --- trunk/uClibc/libc/stdio/fflush.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/fflush.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -18,21 +18,69 @@ #ifdef __UCLIBC_HAS_THREADS__ /* Even if the stream is set to user-locking, we still need to lock * when all (lbf) writing streams are flushed. */ -#define MY_STDIO_THREADLOCK(STREAM) \ + +#define __MY_STDIO_THREADLOCK(__stream) \ + do { \ + struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ if (_stdio_user_locking != 2) { \ - __STDIO_ALWAYS_THREADLOCK(STREAM); \ - } + _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ + __pthread_mutex_unlock, \ + &(__stream)->__lock); \ + __pthread_mutex_lock(&(__stream)->__lock); \ + } \ + ((void)0) -#define MY_STDIO_THREADUNLOCK(STREAM) \ +#define __MY_STDIO_THREADUNLOCK(__stream) \ if (_stdio_user_locking != 2) { \ - __STDIO_ALWAYS_THREADUNLOCK(STREAM); \ - } + _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1);\ + } \ + } while (0) + #else -#define MY_STDIO_THREADLOCK(STREAM) ((void)0) -#define MY_STDIO_THREADUNLOCK(STREAM) ((void)0) +#define __MY_STDIO_THREADLOCK(STREAM) ((void)0) +#define __MY_STDIO_THREADUNLOCK(STREAM) ((void)0) #endif +#if defined(__UCLIBC_HAS_THREADS__) && defined(__STDIO_BUFFERS) +void _stdio_openlist_dec_use(void) +{ + __STDIO_THREADLOCK_OPENLIST_DEL; + if ((_stdio_openlist_use_count == 1) && (_stdio_openlist_del_count > 0)) { + FILE *p = NULL; + FILE *n; + FILE *stream; +#ifdef __UCLIBC_MJN3_ONLY__ +#warning REMINDER: As an optimization, we could unlock after we move past the head. +#endif + /* Grab the openlist add lock since we might change the head of the list. */ + __STDIO_THREADLOCK_OPENLIST_ADD; + for (stream = _stdio_openlist; stream; stream = n) { + n = stream->__nextopen; +#ifdef __UCLIBC_MJN3_ONLY__ +#warning REMINDER: fix for nonatomic +#endif + if ((stream->__modeflags & (__FLAG_READONLY|__FLAG_WRITEONLY|__FLAG_FAILED_FREOPEN)) + == (__FLAG_READONLY|__FLAG_WRITEONLY) + ) { /* The file was closed and should be removed from the list. */ + if (!p) { + _stdio_openlist = n; + } else { + p->__nextopen = n; + } + __STDIO_STREAM_FREE_FILE(stream); + } else { + p = stream; + } + } + __STDIO_THREADUNLOCK_OPENLIST_ADD; + _stdio_openlist_del_count = 0; /* Should be clean now. */ + } + --_stdio_openlist_use_count; + __STDIO_THREADUNLOCK_OPENLIST_DEL; +} +#endif + int fflush_unlocked(register FILE *stream) { #ifdef __STDIO_BUFFERS @@ -55,23 +103,39 @@ } if (!stream) { /* Flush all (lbf) writing streams. */ - __STDIO_THREADLOCK_OPENLIST; - for (stream = _stdio_openlist; stream ; stream = stream->__nextopen) { - MY_STDIO_THREADLOCK(stream); - if (!(((stream->__modeflags | bufmask) - ^ (__FLAG_WRITING|__FLAG_LBF) - ) & (__FLAG_WRITING|__MASK_BUFMODE)) - ) { - if (!__STDIO_COMMIT_WRITE_BUFFER(stream)) { - __STDIO_STREAM_DISABLE_PUTC(stream); - __STDIO_STREAM_CLEAR_WRITING(stream); - } else { - retval = EOF; + + __STDIO_OPENLIST_INC_USE; + + __STDIO_THREADLOCK_OPENLIST_ADD; + stream = _stdio_openlist; + __STDIO_THREADUNLOCK_OPENLIST_ADD; + + while(stream) { + /* We only care about currently writing streams and do not want to + * block trying to obtain mutexes on non-writing streams. */ +#warning fix for nonatomic +#warning unnecessary check if no threads + if (__STDIO_STREAM_IS_WRITING(stream)) { /* ONLY IF ATOMIC!!! */ + __MY_STDIO_THREADLOCK(stream); + /* Need to check again once we have the lock. */ + if (!(((stream->__modeflags | bufmask) + ^ (__FLAG_WRITING|__FLAG_LBF) + ) & (__FLAG_WRITING|__MASK_BUFMODE)) + ) { + if (!__STDIO_COMMIT_WRITE_BUFFER(stream)) { + __STDIO_STREAM_DISABLE_PUTC(stream); + __STDIO_STREAM_CLEAR_WRITING(stream); + } else { + retval = EOF; + } } + __MY_STDIO_THREADUNLOCK(stream); } - MY_STDIO_THREADUNLOCK(stream); + stream = stream->__nextopen; } - __STDIO_THREADUNLOCK_OPENLIST; + + __STDIO_OPENLIST_DEC_USE; + } else if (__STDIO_STREAM_IS_WRITING(stream)) { if (!__STDIO_COMMIT_WRITE_BUFFER(stream)) { __STDIO_STREAM_DISABLE_PUTC(stream); Modified: trunk/uClibc/libc/stdio/flockfile.c =================================================================== --- trunk/uClibc/libc/stdio/flockfile.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/flockfile.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -11,6 +11,6 @@ { __STDIO_STREAM_VALIDATE(stream); - __STDIO_ALWAYS_THREADLOCK(stream); + __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(stream); } Modified: trunk/uClibc/libc/stdio/freopen.c =================================================================== --- trunk/uClibc/libc/stdio/freopen.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/freopen.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -37,6 +37,8 @@ __STDIO_STREAM_VALIDATE(stream); + __STDIO_OPENLIST_INC_USE; /* Do not remove the file from the list. */ + /* First, flush and close, but don't deallocate, the stream. */ /* This also removes the stream for the open file list. */ dynmode = (stream->__modeflags & (__FLAG_FREEBUF|__FLAG_FREEFILE)); @@ -48,13 +50,26 @@ != (__FLAG_READONLY|__FLAG_WRITEONLY) ) { fclose(stream); /* Failures are ignored. */ + /* NOTE: fclose always does __STDIO_OPENLIST_INC_DEL_CNT. But we don't + * want to remove this FILE from the open list, even if the freopen fails. + * Consider the case of a failed freopen() on stdin. You probably still + * want to be able to call freopen() again. Similarly for other "malloc'd" + * streams. */ + __STDIO_OPENLIST_DEC_DEL_CNT; } fp = _stdio_fopen(((intptr_t) filename), mode, stream, FILEDES_ARG); + if (!fp) { + /* Don't remove stream from the open file list and (potentially) free it. + * See _stdio_openlist_dec_use() in fflush.c. */ + stream->__modeflags = __FLAG_READONLY|__FLAG_WRITEONLY|__FLAG_FAILED_FREOPEN; + } /* Reset the allocation flags. */ stream->__modeflags |= dynmode; + __STDIO_OPENLIST_DEC_USE; + __STDIO_AUTO_THREADUNLOCK(stream); return fp; Modified: trunk/uClibc/libc/stdio/ftello.c =================================================================== --- trunk/uClibc/libc/stdio/ftello.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/ftello.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -39,7 +39,10 @@ __STDIO_STREAM_VALIDATE(stream); - if ((__SEEK(stream, &pos, SEEK_CUR) < 0) + if ((__SEEK(stream, &pos, + ((__STDIO_STREAM_IS_WRITING(stream) + && (stream->__modeflags & __FLAG_APPEND)) + ? SEEK_END : SEEK_CUR)) < 0) || (__stdio_adjust_position(stream, &pos) < 0)) { pos = -1; } Modified: trunk/uClibc/libc/stdio/ftrylockfile.c =================================================================== --- trunk/uClibc/libc/stdio/ftrylockfile.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/ftrylockfile.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -15,5 +15,5 @@ { __STDIO_STREAM_VALIDATE(stream); - return __STDIO_ALWAYS_THREADTRYLOCK(stream); + return __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(stream); } Modified: trunk/uClibc/libc/stdio/funlockfile.c =================================================================== --- trunk/uClibc/libc/stdio/funlockfile.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/funlockfile.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -11,5 +11,5 @@ { __STDIO_STREAM_VALIDATE(stream); - __STDIO_ALWAYS_THREADUNLOCK(stream); + __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(stream); } Modified: trunk/uClibc/libc/stdio/setvbuf.c =================================================================== --- trunk/uClibc/libc/stdio/setvbuf.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/setvbuf.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -76,8 +76,8 @@ } stream->__modeflags |= alloc_flag; - stream->__bufstart = buf; - stream->__bufend = buf + size; + stream->__bufstart = (unsigned char *) buf; + stream->__bufend = (unsigned char *) buf + size; __STDIO_STREAM_INIT_BUFREAD_BUFPOS(stream); __STDIO_STREAM_DISABLE_GETC(stream); __STDIO_STREAM_DISABLE_PUTC(stream); Modified: trunk/uClibc/libc/stdio/vdprintf.c =================================================================== --- trunk/uClibc/libc/stdio/vdprintf.c 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/stdio/vdprintf.c 2006-12-06 22:41:21 UTC (rev 16793) @@ -22,8 +22,8 @@ #ifdef __STDIO_BUFFERS char buf[64]; /* TODO: provide _optional_ buffering? */ - f.__bufend = buf + sizeof(buf); - f.__bufstart = buf; + f.__bufend = (unsigned char *) buf + sizeof(buf); + f.__bufstart = (unsigned char *) buf; __STDIO_STREAM_DISABLE_GETC(&f); __STDIO_STREAM_DISABLE_PUTC(&f); __STDIO_STREAM_INIT_BUFREAD_BUFPOS(&f); Modified: trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h =================================================================== --- trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h 2006-12-06 21:51:59 UTC (rev 16792) +++ trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h 2006-12-06 22:41:21 UTC (rev 16793) @@ -148,24 +148,47 @@ #define __STDIO_AUTO_THREADLOCK_VAR int __infunc_user_locking #define __STDIO_AUTO_THREADLOCK(__stream) \ + do { \ + struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ if ((__infunc_user_locking = (__stream)->__user_locking) == 0) { \ + _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ + __pthread_mutex_unlock, \ + &(__stream)->__lock); \ __pthread_mutex_lock(&(__stream)->__lock); \ - } + } \ + ((void)0) #define __STDIO_AUTO_THREADUNLOCK(__stream) \ if (__infunc_user_locking == 0) { \ - __pthread_mutex_unlock(&(__stream)->__lock); \ - } + _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1);\ + } \ + } while (0) #define __STDIO_SET_USER_LOCKING(__stream) ((__stream)->__user_locking = 1) #define __STDIO_ALWAYS_THREADLOCK(__stream) \ + do { \ + struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ + _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ + __pthread_mutex_unlock, \ + &(__stream)->__lock); \ + __pthread_mutex_lock(&(__stream)->__lock); \ + ((void)0) + +/* #define __STDIO_ALWAYS_THREADTRYLOCK(__stream) \ */ +/* __pthread_mutex_trylock(&(__stream)->__lock) */ + +#define __STDIO_ALWAYS_THREADUNLOCK(__stream) \ + _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1); \ + } while (0) + +#define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream) \ __pthread_mutex_lock(&(__stream)->__lock) -#define __STDIO_ALWAYS_THREADTRYLOCK(__stream) \ +#define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream) \ __pthread_mutex_trylock(&(__stream)->__lock) -#define __STDIO_ALWAYS_THREADUNLOCK(__stream) \ +#define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream) \ __pthread_mutex_unlock(&(__stream)->__lock) #else /* __UCLIBC_HAS_THREADS__ */ @@ -178,9 +201,13 @@ #define __STDIO_SET_USER_LOCKING(__stream) ((void)0) #define __STDIO_ALWAYS_THREADLOCK(__stream) ((void)0) -#define __STDIO_ALWAYS_THREADTRYLOCK(__stream) (0) /* Always succeed. */ +/* #define __STDIO_ALWAYS_THREADTRYLOCK(__stream) (0) /\* Always succeed. *\/ */ #define __STDIO_ALWAYS_THREADUNLOCK(__stream) ((void)0) +#define __STDIO_ALWAYS_THREADLOCK_CANCEL_UNSAFE(__stream) ((void)0) +#define __STDIO_ALWAYS_THREADTRYLOCK_CANCEL_UNSAFE(__stream) (0) /* Ok? */ +#define __STDIO_ALWAYS_THREADUNLOCK_CANCEL_UNSAFE(__stream) ((void)0) + #endif /* __UCLIBC_HAS_THREADS__ */ /**********************************************************************/ @@ -343,6 +370,7 @@ #define __FLAG_FREEFILE 0x2000U #define __FLAG_FREEBUF 0x4000U #define __FLAG_LARGEFILE 0x8000U /* fixed! == 0_LARGEFILE for linux */ +#define __FLAG_FAILED_FREOPEN __FLAG_LARGEFILE /* Note: In no-buffer mode, it would be possible to pack the necessary * flags into one byte. Since we wouldn't be buffering and there would @@ -371,8 +399,12 @@ extern struct __STDIO_FILE_STRUCT *_stdio_openlist; #ifdef __UCLIBC_HAS_THREADS__ -extern pthread_mutex_t _stdio_openlist_lock; -extern int _stdio_openlist_delflag; +extern pthread_mutex_t _stdio_openlist_add_lock; +#ifdef __STDIO_BUFFERS +extern pthread_mutex_t _stdio_openlist_del_lock; +extern volatile int _stdio_openlist_use_count; /* _stdio_openlist_del_lock */ +extern int _stdio_openlist_del_count; /* _stdio_openlist_del_lock */ +#endif extern int _stdio_user_locking; /* #ifdef _LIBC */ extern void __stdio_init_mutex(pthread_mutex_t *m) attribute_hidden; From andersen at uclibc.org Thu Dec 7 15:24:04 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Thu, 7 Dec 2006 15:24:04 -0800 (PST) Subject: svn commit: trunk/uClibc: include libc/inet libc/inet/rpc libc/mis etc... Message-ID: <20061207232404.C9BB1485A8@busybox.net> Author: andersen Date: 2006-12-07 15:24:02 -0800 (Thu, 07 Dec 2006) New Revision: 16801 Log: Major cleanup of internal mutex locking. Be more consistant in how we do things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking. Added: trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_mutex.h Modified: trunk/uClibc/include/printf.h trunk/uClibc/libc/inet/getnetent.c trunk/uClibc/libc/inet/getproto.c trunk/uClibc/libc/inet/getservice.c trunk/uClibc/libc/inet/resolv.c trunk/uClibc/libc/inet/rpc/create_xid.c trunk/uClibc/libc/misc/dirent/closedir.c trunk/uClibc/libc/misc/dirent/dirstream.h trunk/uClibc/libc/misc/dirent/readdir.c trunk/uClibc/libc/misc/dirent/readdir64.c trunk/uClibc/libc/misc/dirent/readdir64_r.c trunk/uClibc/libc/misc/dirent/readdir_r.c trunk/uClibc/libc/misc/dirent/rewinddir.c trunk/uClibc/libc/misc/dirent/seekdir.c trunk/uClibc/libc/misc/mntent/mntent.c trunk/uClibc/libc/misc/pthread/weaks.c trunk/uClibc/libc/misc/syslog/syslog.c trunk/uClibc/libc/misc/time/time.c trunk/uClibc/libc/misc/ttyent/getttyent.c trunk/uClibc/libc/misc/utmp/utent.c trunk/uClibc/libc/pwd_grp/lckpwdf.c trunk/uClibc/libc/pwd_grp/pwd_grp.c trunk/uClibc/libc/stdio/popen.c trunk/uClibc/libc/stdlib/_atexit.c trunk/uClibc/libc/stdlib/abort.c trunk/uClibc/libc/stdlib/malloc-simple/alloc.c trunk/uClibc/libc/stdlib/malloc-standard/calloc.c trunk/uClibc/libc/stdlib/malloc-standard/free.c trunk/uClibc/libc/stdlib/malloc-standard/mallinfo.c trunk/uClibc/libc/stdlib/malloc-standard/malloc.c trunk/uClibc/libc/stdlib/malloc-standard/malloc.h trunk/uClibc/libc/stdlib/malloc-standard/mallopt.c trunk/uClibc/libc/stdlib/malloc-standard/memalign.c trunk/uClibc/libc/stdlib/malloc-standard/realloc.c trunk/uClibc/libc/stdlib/random.c trunk/uClibc/libc/stdlib/setenv.c trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h trunk/uClibc/libc/sysdeps/linux/common/sigprocmask.c Changeset: Sorry, the patch is too large to include (4620 lines). Please use ViewCVS to see it! http://uclibc.org/cgi-bin/viewcvs.cgi?view=rev&root=svn&rev=16801 From andersen at uclibc.org Thu Dec 7 15:24:20 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Thu, 7 Dec 2006 15:24:20 -0800 (PST) Subject: svn commit: trunk/uClibc/libc: inet/rpc stdio stdlib/malloc Message-ID: <20061207232420.15DD7485A8@busybox.net> Author: andersen Date: 2006-12-07 15:24:19 -0800 (Thu, 07 Dec 2006) New Revision: 16802 Log: Major cleanup of internal mutex locking. Be more consistant in how we do things, and avoid potential deadlocks caused when a thread holding a uClibc internal lock get canceled and terminates without releasing the lock. This change also provides a single place, bits/uClibc_mutex.h, for thread libraries to modify to change all instances of internal locking. Modified: trunk/uClibc/libc/inet/rpc/getrpcent.c trunk/uClibc/libc/stdio/_stdio.c trunk/uClibc/libc/stdlib/malloc/heap.h trunk/uClibc/libc/stdlib/malloc/malloc.h Changeset: Modified: trunk/uClibc/libc/inet/rpc/getrpcent.c =================================================================== --- trunk/uClibc/libc/inet/rpc/getrpcent.c 2006-12-07 23:24:02 UTC (rev 16801) +++ trunk/uClibc/libc/inet/rpc/getrpcent.c 2006-12-07 23:24:19 UTC (rev 16802) @@ -7,23 +7,23 @@ * may copy or modify Sun RPC without charge, but are not authorized * to license or distribute it to anyone else except as part of a product or * program developed by the user. - * + * * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * + * * Sun RPC is provided with no support and without any obligation on the * part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. - * + * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC * OR ANY PART THEREOF. - * + * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. - * + * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 @@ -275,14 +275,11 @@ #if defined(__UCLIBC_HAS_REENTRANT_RPC__) -#if defined(__UCLIBC_HAS_THREADS__) -# include -static pthread_mutex_t rpcdata_lock = PTHREAD_MUTEX_INITIALIZER; -#endif -#define LOCK __pthread_mutex_lock(&rpcdata_lock) -#define UNLOCK __pthread_mutex_unlock(&rpcdata_lock) +#include +__UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER); -static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buffer, + +static int __copy_rpcent(struct rpcent *r, struct rpcent *result_buf, char *buffer, size_t buflen, struct rpcent **result) { size_t i, s; @@ -298,7 +295,7 @@ result_buf->r_number = r->r_number; - /* copy the aliases ... need to not only copy the alias strings, + /* copy the aliases ... need to not only copy the alias strings, * but the array of pointers to the alias strings */ i = 0; while (r->r_aliases[i++]) ; @@ -339,9 +336,9 @@ size_t buflen, struct rpcent **result) { int ret; - LOCK; + __UCLIBC_MUTEX_LOCK(mylock); ret = __copy_rpcent(getrpcbynumber(number), result_buf, buffer, buflen, result); - UNLOCK; + __UCLIBC_MUTEX_UNLOCK(mylock); return ret; } @@ -349,19 +346,19 @@ size_t buflen, struct rpcent **result) { int ret; - LOCK; + __UCLIBC_MUTEX_LOCK(mylock); ret = __copy_rpcent(getrpcbyname(name), result_buf, buffer, buflen, result); - UNLOCK; + __UCLIBC_MUTEX_UNLOCK(mylock); return ret; } -int getrpcent_r(struct rpcent *result_buf, char *buffer, +int getrpcent_r(struct rpcent *result_buf, char *buffer, size_t buflen, struct rpcent **result) { int ret; - LOCK; + __UCLIBC_MUTEX_LOCK(mylock); ret = __copy_rpcent(getrpcent(), result_buf, buffer, buflen, result); - UNLOCK; + __UCLIBC_MUTEX_UNLOCK(mylock); return ret; } Modified: trunk/uClibc/libc/stdio/_stdio.c =================================================================== --- trunk/uClibc/libc/stdio/_stdio.c 2006-12-07 23:24:02 UTC (rev 16801) +++ trunk/uClibc/libc/stdio/_stdio.c 2006-12-07 23:24:19 UTC (rev 16802) @@ -154,9 +154,9 @@ FILE *_stdio_openlist = _stdio_streams; # ifdef __UCLIBC_HAS_THREADS__ -pthread_mutex_t _stdio_openlist_add_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +__UCLIBC_MUTEX_INIT(_stdio_openlist_add_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); #ifdef __STDIO_BUFFERS -pthread_mutex_t _stdio_openlist_del_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; +__UCLIBC_MUTEX_INIT(_stdio_openlist_del_lock, PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); volatile int _stdio_openlist_use_count = 0; int _stdio_openlist_del_count = 0; #endif @@ -169,10 +169,10 @@ /* 2 if threading not initialized and 0 otherwise; */ int _stdio_user_locking = 2; -void attribute_hidden __stdio_init_mutex(pthread_mutex_t *m) +void attribute_hidden __stdio_init_mutex(__UCLIBC_MUTEX_TYPE *m) { - static const pthread_mutex_t __stdio_mutex_initializer - = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; + const __UCLIBC_MUTEX_STATIC(__stdio_mutex_initializer, + PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP); memcpy(m, &__stdio_mutex_initializer, sizeof(__stdio_mutex_initializer)); } @@ -190,7 +190,7 @@ /* First, make sure the open file list is unlocked. If it was * locked, then I suppose there is a chance that a pointer in the * chain might be corrupt due to a partial store. - */ + */ __stdio_init_mutex(&_stdio_openlist_add_lock); #warning check #ifdef __STDIO_BUFFERS @@ -214,7 +214,7 @@ __STDIO_STREAM_DISABLE_PUTC(ptr); __STDIO_STREAM_INIT_BUFREAD_BUFPOS(ptr); } - + ptr->__user_locking = 1; /* Set locking mode to "by caller". */ __stdio_init_mutex(&ptr->__lock); /* Shouldn't be necessary, but... */ } Modified: trunk/uClibc/libc/stdlib/malloc/heap.h =================================================================== --- trunk/uClibc/libc/stdlib/malloc/heap.h 2006-12-07 23:24:02 UTC (rev 16801) +++ trunk/uClibc/libc/stdlib/malloc/heap.h 2006-12-07 23:24:19 UTC (rev 16802) @@ -16,7 +16,7 @@ /* On multi-threaded systems, the heap includes a lock. */ #ifdef __UCLIBC_HAS_THREADS__ -# include +# include # define HEAP_USE_LOCKING #endif @@ -39,7 +39,7 @@ /* A lock that can be used by callers to control access to the heap. The heap code _does not_ use this lock, it's merely here for the convenience of users! */ - pthread_mutex_t lock; + __UCLIBC_MUTEX_TYPE lock; #endif }; @@ -135,8 +135,8 @@ extern void __heap_check (struct heap *heap, const char *str); -#define __heap_lock(heap) __pthread_mutex_lock (&(heap)->lock) -#define __heap_unlock(heap) __pthread_mutex_unlock (&(heap)->lock) +#define __heap_lock(heap) __UCLIBC_MUTEX_LOCK (&(heap)->lock) +#define __heap_unlock(heap) __UCLIBC_MUTEX_UNLOCK (&(heap)->lock) /* Delete the free-area FA from HEAP. */ Modified: trunk/uClibc/libc/stdlib/malloc/malloc.h =================================================================== --- trunk/uClibc/libc/stdlib/malloc/malloc.h 2006-12-07 23:24:02 UTC (rev 16801) +++ trunk/uClibc/libc/stdlib/malloc/malloc.h 2006-12-07 23:24:19 UTC (rev 16802) @@ -125,11 +125,11 @@ /* Locking for multithreaded apps. */ #ifdef __UCLIBC_HAS_THREADS__ -# include +# include # define MALLOC_USE_LOCKING -typedef pthread_mutex_t malloc_mutex_t; +typedef __UCLIBC_MUTEX_TYPE malloc_mutex_t; # define MALLOC_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER # ifdef MALLOC_USE_SBRK @@ -138,8 +138,8 @@ things will break if these multiple calls are interleaved with another thread's use of sbrk!). */ extern malloc_mutex_t __malloc_sbrk_lock; -# define __malloc_lock_sbrk() __pthread_mutex_lock (&__malloc_sbrk_lock) -# define __malloc_unlock_sbrk() __pthread_mutex_unlock (&__malloc_sbrk_lock) +# define __malloc_lock_sbrk() __UCLIBC_MUTEX_LOCK (&__malloc_sbrk_lock) +# define __malloc_unlock_sbrk() __UCLIBC_MUTEX_UNLOCK (&__malloc_sbrk_lock) # endif /* MALLOC_USE_SBRK */ #else /* !__UCLIBC_HAS_THREADS__ */ From andersen at uclibc.org Thu Dec 7 16:19:37 2006 From: andersen at uclibc.org (andersen at uclibc.org) Date: Thu, 7 Dec 2006 16:19:37 -0800 (PST) Subject: svn commit: trunk/uClibc/libc: stdio sysdeps/linux/common/bits Message-ID: <20061208001937.631C4485C9@busybox.net> Author: andersen Date: 2006-12-07 16:19:36 -0800 (Thu, 07 Dec 2006) New Revision: 16803 Log: Fill in a few more of the missing pieces... Modified: trunk/uClibc/libc/stdio/_stdio.h trunk/uClibc/libc/stdio/fflush.c trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h Changeset: Modified: trunk/uClibc/libc/stdio/_stdio.h =================================================================== --- trunk/uClibc/libc/stdio/_stdio.h 2006-12-07 23:24:19 UTC (rev 16802) +++ trunk/uClibc/libc/stdio/_stdio.h 2006-12-08 00:19:36 UTC (rev 16803) @@ -20,75 +20,53 @@ #include #endif -#ifdef __UCLIBC_HAS_THREADS__ -#include +#include -#define __STDIO_THREADLOCK_OPENLIST_ADD \ - do { \ - struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ - _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ - __pthread_mutex_unlock, \ - &_stdio_openlist_add_lock); \ - __pthread_mutex_lock(&_stdio_openlist_add_lock); \ +#define __STDIO_THREADLOCK_OPENLIST_ADD \ + __UCLIBC_MUTEX_LOCK(_stdio_openlist_add_lock) -#define __STDIO_THREADUNLOCK_OPENLIST_ADD \ - _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1); \ - } while (0) +#define __STDIO_THREADUNLOCK_OPENLIST_ADD \ + __UCLIBC_MUTEX_UNLOCK(_stdio_openlist_add_lock) - #ifdef __STDIO_BUFFERS -#define __STDIO_THREADLOCK_OPENLIST_DEL \ - do { \ - struct _pthread_cleanup_buffer __infunc_pthread_cleanup_buffer; \ - _pthread_cleanup_push_defer(&__infunc_pthread_cleanup_buffer, \ - __pthread_mutex_unlock, \ - &_stdio_openlist_del_lock); \ - __pthread_mutex_lock(&_stdio_openlist_del_lock); \ +#define __STDIO_THREADLOCK_OPENLIST_DEL \ + __UCLIBC_MUTEX_LOCK(_stdio_openlist_del_lock) -#define __STDIO_THREADUNLOCK_OPENLIST_DEL \ - _pthread_cleanup_pop_restore(&__infunc_pthread_cleanup_buffer,1); \ - } while (0) +#define __STDIO_THREADUNLOCK_OPENLIST_DEL \ + __UCLIBC_MUTEX_UNLOCK(_stdio_openlist_del_lock) -#define __STDIO_OPENLIST_INC_USE \ -do { \ - __STDIO_THREADLOCK_OPENLIST_DEL; \ - ++_stdio_openlist_use_count; \ - __STDIO_THREADUNLOCK_OPENLIST_DEL; \ +#define __STDIO_OPENLIST_INC_USE \ +do { \ + __STDIO_THREADLOCK_OPENLIST_DEL; \ + ++_stdio_openlist_use_count; \ + __STDIO_THREADUNLOCK_OPENLIST_DEL; \ } while (0) extern void _stdio_openlist_dec_use(void); -#define __STDIO_OPENLIST_DEC_USE \ +#define __STDIO_OPENLIST_DEC_USE \ _stdio_openlist_dec_use() -#define __STDIO_OPENLIST_INC_DEL_CNT \ -do { \ - __STDIO_THREADLOCK_OPENLIST_DEL; \ - ++_stdio_openlist_del_count; \ - __STDIO_THREADUNLOCK_OPENLIST_DEL; \ +#define __STDIO_OPENLIST_INC_DEL_CNT \ +do { \ + __STDIO_THREADLOCK_OPENLIST_DEL; \ + ++_stdio_openlist_del_count; \ + __STDIO_THREADUNLOCK_OPENLIST_DEL; \ } while (0) -#define __STDIO_OPENLIST_DEC_DEL_CNT \ +#define __STDIO_OPENLIST_DEC_DEL_CNT \ do { \ - __STDIO_THREADLOCK_OPENLIST_DEL; \