diff mbox

Go 1.3 update broke Solaris bootstrap

Message ID CAKOQZ8wqUKuoasn=tGcGPJTahGPuh_t4-uoTGjrYnNSoWZLyJA@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Aug. 4, 2014, 5:54 p.m. UTC
On Tue, Jul 22, 2014 at 1:14 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> The recent Go 1.3 update (which I couldn't find posted to gcc-patches)
> broke Solaris bootstrap:
>
> /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:50:20: error: pointer targets in passing argument 1 of 'mincore' differ in signedness [-Werror=pointer-sign]
>    errval = mincore((int8*)v + off, chunk, vec);
>                     ^
> In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:22:0,
>                  from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
> /usr/include/sys/mman.h:232:12: note: expected 'caddr_t' but argument is of type 'int8 *'
>  extern int mincore(caddr_t, size_t, char *);
>             ^
> /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:50:43: error: pointer targets in passing argument 3 of 'mincore' differ in signedness [-Werror=pointer-sign]
>    errval = mincore((int8*)v + off, chunk, vec);
>                                            ^
> In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:22:0,
>                  from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
> /usr/include/sys/mman.h:232:12: note: expected 'char *' but argument is of type 'byte *'
>  extern int mincore(caddr_t, size_t, char *);
>             ^
>
> The following patch restores it, though there are certainly other
> options (uint8* for the v cast, a void* cast for vec).

Thanks.  I had to adjust your patch to work on GNU/Linux, for which
the third argument to mincore is unsigned char *.  This is what I've
committed to mainline after a bootstrap and testsuite run on
x86_64-unknown-linux-gnu.

Ian

Comments

Rainer Orth Aug. 5, 2014, 11:39 a.m. UTC | #1
Hi Ian,

> On Tue, Jul 22, 2014 at 1:14 AM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>> The recent Go 1.3 update (which I couldn't find posted to gcc-patches)
>> broke Solaris bootstrap:
>>
>> /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:50:20: error: pointer targets in passing argument 1 of 'mincore' differ in signedness [-Werror=pointer-sign]
>>    errval = mincore((int8*)v + off, chunk, vec);
>>                     ^
>> In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:22:0,
>>                  from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
>> /usr/include/sys/mman.h:232:12: note: expected 'caddr_t' but argument is of type 'int8 *'
>>  extern int mincore(caddr_t, size_t, char *);
>>             ^
>> /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:50:43: error: pointer targets in passing argument 3 of 'mincore' differ in signedness [-Werror=pointer-sign]
>>    errval = mincore((int8*)v + off, chunk, vec);
>>                                            ^
>> In file included from /vol/gcc/src/hg/trunk/local/libgo/runtime/runtime.h:22:0,
>>                  from /vol/gcc/src/hg/trunk/local/libgo/runtime/mem.c:8:
>> /usr/include/sys/mman.h:232:12: note: expected 'char *' but argument is of type 'byte *'
>>  extern int mincore(caddr_t, size_t, char *);
>>             ^
>>
>> The following patch restores it, though there are certainly other
>> options (uint8* for the v cast, a void* cast for vec).
>
> Thanks.  I had to adjust your patch to work on GNU/Linux, for which
> the third argument to mincore is unsigned char *.  This is what I've
> committed to mainline after a bootstrap and testsuite run on
> x86_64-unknown-linux-gnu.

Thanks.  This is exactly the patch I had in my local tree once I noticed
the original one broke Linux bootstrap.

	Rainer
diff mbox

Patch

diff -r 95e1b9f06590 libgo/runtime/mem.c
--- a/libgo/runtime/mem.c	Fri Aug 01 17:43:51 2014 -0700
+++ b/libgo/runtime/mem.c	Mon Aug 04 10:46:17 2014 -0700
@@ -47,7 +47,7 @@ 
 		chunk = page_size * sizeof vec;
 		if(chunk > (n - off))
 			chunk = n - off;
-		errval = mincore((int8*)v + off, chunk, vec);
+		errval = mincore((char*)v + off, chunk, (void*)vec);
 		// ENOMEM means unmapped, which is what we want.
 		// Anything else we assume means the pages are mapped.
 		if(errval == 0 || errno != ENOMEM)