Patchwork libgo patch committed: Update to weekly.2011-12-22

login
register
mail settings
Submitter Rainer Orth
Date Jan. 16, 2012, 5:26 p.m.
Message ID <yddmx9n5zj4.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/136330/
State New
Headers show

Comments

Rainer Orth - Jan. 16, 2012, 5:26 p.m.
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:


With those changes, I was able to get libgo to build again on IRIX 6.5
and Solaris 10.

	Rainer
Ian Taylor - Jan. 17, 2012, 2:19 p.m.
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
Rainer Orth - Jan. 18, 2012, 10:51 a.m.
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

Patch

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);