* libgo patch committed: Update to weekly.2011-12-22
@ 2012-01-13 5:12 Ian Lance Taylor
2012-01-13 18:23 ` Rainer Orth
2012-01-16 17:27 ` Rainer Orth
0 siblings, 2 replies; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-13 5:12 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
I have committed a patch to libgo to update it to the weekly.2011-12-22
release. As usual I am not including all the changes here, only the
ones to files which are specific to gccgo. Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 10813 bytes --]
diff -r 27d9b39a0e27 libgo/MERGE
--- a/libgo/MERGE Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/MERGE Thu Jan 12 20:57:40 2012 -0800
@@ -1,4 +1,4 @@
-82fdc445f2ff
+4a8268927758
The first line of this file holds the Mercurial revision number of the
last merge done from the master library sources.
diff -r 27d9b39a0e27 libgo/Makefile.am
--- a/libgo/Makefile.am Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/Makefile.am Thu Jan 12 20:57:40 2012 -0800
@@ -279,8 +279,7 @@
image/gif.gox \
image/jpeg.gox \
image/png.gox \
- image/tiff.gox \
- image/ycbcr.gox
+ image/tiff.gox
toolexeclibgoindexdir = $(toolexeclibgodir)/index
@@ -586,7 +585,8 @@
go/image/format.go \
go/image/geom.go \
go/image/image.go \
- go/image/names.go
+ go/image/names.go \
+ go/image/ycbcr.go
go_io_files = \
go/io/multi.go \
@@ -654,10 +654,15 @@
go_net_fd_os_file = go/net/fd_linux.go
go_net_newpollserver_file = go/net/newpollserver.go
else # !LIBGO_IS_LINUX && !LIBGO_IS_RTEMS
+if LIBGO_IS_NETBSD
+go_net_fd_os_file = go/net/fd_netbsd.go
+go_net_newpollserver_file = go/net/newpollserver.go
+else # !LIBGO_IS_NETBSD && !LIBGO_IS_LINUX && !LIBGO_IS_RTEMS
# By default use select with pipes. Most systems should have
# something better.
go_net_fd_os_file = go/net/fd_select.go
go_net_newpollserver_file = go/net/newpollserver.go
+endif # !LIBGO_IS_NETBSD
endif # !LIBGO_IS_LINUX
endif # !LIBGO_IS_RTEMS
@@ -688,8 +693,12 @@
if LIBGO_IS_LINUX
go_net_interface_file = go/net/interface_linux.go
else
+if LIBGO_IS_NETBSD
+go_net_interface_file = go/net/interface_netbsd.go
+else
go_net_interface_file = go/net/interface_stub.go
endif
+endif
go_net_files = \
go/net/cgo_unix.go \
@@ -845,6 +854,7 @@
go/strconv/atof.go \
go/strconv/atoi.go \
go/strconv/decimal.go \
+ go/strconv/extfloat.go \
go/strconv/ftoa.go \
go/strconv/itoa.go \
go/strconv/quote.go
@@ -880,7 +890,8 @@
go_testing_files = \
go/testing/benchmark.go \
go/testing/example.go \
- go/testing/testing.go
+ go/testing/testing.go \
+ go/testing/wrapper.go
go_time_files = \
go/time/format.go \
@@ -1197,7 +1208,9 @@
go_go_doc_files = \
go/go/doc/comment.go \
go/go/doc/doc.go \
- go/go/doc/example.go
+ go/go/doc/example.go \
+ go/go/doc/exports.go \
+ go/go/doc/filter.go
go_go_parser_files = \
go/go/parser/interface.go \
go/go/parser/parser.go
@@ -1241,7 +1254,8 @@
go/image/bmp/reader.go
go_image_color_files = \
- go/image/color/color.go
+ go/image/color/color.go \
+ go/image/color/ycbcr.go
go_image_draw_files = \
go/image/draw/draw.go
@@ -1266,9 +1280,6 @@
go/image/tiff/consts.go \
go/image/tiff/reader.go
-go_image_ycbcr_files = \
- go/image/ycbcr/ycbcr.go
-
go_index_suffixarray_files = \
go/index/suffixarray/qsufsort.go \
go/index/suffixarray/suffixarray.go
@@ -1318,6 +1329,7 @@
go/net/http/filetransport.go \
go/net/http/fs.go \
go/net/http/header.go \
+ go/net/http/jar.go \
go/net/http/lex.go \
go/net/http/request.go \
go/net/http/response.go \
@@ -1761,7 +1773,6 @@
image/jpeg.lo \
image/png.lo \
image/tiff.lo \
- image/ycbcr.lo \
index/suffixarray.lo \
io/ioutil.lo \
log/syslog.lo \
@@ -3066,16 +3077,6 @@
@$(CHECK)
.PHONY: image/tiff/check
-@go_include@ image/ycbcr.lo.dep
-image/ycbcr.lo.dep: $(go_image_ycbcr_files)
- $(BUILDDEPS)
-image/ycbcr.lo: $(go_image_ycbcr_files)
- $(BUILDPACKAGE)
-image/ycbcr/check: $(CHECK_DEPS)
- @$(MKDIR_P) image/ycbcr
- @$(CHECK)
-.PHONY: image/ycbcr/check
-
@go_include@ index/suffixarray.lo.dep
index/suffixarray.lo.dep: $(go_index_suffixarray_files)
$(BUILDDEPS)
@@ -3728,8 +3729,6 @@
$(BUILDGOX)
image/tiff.gox: image/tiff.lo
$(BUILDGOX)
-image/ycbcr.gox: image/ycbcr.lo
- $(BUILDGOX)
index/suffixarray.gox: index/suffixarray.lo
$(BUILDGOX)
@@ -3938,11 +3937,11 @@
hash/crc32/check \
hash/crc64/check \
hash/fnv/check \
+ image/color/check \
image/draw/check \
image/jpeg/check \
image/png/check \
image/tiff/check \
- image/ycbcr/check \
index/suffixarray/check \
io/ioutil/check \
log/syslog/check \
diff -r 27d9b39a0e27 libgo/configure.ac
--- a/libgo/configure.ac Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/configure.ac Thu Jan 12 20:57:40 2012 -0800
@@ -134,6 +134,7 @@
*-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;;
*-*-irix6*) is_irix=yes; GOOS=irix ;;
*-*-linux*) is_linux=yes; GOOS=linux ;;
+ *-*-netbsd*) is_netbsd=yes; GOOS=netbsd ;;
*-*-rtems*) is_rtems=yes; GOOS=rtems ;;
*-*-solaris2*) is_solaris=yes; GOOS=solaris ;;
esac
@@ -141,6 +142,7 @@
AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)
AM_CONDITIONAL(LIBGO_IS_IRIX, test $is_irix = yes)
AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)
+AM_CONDITIONAL(LIBGO_IS_NETBSD, test $is_netbsd = yes)
AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)
AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)
AC_SUBST(GOOS)
diff -r 27d9b39a0e27 libgo/merge.sh
--- a/libgo/merge.sh Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/merge.sh Thu Jan 12 20:57:40 2012 -0800
@@ -168,8 +168,8 @@
merge_c $f $f
done
-merge_c linux/thread.c thread-linux.c
-merge_c linux/mem.c mem.c
+merge_c thread_linux.c thread-linux.c
+merge_c mem_linux.c mem.c
(cd ${OLDDIR}/src/pkg && find . -name '*.go' -print) | while read f; do
oldfile=${OLDDIR}/src/pkg/$f
diff -r 27d9b39a0e27 libgo/runtime/goc2c.c
--- a/libgo/runtime/goc2c.c Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/runtime/goc2c.c Thu Jan 12 20:57:40 2012 -0800
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build ignore
+
/*
* Translate a .goc file into a .c file. A .goc file is a combination
* of a limited form of Go with C.
@@ -774,6 +776,7 @@
}
}
+ printf("// AUTO-GENERATED by autogen.sh; DO NOT EDIT\n\n");
process_file();
exit(0);
}
diff -r 27d9b39a0e27 libgo/runtime/lock_futex.c
--- a/libgo/runtime/lock_futex.c Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/runtime/lock_futex.c Thu Jan 12 20:57:40 2012 -0800
@@ -2,17 +2,19 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build freebsd linux
+
#include "runtime.h"
// This implementation depends on OS-specific implementations of
//
-// runtime.futexsleep(uint32 *addr, uint32 val, int64 ns)
+// runtime_futexsleep(uint32 *addr, uint32 val, int64 ns)
// Atomically,
// if(*addr == val) sleep
// Might be woken up spuriously; that's allowed.
// Don't sleep longer than ns; ns < 0 means forever.
//
-// runtime.futexwakeup(uint32 *addr, uint32 cnt)
+// runtime_futexwakeup(uint32 *addr, uint32 cnt)
// If any procs are sleeping on addr, wake up at most cnt.
enum
diff -r 27d9b39a0e27 libgo/runtime/lock_sema.c
--- a/libgo/runtime/lock_sema.c Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/runtime/lock_sema.c Thu Jan 12 20:57:40 2012 -0800
@@ -2,21 +2,23 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build darwin netbsd openbsd plan9 windows
+
#include "runtime.h"
// This implementation depends on OS-specific implementations of
//
-// uintptr runtime.semacreate(void)
+// uintptr runtime_semacreate(void)
// Create a semaphore, which will be assigned to m->waitsema.
// The zero value is treated as absence of any semaphore,
// so be sure to return a non-zero value.
//
-// int32 runtime.semasleep(int64 ns)
+// int32 runtime_semasleep(int64 ns)
// If ns < 0, acquire m->waitsema and return 0.
// If ns >= 0, try to acquire m->waitsema for at most ns nanoseconds.
// Return 0 if the semaphore was acquired, -1 if interrupted or timed out.
//
-// int32 runtime.semawakeup(M *mp)
+// int32 runtime_semawakeup(M *mp)
// Wake up mp, which is or will soon be sleeping on mp->waitsema.
//
diff -r 27d9b39a0e27 libgo/runtime/mprof.goc
--- a/libgo/runtime/mprof.goc Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/runtime/mprof.goc Thu Jan 12 20:57:40 2012 -0800
@@ -12,8 +12,6 @@
#include "defs.h"
#include "go-type.h"
-typedef struct __go_open_array Slice;
-
// NOTE(rsc): Everything here could use cas if contention became an issue.
static Lock proflock;
diff -r 27d9b39a0e27 libgo/runtime/runtime.h
--- a/libgo/runtime/runtime.h Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/runtime/runtime.h Thu Jan 12 20:57:40 2012 -0800
@@ -196,7 +196,7 @@
/* Macros. */
-#ifdef __WINDOWS__
+#ifdef GOOS_windows
enum {
Windows = 1
};
@@ -343,7 +343,6 @@
#define runtime_printf printf
#define runtime_malloc(s) __go_alloc(s)
#define runtime_free(p) __go_free(p)
-#define runtime_memclr(buf, size) __builtin_memset((buf), 0, (size))
#define runtime_strcmp(s1, s2) __builtin_strcmp((s1), (s2))
#define runtime_mcmp(a, b, s) __builtin_memcmp((a), (b), (s))
#define runtime_memmove(a, b, s) __builtin_memmove((a), (b), (s))
@@ -352,9 +351,6 @@
void free(void *v);
struct __go_func_type;
bool runtime_addfinalizer(void*, void(*fn)(void*), const struct __go_func_type *);
-#define runtime_mmap mmap
-#define runtime_munmap munmap
-#define runtime_madvise madvise
#define runtime_cas(pval, old, new) __sync_bool_compare_and_swap (pval, old, new)
#define runtime_casp(pval, old, new) __sync_bool_compare_and_swap (pval, old, new)
#define runtime_xadd(p, v) __sync_add_and_fetch (p, v)
@@ -384,6 +380,14 @@
void runtime_LockOSThread(void) __asm__("libgo_runtime.runtime.LockOSThread");
void runtime_UnlockOSThread(void) __asm__("libgo_runtime.runtime.UnlockOSThread");
+/*
+ * low level C-called
+ */
+#define runtime_mmap mmap
+#define runtime_munmap munmap
+#define runtime_madvise madvise
+#define runtime_memclr(buf, size) __builtin_memset((buf), 0, (size))
+
struct __go_func_type;
void reflect_call(const struct __go_func_type *, const void *, _Bool, _Bool,
void **, void **)
diff -r 27d9b39a0e27 libgo/runtime/string.goc
--- a/libgo/runtime/string.goc Wed Jan 11 17:09:03 2012 -0800
+++ b/libgo/runtime/string.goc Thu Jan 12 20:57:40 2012 -0800
@@ -4,6 +4,9 @@
package runtime
#include "runtime.h"
+#include "arch.h"
+#include "malloc.h"
+
#define charntorune(pv, str, len) __go_get_rune(str, len, pv)
int32
Index: gcc/testsuite/go.test/test/fixedbugs/bug229.go
===================================================================
--- gcc/testsuite/go.test/test/fixedbugs/bug229.go (revision 182418)
+++ gcc/testsuite/go.test/test/fixedbugs/bug229.go (working copy)
@@ -12,9 +12,9 @@ func main() {
var t testing.T
// make sure error mentions that
- // ch is unexported, not just "ch not found".
+ // name is unexported, not just "name not found".
- t.ch = nil // ERROR "unexported"
+ t.name = nil // ERROR "unexported"
println(testing.anyLowercaseName("asdf")) // ERROR "unexported" "undefined: testing.anyLowercaseName"
}
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 5:12 libgo patch committed: Update to weekly.2011-12-22 Ian Lance Taylor
@ 2012-01-13 18:23 ` Rainer Orth
2012-01-13 23:03 ` Ian Lance Taylor
2012-01-16 17:27 ` Rainer Orth
1 sibling, 1 reply; 17+ messages in thread
From: Rainer Orth @ 2012-01-13 18:23 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
Ian Lance Taylor <iant@google.com> writes:
> I have committed a patch to libgo to update it to the weekly.2011-12-22
> release. As usual I am not including all the changes here, only the
> ones to files which are specific to gccgo. Bootstrapped and ran Go
> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
This also broke bootstrap on x86_64-unknown-linux-gnu (CentOS 5.5):
/vol/gcc/src/hg/trunk/local/libgo/go/net/fd_linux.go:40:46: error: reference to undefined identifier 'syscall.EPOLL_CLOEXEC'
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 18:23 ` Rainer Orth
@ 2012-01-13 23:03 ` Ian Lance Taylor
2012-01-18 16:54 ` Rainer Orth
0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-13 23:03 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 680 bytes --]
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Ian Lance Taylor <iant@google.com> writes:
>
>> I have committed a patch to libgo to update it to the weekly.2011-12-22
>> release. As usual I am not including all the changes here, only the
>> ones to files which are specific to gccgo. Bootstrapped and ran Go
>> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
>
> This also broke bootstrap on x86_64-unknown-linux-gnu (CentOS 5.5):
>
> /vol/gcc/src/hg/trunk/local/libgo/go/net/fd_linux.go:40:46: error: reference to undefined identifier 'syscall.EPOLL_CLOEXEC'
Thanks. Fixed like so. Bootstrapped on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 686 bytes --]
diff -r 5623a1911326 libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh Thu Jan 12 21:00:14 2012 -0800
+++ b/libgo/mksysinfo.sh Fri Jan 13 15:01:55 2012 -0800
@@ -193,10 +193,13 @@
# epoll constants.
grep '^const _EPOLL' gen-sysinfo.go |
sed -e 's/^\(const \)_\(EPOLL[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
-# Make sure EPOLLRDHUP is defined.
+# Make sure EPOLLRDHUP and EPOLL_CLOEXEC are defined.
if ! grep '^const EPOLLRDHUP' ${OUT} >/dev/null 2>&1; then
echo "const EPOLLRDHUP = 0x2000" >> ${OUT}
fi
+if ! grep '^const EPOLL_CLOEXEC' ${OUT} >/dev/null 2>&1; then
+ echo "const EPOLL_CLOEXEC = 02000000" >> ${OUT}
+fi
# Ptrace constants.
grep '^const _PTRACE' gen-sysinfo.go |
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 5:12 libgo patch committed: Update to weekly.2011-12-22 Ian Lance Taylor
2012-01-13 18:23 ` Rainer Orth
@ 2012-01-16 17:27 ` Rainer Orth
2012-01-17 14:19 ` Ian Lance Taylor
1 sibling, 1 reply; 17+ messages in thread
From: Rainer Orth @ 2012-01-16 17:27 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
Ian Lance Taylor <iant@google.com> writes:
> I have committed a patch to libgo to update it to the weekly.2011-12-22
> release. As usual I am not including all the changes here, only the
> ones to files which are specific to gccgo. Bootstrapped and ran Go
> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
The patch introduced a couple of other problems:
* There's a warning during libgo configure:
checking for --enable-version-specific-runtime-libs... no
/vol/gcc/src/hg/trunk/solaris/libgo/configure[13514]: test: argument expected
checking whether -fsplit-stack is supported... no
Fixed as follows:
diff --git a/libgo/configure.ac b/libgo/configure.ac
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -126,6 +126,7 @@ is_darwin=no
is_freebsd=no
is_irix=no
is_linux=no
+is_netbsd=no
is_rtems=no
is_solaris=no
GOOS=unknown
* Bootstrap on Solaris < 11 is broken:
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:73:2: error: implicit declaration of function 'madvise' [-Werror=implicit-function-declaration]
The madvise declaration in <sys/mman.h> is only visible if
!(_XOPEN_SOURCE > 420). Since _XOPEN_SOURCE is necessary for other
compilations, I've #undef'ed the symbol at the beginning of this
particular file:
diff --git a/libgo/runtime/mem.c b/libgo/runtime/mem.c
--- a/libgo/runtime/mem.c
+++ b/libgo/runtime/mem.c
@@ -1,3 +1,7 @@
+/* Defining _XOPEN_SOURCE hides the declaration of madvise() on Solaris <
+ 11 and the MADV_DONTNEED definition on IRIX 6.5. */
+#undef _XOPEN_SOURCE
+
#include <errno.h>
#include <unistd.h>
As the comment states, IRIX has a similar problem, but that could be
fixed in a different way.
* The IRIX libgo build is broken like this:
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-map-delete.c: In function '__go_map_delete':
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-map-delete.c:38:11: error: assignment from incompatible pointer type [-Werror]
/vol/gcc/src/hg/trunk/local/libgo/runtime/go-map-index.c:36:10: error: assignment from incompatible pointer type [-Werror]
On IRIX, size_t and uintptr_t differ, so I'm changing the prototypes
above to match what's in go-type.h.
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:70:25: error: unused parameter 'v' [-Werror=unused-parameter]
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:70:36: error: unused parameter 'n' [-Werror=unused-parameter]
As mentioned above, MADV_DONTNEED may be unavailable, so the args need
to be marked unused to avoid the warning.
diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c
--- a/libgo/runtime/go-map-delete.c
+++ b/libgo/runtime/go-map-delete.c
@@ -20,7 +20,7 @@ __go_map_delete (struct __go_map *map, c
const struct __go_map_descriptor *descriptor;
const struct __go_type_descriptor *key_descriptor;
uintptr_t key_offset;
- _Bool (*equalfn) (const void*, const void*, size_t);
+ _Bool (*equalfn) (const void*, const void*, uintptr_t);
size_t key_hash;
size_t key_size;
size_t bucket_index;
diff --git a/libgo/runtime/go-map-index.c b/libgo/runtime/go-map-index.c
--- a/libgo/runtime/go-map-index.c
+++ b/libgo/runtime/go-map-index.c
@@ -21,7 +21,7 @@ __go_map_rehash (struct __go_map *map)
const struct __go_type_descriptor *key_descriptor;
uintptr_t key_offset;
size_t key_size;
- size_t (*hashfn) (const void *, size_t);
+ uintptr_t (*hashfn) (const void *, uintptr_t);
uintptr_t old_bucket_count;
void **old_buckets;
uintptr_t new_bucket_count;
@@ -80,7 +80,7 @@ __go_map_index (struct __go_map *map, co
const struct __go_map_descriptor *descriptor;
const struct __go_type_descriptor *key_descriptor;
uintptr_t key_offset;
- _Bool (*equalfn) (const void*, const void*, size_t);
+ _Bool (*equalfn) (const void*, const void*, uintptr_t);
size_t key_hash;
size_t key_size;
size_t bucket_index;
diff --git a/libgo/runtime/mem.c b/libgo/runtime/mem.c
--- a/libgo/runtime/mem.c
+++ b/libgo/runtime/mem.c
@@ -71,7 +71,7 @@ runtime_SysAlloc(uintptr n)
}
void
-runtime_SysUnused(void *v, uintptr n)
+runtime_SysUnused(void *v __attribute__ ((unused)), uintptr n __attribute__ ((unused)))
{
#ifdef MADV_DONTNEED
runtime_madvise(v, n, MADV_DONTNEED);
With those changes, I was able to get libgo to build again on IRIX 6.5
and Solaris 10.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-16 17:27 ` Rainer Orth
@ 2012-01-17 14:19 ` Ian Lance Taylor
2012-01-18 10:52 ` Rainer Orth
0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-17 14:19 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches, gofrontend-dev
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Ian Lance Taylor <iant@google.com> writes:
>
>> I have committed a patch to libgo to update it to the weekly.2011-12-22
>> release. As usual I am not including all the changes here, only the
>> ones to files which are specific to gccgo. Bootstrapped and ran Go
>> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
>
> The patch introduced a couple of other problems:
>
> * There's a warning during libgo configure:
>
> * Bootstrap on Solaris < 11 is broken:
>
> * The IRIX libgo build is broken like this:
Thanks a lot. All committed.
Ian
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-17 14:19 ` Ian Lance Taylor
@ 2012-01-18 10:52 ` Rainer Orth
0 siblings, 0 replies; 17+ messages in thread
From: Rainer Orth @ 2012-01-18 10:52 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
Ian Lance Taylor <iant@google.com> writes:
>> The patch introduced a couple of other problems:
>>
>> * There's a warning during libgo configure:
>>
>> * Bootstrap on Solaris < 11 is broken:
>>
>> * The IRIX libgo build is broken like this:
>
> Thanks a lot. All committed.
I hadn't bootstrapped with the fixes before submitting, but doing it now
shows a serious problem on Solaris 8 and 9: libgo now makes uses of many
C99 math functions, some of which are missing, as can be seen with ldd -r.
The situation differs between Solaris/SPARC
symbol not found: log2 (.libs/libgo.so)
symbol not found: trunc (.libs/libgo.so)
and Solaris/x86:
symbol not found: acosl (.libs/libgo.so)
symbol not found: asinl (.libs/libgo.so)
symbol not found: atan2l (.libs/libgo.so)
symbol not found: atanl (.libs/libgo.so)
symbol not found: cosl (.libs/libgo.so)
symbol not found: expl (.libs/libgo.so)
symbol not found: expm1l (.libs/libgo.so)
symbol not found: ldexpl (.libs/libgo.so)
symbol not found: log10l (.libs/libgo.so)
symbol not found: log1pl (.libs/libgo.so)
symbol not found: log2l (.libs/libgo.so)
symbol not found: logl (.libs/libgo.so)
symbol not found: sinl (.libs/libgo.so)
symbol not found: tanl (.libs/libgo.so)
symbol not found: trunc (.libs/libgo.so)
The Studio compilers include libsunmath.so.1 which provides those
functions (among others), but neither can one rely on the compilers
being installed now do they end up in a fixed location.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 23:03 ` Ian Lance Taylor
@ 2012-01-18 16:54 ` Rainer Orth
2012-01-26 20:24 ` Ian Lance Taylor
0 siblings, 1 reply; 17+ messages in thread
From: Rainer Orth @ 2012-01-18 16:54 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
Ian Lance Taylor <iant@google.com> writes:
>> This also broke bootstrap on x86_64-unknown-linux-gnu (CentOS 5.5):
>>
>> /vol/gcc/src/hg/trunk/local/libgo/go/net/fd_linux.go:40:46: error: reference to undefined identifier 'syscall.EPOLL_CLOEXEC'
>
> Thanks. Fixed like so. Bootstrapped on x86_64-unknown-linux-gnu.
> Committed to mainline.
Thanks. Unfortunately, this is not enough: while the build finishes
now, all tests fail with
/var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./libgo/.libs/libgo.so: undefined reference to `epoll_create1'
collect2: error: ld returned 1 exit status
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-18 16:54 ` Rainer Orth
@ 2012-01-26 20:24 ` Ian Lance Taylor
2012-01-27 18:16 ` Rainer Orth
0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-26 20:24 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 995 bytes --]
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Ian Lance Taylor <iant@google.com> writes:
>
>>> This also broke bootstrap on x86_64-unknown-linux-gnu (CentOS 5.5):
>>>
>>> /vol/gcc/src/hg/trunk/local/libgo/go/net/fd_linux.go:40:46: error: reference to undefined identifier 'syscall.EPOLL_CLOEXEC'
>>
>> Thanks. Fixed like so. Bootstrapped on x86_64-unknown-linux-gnu.
>> Committed to mainline.
>
> Thanks. Unfortunately, this is not enough: while the build finishes
> now, all tests fail with
>
> /var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/x86_64-unknown-linux-gnu/./libgo/.libs/libgo.so: undefined reference to `epoll_create1'
> collect2: error: ld returned 1 exit status
Fixed with the appended patch, which also gathers up all the possibly
missing functions that I noticed. Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu, which proves little as the system I tested on
has all these functions anyhow. Committed to mainline.
Thanks for the bug report.
Ian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 5572 bytes --]
diff -r 9013911dbab2 libgo/Makefile.am
--- a/libgo/Makefile.am Wed Jan 25 21:42:35 2012 -0800
+++ b/libgo/Makefile.am Thu Jan 26 12:15:48 2012 -0800
@@ -449,6 +449,7 @@
runtime/go-now.c \
runtime/go-new-map.c \
runtime/go-new.c \
+ runtime/go-nosys.c \
runtime/go-panic.c \
runtime/go-print.c \
runtime/go-recover.c \
diff -r 9013911dbab2 libgo/configure.ac
--- a/libgo/configure.ac Wed Jan 25 21:42:35 2012 -0800
+++ b/libgo/configure.ac Thu Jan 26 12:15:48 2012 -0800
@@ -33,6 +33,8 @@
AM_MAINTAINER_MODE
+AC_INCLUDES_DEFAULT
+
AC_PROG_LD
AC_PROG_RANLIB
AC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)
@@ -465,6 +467,9 @@
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
+AC_CHECK_FUNCS(epoll_create1 faccessat fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare)
+AC_CHECK_TYPES([loff_t])
+
CFLAGS_hold="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS_hold="$LIBS"
@@ -519,7 +524,7 @@
CFLAGS_hold=$CFLAGS
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
-AC_CHECK_TYPES(off64_t)
+AC_CHECK_TYPES([off64_t])
CFLAGS=$CFLAGS_hold
dnl Work out the size of the epoll_events struct on GNU/Linux.
diff -r 9013911dbab2 libgo/runtime/go-nosys.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/libgo/runtime/go-nosys.c Thu Jan 26 12:15:48 2012 -0800
@@ -0,0 +1,192 @@
+/* go-nosys.c -- functions missing from system.
+
+ Copyright 2012 The Go Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style
+ license that can be found in the LICENSE file. */
+
+/* This file exists to provide definitions for functions that are
+ missing from libc, according to the configure script. This permits
+ the Go syscall package to not worry about whether the functions
+ exist or not. */
+
+#include "config.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#ifndef HAVE_OFF64_T
+typedef signed int off64_t __attribute__ ((mode (DI)));
+#endif
+
+#ifndef HAVE_LOFF_T
+typedef off64_t loff_t;
+#endif
+
+#ifndef HAVE_EPOLL_CREATE1
+int
+epoll_create1 (int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FACCESSAT
+int
+faccessat (int fd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ int mode __attribute__ ((unused)),
+ int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FCHMODAT
+int
+fchmodat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ mode_t mode __attribute__ ((unused)),
+ int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FCHOWNAT
+int
+fchownat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ uid_t owner __attribute__ ((unused)),
+ gid_t group __attribute__ ((unused)),
+ int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_FUTIMESAT
+int
+futimesat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ const struct timeval times[2] __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_INOTIFY_ADD_WATCH
+int
+inotify_add_watch (int fd __attribute__ ((unused)),
+ const char* pathname __attribute__ ((unused)),
+ uint32_t mask __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_INOTIFY_INIT
+int
+inotify_init (void)
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_INOTIFY_RM_WATCH
+int
+inotify_rm_watch (int fd __attribute__ ((unused)),
+ uint32_t wd __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_MKDIRAT
+int
+mkdirat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ mode_t mode __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_MKNODAT
+int
+mknodat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ mode_t mode __attribute__ ((unused)),
+ dev_t dev __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_OPENAT
+int
+openat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ int oflag __attribute__ ((unused)),
+ ...)
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_RENAMEAT
+int
+renameat (int olddirfd __attribute__ ((unused)),
+ const char *oldpath __attribute__ ((unused)),
+ int newdirfd __attribute__ ((unused)),
+ const char *newpath __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_SPLICE
+int
+splice (int fd __attribute__ ((unused)),
+ loff_t *off_in __attribute__ ((unused)),
+ int fd_out __attribute__ ((unused)),
+ loff_t *off_out __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)),
+ unsigned int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_TEE
+int
+tee (int fd_in __attribute__ ((unused)),
+ int fd_out __attribute__ ((unused)),
+ size_t len __attribute__ ((unused)),
+ unsigned int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_UNLINKAT
+int
+unlinkat (int dirfd __attribute__ ((unused)),
+ const char *pathname __attribute__ ((unused)),
+ int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
+
+#ifndef HAVE_UNSHARE
+int
+unshare (int flags __attribute__ ((unused)))
+{
+ return ENOSYS;
+}
+#endif
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-26 20:24 ` Ian Lance Taylor
@ 2012-01-27 18:16 ` Rainer Orth
2012-02-10 23:52 ` Ian Lance Taylor
0 siblings, 1 reply; 17+ messages in thread
From: Rainer Orth @ 2012-01-27 18:16 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
Ian Lance Taylor <iant@google.com> writes:
> Fixed with the appended patch, which also gathers up all the possibly
> missing functions that I noticed. Bootstrapped and ran Go testsuite on
> x86_64-unknown-linux-gnu, which proves little as the system I tested on
> has all these functions anyhow. Committed to mainline.
Results are way better now, but still a couple of libgo FAILs:
Running target unix
FAIL: net
FAIL: websocket
FAIL: compress/flate
FAIL: exp/ssh
FAIL: image/jpeg
FAIL: log/syslog
FAIL: net/http
FAIL: net/http/httputil
FAIL: net/rpc
FAIL: os/exec
Most of them are like
Start pollServer: epoll_ctl: Bad file descriptor
panic: runtime error: invalid memory address or nil pointer dereference
FAIL: net
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-27 18:16 ` Rainer Orth
@ 2012-02-10 23:52 ` Ian Lance Taylor
2012-02-14 13:57 ` Rainer Orth
0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2012-02-10 23:52 UTC (permalink / raw)
To: Rainer Orth; +Cc: gcc-patches, gofrontend-dev
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Ian Lance Taylor <iant@google.com> writes:
>
>> Fixed with the appended patch, which also gathers up all the possibly
>> missing functions that I noticed. Bootstrapped and ran Go testsuite on
>> x86_64-unknown-linux-gnu, which proves little as the system I tested on
>> has all these functions anyhow. Committed to mainline.
>
> Results are way better now, but still a couple of libgo FAILs:
>
> Running target unix
> FAIL: net
> FAIL: websocket
> FAIL: compress/flate
> FAIL: exp/ssh
> FAIL: image/jpeg
> FAIL: log/syslog
> FAIL: net/http
> FAIL: net/http/httputil
> FAIL: net/rpc
> FAIL: os/exec
>
> Most of them are like
>
> Start pollServer: epoll_ctl: Bad file descriptor
> panic: runtime error: invalid memory address or nil pointer dereference
> FAIL: net
That sort of problem should be fixed now, by
http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00110.html
Ian
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-02-10 23:52 ` Ian Lance Taylor
@ 2012-02-14 13:57 ` Rainer Orth
0 siblings, 0 replies; 17+ messages in thread
From: Rainer Orth @ 2012-02-14 13:57 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
Ian Lance Taylor <iant@google.com> writes:
>> Most of them are like
>>
>> Start pollServer: epoll_ctl: Bad file descriptor
>> panic: runtime error: invalid memory address or nil pointer dereference
>> FAIL: net
>
> That sort of problem should be fixed now, by
>
> http://gcc.gnu.org/ml/gcc-patches/2012-02/msg00110.html
Indeed, thanks. I only see a small number of unrelated FAILs on CentOS
5.6 now:
=== libgo tests ===
Running target unix
FAIL: compress/flate
FAIL: image/jpeg
=== libgo Summary for unix ===
# of expected passes 121
# of unexpected failures 2
Running target unix/-m32
FAIL: compress/flate
FAIL: database/sql
FAIL: image/jpeg
=== libgo Summary for unix/-m32 ===
# of expected passes 120
# of unexpected failures 3
=== libgo Summary ===
# of expected passes 241
# of unexpected failures 5
/var/gcc/regression/trunk/2.6.18-gcc-gas-gld/build/./gcc/gccgo version 4.7.0 20120210 (experimental) [trunk revision 184103] (GCC)
The compress/flate and image/jpeg failures seem to be races creating the
testdata symlink during a highly parallel make check:
ln: creating symbolic link `../testdata/testdata' to `/vol/gcc/src/hg/trunk/local/libgo/go/compress/flate/../testdata': File exists
--- FAIL: flate.TestDeflateInflateString (0.00 seconds)
???:1: open ../testdata/e.txt: No such file or directory
???:1: open ../testdata/Mark.Twain-Tom.Sawyer.txt: No such file or directory
FAIL
FAIL: compress/flate
--- FAIL: jpeg.TestWriter (0.05 seconds)
???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
???:1: ../testdata/video-001.png open ../testdata/video-001.png: No such file or directory
FAIL
FAIL: image/jpeg
The 32-bit database/sql failure also occurs when using gld on Solaris:
/vol/gcc/bin/gld-2.22: dynamic variable `libgo_database_sql.driver.Bool' is zero size
/vol/gcc/bin/gld-2.22: dynamic variable `libgo_database_sql.driver.DefaultParameterConverter' is zero size
/vol/gcc/bin/gld-2.22: _gotest_.o(.text+0xba12): unresolvable R_386_32 relocation against symbol `libgo_database_sql.driver.Bool'
/vol/gcc/bin/gld-2.22: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
FAIL: database/sql
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-15 16:28 ` Uros Bizjak
@ 2012-01-17 14:14 ` Ian Lance Taylor
0 siblings, 0 replies; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-17 14:14 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev
Uros Bizjak <ubizjak@gmail.com> writes:
> The library compiles OK, with following small patch:
>
> --cut here--
> Index: mksysinfo.sh
> ===================================================================
> --- mksysinfo.sh (revision 183192)
> +++ mksysinfo.sh (working copy)
> @@ -538,7 +538,7 @@
> # We need TIOCGWINSZ.
> if ! grep '^const TIOCGWINSZ' ${OUT} >/dev/null 2>&1; then
> if grep '^const _TIOCGWINSZ_val' ${OUT} >/dev/null 2>&1; then
> - echo 'const TIOCGWINSZ = TIOCGWINSZ_val' >> ${OUT}
> + echo 'const TIOCGWINSZ = _TIOCGWINSZ_val' >> ${OUT}
> fi
> fi
>
> --cut here--
Whoops. Thanks. Committed.
Ian
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 23:18 ` Ian Lance Taylor
@ 2012-01-15 16:28 ` Uros Bizjak
2012-01-17 14:14 ` Ian Lance Taylor
0 siblings, 1 reply; 17+ messages in thread
From: Uros Bizjak @ 2012-01-15 16:28 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
On Sat, Jan 14, 2012 at 12:18 AM, Ian Lance Taylor <iant@google.com> wrote:
>> This is the same problem with -fdump-go-spec we discussed a couple of
>> months ago [1]. In short, alpha linux doesn't just include
>> <asm-generic/ioctls.h> with hardcoded numbers in asm/ioctls.h, but
>> builds ioctl arguments as shown in [1]. Probably, this is the right
>> way ...
>
> Oh yeah.
>
> I think I've worked out a way to handle this kind of thing. With luck
> this patch will fix the problem. Bootstrapped on
> x86_64-unknown-linux-gnu, although that doesn't really test it properly.
> Committed to mainline. Please let me know if this helps.
The library compiles OK, with following small patch:
--cut here--
Index: mksysinfo.sh
===================================================================
--- mksysinfo.sh (revision 183192)
+++ mksysinfo.sh (working copy)
@@ -538,7 +538,7 @@
# We need TIOCGWINSZ.
if ! grep '^const TIOCGWINSZ' ${OUT} >/dev/null 2>&1; then
if grep '^const _TIOCGWINSZ_val' ${OUT} >/dev/null 2>&1; then
- echo 'const TIOCGWINSZ = TIOCGWINSZ_val' >> ${OUT}
+ echo 'const TIOCGWINSZ = _TIOCGWINSZ_val' >> ${OUT}
fi
fi
--cut here--
Thanks,
Uros.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 18:28 ` Uros Bizjak
@ 2012-01-13 23:18 ` Ian Lance Taylor
2012-01-15 16:28 ` Uros Bizjak
0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-13 23:18 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]
Uros Bizjak <ubizjak@gmail.com> writes:
> On Fri, Jan 13, 2012 at 7:00 PM, Ian Lance Taylor <iant@google.com> wrote:
>
>> Thanks for the report, but this is surprising. Doesn't Alpha GNU/Linux
>> define TIOCGWINSZ in /usr/include/asm-generic/ioctls.h? And isn't that
>> file #include'd, indirectly, by <sys/ioctl.h>?
>>
>> If not, does Alpha GNU/Linux define TIOCGWINSZ at all, and how does it
>> define it? I thought TIOCGWINSZ was common, and I'm particularly
>> surprised to not find it on a GNU/Linux system.
>
> This is the same problem with -fdump-go-spec we discussed a couple of
> months ago [1]. In short, alpha linux doesn't just include
> <asm-generic/ioctls.h> with hardcoded numbers in asm/ioctls.h, but
> builds ioctl arguments as shown in [1]. Probably, this is the right
> way ...
Oh yeah.
I think I've worked out a way to handle this kind of thing. With luck
this patch will fix the problem. Bootstrapped on
x86_64-unknown-linux-gnu, although that doesn't really test it properly.
Committed to mainline. Please let me know if this helps.
Thanks for reporting the problem.
Ian
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1060 bytes --]
diff -r ade619795842 libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh Fri Jan 13 15:02:22 2012 -0800
+++ b/libgo/mksysinfo.sh Fri Jan 13 15:15:32 2012 -0800
@@ -89,6 +89,15 @@
#if defined(HAVE_NET_IF_H)
#include <net/if.h>
#endif
+
+/* Constants that may only be defined as expressions on some systems,
+ expressions too complex for -fdump-go-spec to handle. These are
+ handled specially below. */
+enum {
+#ifdef TIOCGWINSZ
+ TIOCGWINSZ_val = TIOCGWINSZ,
+#endif
+};
EOF
${CC} -fdump-go-spec=gen-sysinfo.go -std=gnu99 -S -o sysinfo.s sysinfo.c
@@ -524,7 +533,14 @@
# The ioctl flags for the controlling TTY.
grep '^const _TIOC' gen-sysinfo.go | \
+ grep -v '_val =' | \
sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
+# We need TIOCGWINSZ.
+if ! grep '^const TIOCGWINSZ' ${OUT} >/dev/null 2>&1; then
+ if grep '^const _TIOCGWINSZ_val' ${OUT} >/dev/null 2>&1; then
+ echo 'const TIOCGWINSZ = TIOCGWINSZ_val' >> ${OUT}
+ fi
+fi
# The ioctl flags for terminal control
grep '^const _TC[GS]ET' gen-sysinfo.go | \
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 18:01 ` Ian Lance Taylor
@ 2012-01-13 18:28 ` Uros Bizjak
2012-01-13 23:18 ` Ian Lance Taylor
0 siblings, 1 reply; 17+ messages in thread
From: Uros Bizjak @ 2012-01-13 18:28 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev
On Fri, Jan 13, 2012 at 7:00 PM, Ian Lance Taylor <iant@google.com> wrote:
> Uros Bizjak <ubizjak@gmail.com> writes:
>
>>> I have committed a patch to libgo to update it to the weekly.2011-12-22
>>> release. As usual I am not including all the changes here, only the
>>> ones to files which are specific to gccgo. Bootstrapped and ran Go
>>> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
>>
>> After this commit, compile on alphaev68-linux-gnu dies with:
>>
>> libtool: compile: /space/uros/gcc-build-go/./gcc/gccgo
>> -B/space/uros/gcc-build-go/./gcc/
>> -B/usr/local/alphaev68-unknown-linux-gnu/bin/
>> -B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
>> /usr/local/alphaev68-unknown-linux-gnu/include -isystem
>> /usr/local/alphaev68-unknown-linux-gnu/sys-include -O2 -g -mieee -I .
>> -c -fgo-prefix=libgo_exp
>> ../../../gcc-svn/trunk/libgo/go/exp/terminal/terminal.go
>> ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go -fPIC -o
>> exp/.libs/terminal.o
>> ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go:69:23: error:
>> reference to undefined identifier ‘syscall.TIOCGWINSZ’
>> make[4]: *** [exp/terminal.lo] Error 1
>> make[4]: *** Waiting for unfinished jobs....
>
> Thanks for the report, but this is surprising. Doesn't Alpha GNU/Linux
> define TIOCGWINSZ in /usr/include/asm-generic/ioctls.h? And isn't that
> file #include'd, indirectly, by <sys/ioctl.h>?
>
> If not, does Alpha GNU/Linux define TIOCGWINSZ at all, and how does it
> define it? I thought TIOCGWINSZ was common, and I'm particularly
> surprised to not find it on a GNU/Linux system.
This is the same problem with -fdump-go-spec we discussed a couple of
months ago [1]. In short, alpha linux doesn't just include
<asm-generic/ioctls.h> with hardcoded numbers in asm/ioctls.h, but
builds ioctl arguments as shown in [1]. Probably, this is the right
way ...
[1] http://gcc.gnu.org/ml/gcc-patches/2011-11/msg00117.html
Uros.
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
2012-01-13 10:18 Uros Bizjak
@ 2012-01-13 18:01 ` Ian Lance Taylor
2012-01-13 18:28 ` Uros Bizjak
0 siblings, 1 reply; 17+ messages in thread
From: Ian Lance Taylor @ 2012-01-13 18:01 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, gofrontend-dev
Uros Bizjak <ubizjak@gmail.com> writes:
>> I have committed a patch to libgo to update it to the weekly.2011-12-22
>> release. As usual I am not including all the changes here, only the
>> ones to files which are specific to gccgo. Bootstrapped and ran Go
>> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
>
> After this commit, compile on alphaev68-linux-gnu dies with:
>
> libtool: compile: /space/uros/gcc-build-go/./gcc/gccgo
> -B/space/uros/gcc-build-go/./gcc/
> -B/usr/local/alphaev68-unknown-linux-gnu/bin/
> -B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
> /usr/local/alphaev68-unknown-linux-gnu/include -isystem
> /usr/local/alphaev68-unknown-linux-gnu/sys-include -O2 -g -mieee -I .
> -c -fgo-prefix=libgo_exp
> ../../../gcc-svn/trunk/libgo/go/exp/terminal/terminal.go
> ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go -fPIC -o
> exp/.libs/terminal.o
> ../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go:69:23: error:
> reference to undefined identifier ‘syscall.TIOCGWINSZ’
> make[4]: *** [exp/terminal.lo] Error 1
> make[4]: *** Waiting for unfinished jobs....
Thanks for the report, but this is surprising. Doesn't Alpha GNU/Linux
define TIOCGWINSZ in /usr/include/asm-generic/ioctls.h? And isn't that
file #include'd, indirectly, by <sys/ioctl.h>?
If not, does Alpha GNU/Linux define TIOCGWINSZ at all, and how does it
define it? I thought TIOCGWINSZ was common, and I'm particularly
surprised to not find it on a GNU/Linux system.
Ian
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: libgo patch committed: Update to weekly.2011-12-22
@ 2012-01-13 10:18 Uros Bizjak
2012-01-13 18:01 ` Ian Lance Taylor
0 siblings, 1 reply; 17+ messages in thread
From: Uros Bizjak @ 2012-01-13 10:18 UTC (permalink / raw)
To: gcc-patches; +Cc: Ian Lance Taylor, gofrontend-dev
Hello!
> I have committed a patch to libgo to update it to the weekly.2011-12-22
> release. As usual I am not including all the changes here, only the
> ones to files which are specific to gccgo. Bootstrapped and ran Go
> testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
After this commit, compile on alphaev68-linux-gnu dies with:
libtool: compile: /space/uros/gcc-build-go/./gcc/gccgo
-B/space/uros/gcc-build-go/./gcc/
-B/usr/local/alphaev68-unknown-linux-gnu/bin/
-B/usr/local/alphaev68-unknown-linux-gnu/lib/ -isystem
/usr/local/alphaev68-unknown-linux-gnu/include -isystem
/usr/local/alphaev68-unknown-linux-gnu/sys-include -O2 -g -mieee -I .
-c -fgo-prefix=libgo_exp
../../../gcc-svn/trunk/libgo/go/exp/terminal/terminal.go
../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go -fPIC -o
exp/.libs/terminal.o
../../../gcc-svn/trunk/libgo/go/exp/terminal/util.go:69:23: error:
reference to undefined identifier ‘syscall.TIOCGWINSZ’
make[4]: *** [exp/terminal.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
Uros.
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2012-02-14 13:51 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-13 5:12 libgo patch committed: Update to weekly.2011-12-22 Ian Lance Taylor
2012-01-13 18:23 ` Rainer Orth
2012-01-13 23:03 ` Ian Lance Taylor
2012-01-18 16:54 ` Rainer Orth
2012-01-26 20:24 ` Ian Lance Taylor
2012-01-27 18:16 ` Rainer Orth
2012-02-10 23:52 ` Ian Lance Taylor
2012-02-14 13:57 ` Rainer Orth
2012-01-16 17:27 ` Rainer Orth
2012-01-17 14:19 ` Ian Lance Taylor
2012-01-18 10:52 ` Rainer Orth
2012-01-13 10:18 Uros Bizjak
2012-01-13 18:01 ` Ian Lance Taylor
2012-01-13 18:28 ` Uros Bizjak
2012-01-13 23:18 ` Ian Lance Taylor
2012-01-15 16:28 ` Uros Bizjak
2012-01-17 14:14 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).