Rainer Orth <r...@cebitec.uni-bielefeld.de> writes:

> All go and libgo execution tests are failing for me with this patch on
> x86_64-unknown-linux-gnu (CentOS 5.5, I think):
>
> output is:
> /var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./li
> bgo/.libs/libgo.so: undefined reference to `inotify_init1'
> /var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./li
> bgo/.libs/libgo.so: undefined reference to `fallocate'
> /var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./li
> bgo/.libs/libgo.so: undefined reference to `sync_file_range'
> collect2: error: ld returned 1 exit status
>
> FAIL: go.go-torture/execute/array-1.go compilation,  -O0 

I assume that CentOS 5.5 uses some version of glibc before version 2.6.
The three functions you mention are not supported in older versions of
glibc.  Fortunately, they are not called anywhere else in the library,
so this patch takes the easy way out and simply removes them.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

diff -r c0c039af2298 libgo/go/syscall/libcall_linux.go
--- a/libgo/go/syscall/libcall_linux.go	Wed Nov 02 09:48:33 2011 -0700
+++ b/libgo/go/syscall/libcall_linux.go	Wed Nov 02 10:32:33 2011 -0700
@@ -186,8 +186,9 @@
 //sys	Faccessat(dirfd int, path string, mode uint32, flags int) (errno int)
 //faccessat(dirfd int, pathname *byte, mode int, flags int) int
 
-//sys	Fallocate(fd int, mode uint32, off int64, len int64) (errno int)
-//fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
+// FIXME: Only in glibc 2.10 and later.
+// //sys	Fallocate(fd int, mode uint32, off int64, len int64) (errno int)
+// //fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
 
 //sys	Fchmodat(dirfd int, path string, mode uint32, flags int) (errno int)
 //fchmodat(dirfd int, pathname *byte, mode Mode_t, flags int) int
@@ -223,8 +224,9 @@
 //sysnb	InotifyInit() (fd int, errno int)
 //inotify_init() int
 
-//sysnb	InotifyInit1(flags int) (fd int, errno int)
-//inotify_init1(flags int) int
+// FIXME: Only in glibc 2.9 and later.
+// //sysnb	InotifyInit1(flags int) (fd int, errno int)
+// //inotify_init1(flags int) int
 
 //sysnb	InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int)
 //inotify_rm_watch(fd int, wd uint32) int
@@ -298,8 +300,9 @@
 // //sys	Statfs(path string, buf *Statfs_t) (errno int)
 // //statfs(path *byte, buf *Statfs_t) int
 
-//sys	SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
-//sync_file_range(fd int, off Offset_t, n Offset_t, flags uint) int
+// FIXME: Only in glibc 2.6 and later.
+// //sys	SyncFileRange(fd int, off int64, n int64, flags int) (errno int)
+// //sync_file_range(fd int, off Offset_t, n Offset_t, flags uint) int
 
 // FIXME: mksysinfo Sysinfo_t
 // //sysnb	Sysinfo(info *Sysinfo_t) (errno int)

Reply via email to