libgo patch committed: Update to weekly.2012-02-14 release

2012-03-02 Thread Ian Lance Taylor
I have committed a patch to libgo to update to the weekly.2012-02-14
release.  As usual, in this e-mail message I only include the patches to
files specific to the gccgo version of libgo.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 86886691a02c go/unsafe.cc
--- a/go/unsafe.cc	Thu Mar 01 10:18:09 2012 -0800
+++ b/go/unsafe.cc	Thu Mar 01 22:36:35 2012 -0800
@@ -88,60 +88,6 @@
   if (add_to_globals)
 this-add_named_object(no);
 
-  // Typeof.
-  Type* empty_interface = Type::make_empty_interface_type(bloc);
-  Typed_identifier_list* parameters = new Typed_identifier_list;
-  parameters-push_back(Typed_identifier(i, empty_interface, bloc));
-  results = new Typed_identifier_list;
-  results-push_back(Typed_identifier(, empty_interface, bloc));
-  fntype = Type::make_function_type(NULL, parameters, results, bloc);
-  no = bindings-add_function_declaration(Typeof, package, fntype, bloc);
-  if (add_to_globals)
-this-add_named_object(no);
-
-  // Reflect.
-  parameters = new Typed_identifier_list;
-  parameters-push_back(Typed_identifier(it, empty_interface, bloc));
-  results = new Typed_identifier_list;
-  results-push_back(Typed_identifier(, empty_interface, bloc));
-  results-push_back(Typed_identifier(, pointer_type, bloc));
-  fntype = Type::make_function_type(NULL, parameters, results, bloc);
-  no = bindings-add_function_declaration(Reflect, package, fntype, bloc);
-  if (add_to_globals)
-this-add_named_object(no);
-
-  // Unreflect.
-  parameters = new Typed_identifier_list;
-  parameters-push_back(Typed_identifier(typ, empty_interface, bloc));
-  parameters-push_back(Typed_identifier(addr, pointer_type, bloc));
-  results = new Typed_identifier_list;
-  results-push_back(Typed_identifier(, empty_interface, bloc));
-  fntype = Type::make_function_type(NULL, parameters, results, bloc);
-  no = bindings-add_function_declaration(Unreflect, package, fntype, bloc);
-  if (add_to_globals)
-this-add_named_object(no);
-
-  // New.
-  parameters = new Typed_identifier_list;
-  parameters-push_back(Typed_identifier(typ, empty_interface, bloc));
-  results = new Typed_identifier_list;
-  results-push_back(Typed_identifier(, pointer_type, bloc));
-  fntype = Type::make_function_type(NULL, parameters, results, bloc);
-  no = bindings-add_function_declaration(New, package, fntype, bloc);
-  if (add_to_globals)
-this-add_named_object(no);
-
-  // NewArray.
-  parameters = new Typed_identifier_list;
-  parameters-push_back(Typed_identifier(typ, empty_interface, bloc));
-  parameters-push_back(Typed_identifier(n, int_type, bloc));
-  results = new Typed_identifier_list;
-  results-push_back(Typed_identifier(, pointer_type, bloc));
-  fntype = Type::make_function_type(NULL, parameters, results, bloc);
-  no = bindings-add_function_declaration(NewArray, package, fntype, bloc);
-  if (add_to_globals)
-this-add_named_object(no);
-
   if (!this-imported_unsafe_)
 {
   go_imported_unsafe();
diff -r 86886691a02c libgo/MERGE
--- a/libgo/MERGE	Thu Mar 01 10:18:09 2012 -0800
+++ b/libgo/MERGE	Thu Mar 01 22:36:35 2012 -0800
@@ -1,4 +1,4 @@
-52ba9506bd99
+43cf9b39b647
 
 The first line of this file holds the Mercurial revision number of the
 last merge done from the master library sources.
diff -r 86886691a02c libgo/Makefile.am
--- a/libgo/Makefile.am	Thu Mar 01 10:18:09 2012 -0800
+++ b/libgo/Makefile.am	Thu Mar 01 22:36:35 2012 -0800
@@ -225,7 +225,6 @@
 	$(exp_inotify_gox) \
 	exp/norm.gox \
 	exp/proxy.gox \
-	exp/signal.gox \
 	exp/terminal.gox \
 	exp/types.gox \
 	exp/utf8string.gox
@@ -325,6 +324,7 @@
 
 toolexeclibgoos_DATA = \
 	os/exec.gox \
+	os/signal.gox \
 	os/user.gox
 
 toolexeclibgopathdir = $(toolexeclibgodir)/path
@@ -352,8 +352,7 @@
 
 toolexeclibgotesting_DATA = \
 	testing/iotest.gox \
-	testing/quick.gox \
-	testing/script.gox
+	testing/quick.gox
 
 toolexeclibgotextdir = $(toolexeclibgodir)/text
 
@@ -398,6 +397,7 @@
 	runtime/go-byte-array-to-string.c \
 	runtime/go-breakpoint.c \
 	runtime/go-caller.c \
+	runtime/go-callers.c \
 	runtime/go-can-convert-interface.c \
 	runtime/go-cgo.c \
 	runtime/go-check-interface.c \
@@ -428,7 +428,6 @@
 	runtime/go-panic.c \
 	runtime/go-print.c \
 	runtime/go-recover.c \
-	runtime/go-reflect.c \
 	runtime/go-reflect-call.c \
 	runtime/go-reflect-map.c \
 	runtime/go-rune.c \
@@ -450,7 +449,6 @@
 	runtime/go-type-string.c \
 	runtime/go-typedesc-equal.c \
 	runtime/go-typestring.c \
-	runtime/go-unreflect.c \
 	runtime/go-unsafe-new.c \
 	runtime/go-unsafe-newarray.c \
 	runtime/go-unsafe-pointer.c \
@@ -468,6 +466,7 @@
 	runtime/msize.c \
 	runtime/proc.c \
 	runtime/runtime.c \
+	runtime/signal_unix.c \
 	runtime/thread.c \
 	runtime/yield.c \
 	$(rtems_task_variable_add_file) \
@@ -509,7 +508,7 @@
 	mv -f $@.tmp $@
 
 sigqueue.c: $(srcdir)/runtime/sigqueue.goc goc2c
-	./goc2c --gcc --go-prefix libgo_runtime $  $@.tmp
+	./goc2c --gcc --go-prefix libgo_os $  $@.tmp
 	mv -f $@.tmp 

Re: libgo patch committed: Update to weekly.2012-02-14 release

2012-03-02 Thread Rainer Orth
Ian Lance Taylor i...@google.com writes:

 I have committed a patch to libgo to update to the weekly.2012-02-14
 release.  As usual, in this e-mail message I only include the patches to
 files specific to the gccgo version of libgo.  Bootstrapped and ran Go
 testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

This broke Solaris 10 (and probably 9 also) bootstrap:

/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c: In function 'mmap_fixed':
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:47:2: error: pointer targets in 
passing argument 1 of 'mmap' differ in signedness [-Werror=pointer-sign]
In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:23:0,
 from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
/usr/include/sys/mman.h:168:16: note: expected 'caddr_t' but argument is of 
type 'byte *'
/vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:53:3: error: pointer targets in 
passing argument 1 of 'mmap' differ in signedness [-Werror=pointer-sign]
In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:23:0,
 from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
/usr/include/sys/mman.h:168:16: note: expected 'caddr_t' but argument is of 
type 'byte *'
cc1: all warnings being treated as errors

The first mmap arg is caddr_t (char *), while byte * is uint8 *.
Casting to void * fixes this.

Rainer


# HG changeset patch
# Parent 3c65bd27734429765e18be13aeb46e624807b984
Cast mmap addr to void *

diff --git a/libgo/runtime/mem.c b/libgo/runtime/mem.c
--- a/libgo/runtime/mem.c
+++ b/libgo/runtime/mem.c
@@ -44,13 +44,13 @@ mmap_fixed(byte *v, uintptr n, int32 pro
 {
 	void *p;
 
-	p = runtime_mmap(v, n, prot, flags, fd, offset);
+	p = runtime_mmap((void *)v, n, prot, flags, fd, offset);
 	if(p != v  addrspace_free(v, n)) {
 		// On some systems, mmap ignores v without
 		// MAP_FIXED, so retry if the address space is free.
 		if(p != MAP_FAILED)
 			runtime_munmap(p, n);
-		p = runtime_mmap(v, n, prot, flags|MAP_FIXED, fd, offset);
+		p = runtime_mmap((void *)v, n, prot, flags|MAP_FIXED, fd, offset);
 	}
 	return p;
 }


-- 
-
Rainer Orth, Center for Biotechnology, Bielefeld University


Re: libgo patch committed: Update to weekly.2012-02-14 release

2012-03-02 Thread Ian Lance Taylor
Rainer Orth r...@cebitec.uni-bielefeld.de writes:

 The first mmap arg is caddr_t (char *), while byte * is uint8 *.
 Casting to void * fixes this.

Thanks.

Committed.

Ian