On Tue, Aug 28, 2007 at 06:01:33PM +0900, Brian Candler wrote:
> I have narrowed the problem down further to this line in io.c:

OK, I think I have the correct solution now :-)

In Ruby changeset r2297, uClibc support was removed because configure.in was
supposedly capable of setting the relevant macros itself:
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=2296&r2=2297

However, uClibc uses __bufread and __bufpos, see
http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/uClibc/libc/sysdeps/linux/common/bits/uClibc_stdio.h?rev=17595&view=auto

and configure.in doesn't currently test for these.

The attached patch fixes it for me.

Suggested CHANGELOG:

	* configure.in: detect stdio buffer pointers for uClibc

Cheers,

Brian.
diff --exclude '*~' -uNr ruby-1.8.6-p36.orig/configure.in ruby-1.8.6-p36/configure.in
--- ruby-1.8.6-p36.orig/configure.in	2007-05-22 19:19:07.000000000 +0100
+++ ruby-1.8.6-p36/configure.in	2007-08-29 09:42:47.000000000 +0100
@@ -707,6 +707,7 @@
      __ptr	dnl
      bufpos	dnl
      _p	dnl
+     __bufpos	dnl
 ; do
     AC_TRY_COMPILE([#include <stdio.h>
 ],
@@ -726,6 +727,7 @@
     [for frend in	dnl
          _IO_read_end	dnl
          bufread 	dnl
+         __bufread 	dnl
     ; do
         AC_TRY_COMPILE([#include <stdio.h>
     ],