diff mbox

libgo/runtime: Fix signal stack size for ia64

Message ID CAKOQZ8yqug-Oens9pWJA78np2T+Z6RE5BGcU6yZ79vdmo1sabg@mail.gmail.com
State New
Headers show

Commit Message

Ian Lance Taylor Aug. 31, 2016, 1:59 p.m. UTC
On Wed, Aug 31, 2016 at 1:24 AM, Andreas Schwab <schwab@suse.de> wrote:
> On ia64, MINSIGSTKSZ is 128K.
>
> Andreas.
>
>         * libgo/runtime/runtime.c (runtime_mpreinit): Increase stack size to
>         128K.
> ---
>  libgo/runtime/runtime.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libgo/runtime/runtime.c b/libgo/runtime/runtime.c
> index c7d33bc..e8eb957 100644
> --- a/libgo/runtime/runtime.c
> +++ b/libgo/runtime/runtime.c
> @@ -272,7 +272,7 @@ runtime_tickspersecond(void)
>  void
>  runtime_mpreinit(M *mp)
>  {
> -       mp->gsignal = runtime_malg(32*1024, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);  // OS X wants >=8K, Linux >=2K
> +       mp->gsignal = runtime_malg(128*1024, (byte**)&mp->gsignalstack, &mp->gsignalstacksize); // OS X wants >=8K, Linux >=2K, ia64 >=128K
>         mp->gsignal->m = mp;
>  }

Thanks.  There doesn't seem to be a need to increase the stack size on
all architectures, so I applied this patch.  Bootstrapped and ran Go
tests on x86_64-pc-linux-gnu, which I admit means little.  Committed
to mainline.  Let me know if it doesn't fix the problem on ia64 (does
Go really work on ia64?).

Ian

Comments

Andreas Schwab Aug. 31, 2016, 2:26 p.m. UTC | #1
On Aug 31 2016, Ian Lance Taylor <iant@google.com> wrote:

> Go really work on ia64?).

http://gcc.gnu.org/ml/gcc-testresults/2016-08/msg03154.html

Andreas.
Andreas Schwab Sept. 2, 2016, 3:58 p.m. UTC | #2
On Aug 31 2016, Ian Lance Taylor <iant@google.com> wrote:

> Index: libgo/runtime/runtime.c
> ===================================================================
> --- libgo/runtime/runtime.c	(revision 239872)
> +++ libgo/runtime/runtime.c	(working copy)
> @@ -272,7 +272,14 @@ runtime_tickspersecond(void)
>  void
>  runtime_mpreinit(M *mp)
>  {
> -	mp->gsignal = runtime_malg(32*1024, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);	// OS X wants >=8K, Linux >=2K
> +	int32 stacksize = 32 * 1024;	// OS X wants >=8K, Linux >=2K
> +
> +#ifdef SIGSTKSZ
> +	if(stacksize < SIGSTKSZ)
> +		stacksize = SIGSTKSZ;
> +#endif

There is nothing that defines SIGSTKSZ.

Andreas.
Andreas Schwab Sept. 2, 2016, 4:05 p.m. UTC | #3
On Sep 02 2016, Andreas Schwab <schwab@suse.de> wrote:

> On Aug 31 2016, Ian Lance Taylor <iant@google.com> wrote:
>
>> Index: libgo/runtime/runtime.c
>> ===================================================================
>> --- libgo/runtime/runtime.c	(revision 239872)
>> +++ libgo/runtime/runtime.c	(working copy)
>> @@ -272,7 +272,14 @@ runtime_tickspersecond(void)
>>  void
>>  runtime_mpreinit(M *mp)
>>  {
>> -	mp->gsignal = runtime_malg(32*1024, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);	// OS X wants >=8K, Linux >=2K
>> +	int32 stacksize = 32 * 1024;	// OS X wants >=8K, Linux >=2K
>> +
>> +#ifdef SIGSTKSZ
>> +	if(stacksize < SIGSTKSZ)
>> +		stacksize = SIGSTKSZ;
>> +#endif
>
> There is nothing that defines SIGSTKSZ.

Sorry, that is wrong, the regression I see must be something else.

Andreas.
diff mbox

Patch

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 239872)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
-394486a1cec9bbb81216311ed153179d9fe1c2c5
+c8cf90f2daf62428ca6aa0b5674572cd99f25fe3
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/runtime/runtime.c
===================================================================
--- libgo/runtime/runtime.c	(revision 239872)
+++ libgo/runtime/runtime.c	(working copy)
@@ -272,7 +272,14 @@  runtime_tickspersecond(void)
 void
 runtime_mpreinit(M *mp)
 {
-	mp->gsignal = runtime_malg(32*1024, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);	// OS X wants >=8K, Linux >=2K
+	int32 stacksize = 32 * 1024;	// OS X wants >=8K, Linux >=2K
+
+#ifdef SIGSTKSZ
+	if(stacksize < SIGSTKSZ)
+		stacksize = SIGSTKSZ;
+#endif
+
+	mp->gsignal = runtime_malg(stacksize, (byte**)&mp->gsignalstack, &mp->gsignalstacksize);
 	mp->gsignal->m = mp;
 }