Re: libgo patch committed: Always mark assembly file as non-executable stack

2019-12-06 Thread Ian Lance Taylor
Thanks, rather than try to make this work everywhere, I decided to
only build the file for x86 GNU/Linux for now, since that is the only
place it is currently used.  This patch bootstrapped on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 279062)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-f04751699e1a1ce98fe8bdbcce5a00f1be6a7d15
+15c7bc9f0a432bc09716758412ea41d6caa6491b
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/Makefile.am
===
--- libgo/Makefile.am   (revision 278984)
+++ libgo/Makefile.am   (working copy)
@@ -414,6 +414,13 @@ else
 rtems_task_variable_add_file =
 endif
 
+runtime_context_asm_file =
+if LIBGO_IS_X86
+if LIBGO_IS_LINUX
+runtime_context_asm_file += runtime/go-context.S
+endif
+endif
+
 runtime_files = \
runtime/aeshash.c \
runtime/go-assert.c \
@@ -445,7 +452,7 @@ runtime_files = \
runtime/runtime_c.c \
runtime/stack.c \
runtime/yield.c \
-   runtime/go-context.S \
+   $(runtime_context_asm_file) \
$(rtems_task_variable_add_file)
 
 version.go: s-version; @true


Re: libgo patch committed: Always mark assembly file as non-executable stack

2019-12-06 Thread Rainer Orth
Hi Matthias,

> On 06.12.19 12:28, Rainer Orth wrote:
>> I Ian,
>> 
>>> This libgo patch arranges for go-context.S to always be marked as
>>> using a non-executable stack.  This is not required for all targets,
>>> but should do little harm.  Bootstrapped on x86_64-pc-linux-gnu.
>>> Committed to mainline.
>> 
>> unfortunately, it does, breaking bootstrap on Solaris/SPARC and x86 with
>> the native assembler:
>> 
>> * Solaris/SPARC with as:
>> 
>> /usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: invalid character
>> (0x40)
>> /usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: quoted-string
>> operand required
>> /usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: statement syntax
>> make[4]: *** [Makefile:1433: runtime/go-context.lo] Error 1
>> 
>> * Solaris/x86 with as:
>> 
>> Assembler:
>> "/vol/gcc/src/hg/trunk/local/libgo/runtime/go-context.S", line 74
>> : Syntax error
>> Near line: " .section .note.GNU-stack,"",@progbits"
>> make[4]: *** [Makefile:1433: runtime/go-context.lo] Error 1
>
> also on arm-linux-gnueabi*. Patch in PR go/92820

that won't help: for one, those .note.GNU-stack sections are useless on
Solaris.  Even if this weren't the case, the syntax is still wrong:
Solaris/SPARC as needs

.section".note.GNU-stack",,#progbits

while Solaris/x86 as doesn't allow for '-' in section names (and there's
no quoting mechanism IIRC).

Rainer

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


Re: libgo patch committed: Always mark assembly file as non-executable stack

2019-12-06 Thread Matthias Klose
On 06.12.19 12:28, Rainer Orth wrote:
> I Ian,
> 
>> This libgo patch arranges for go-context.S to always be marked as
>> using a non-executable stack.  This is not required for all targets,
>> but should do little harm.  Bootstrapped on x86_64-pc-linux-gnu.
>> Committed to mainline.
> 
> unfortunately, it does, breaking bootstrap on Solaris/SPARC and x86 with
> the native assembler:
> 
> * Solaris/SPARC with as:
> 
> /usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: invalid character 
> (0x40)
> /usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: quoted-string operand 
> required
> /usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: statement syntax
> make[4]: *** [Makefile:1433: runtime/go-context.lo] Error 1
> 
> * Solaris/x86 with as:
> 
> Assembler:
> "/vol/gcc/src/hg/trunk/local/libgo/runtime/go-context.S", line 74 : 
> Syntax error
> Near line: " .section .note.GNU-stack,"",@progbits"
> make[4]: *** [Makefile:1433: runtime/go-context.lo] Error 1

also on arm-linux-gnueabi*. Patch in PR go/92820

Matthias


Re: libgo patch committed: Always mark assembly file as non-executable stack

2019-12-06 Thread Rainer Orth
I Ian,

> This libgo patch arranges for go-context.S to always be marked as
> using a non-executable stack.  This is not required for all targets,
> but should do little harm.  Bootstrapped on x86_64-pc-linux-gnu.
> Committed to mainline.

unfortunately, it does, breaking bootstrap on Solaris/SPARC and x86 with
the native assembler:

* Solaris/SPARC with as:

/usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: invalid character (0x40)
/usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: quoted-string operand 
required
/usr/ccs/bin/as: "/var/tmp//ccSl12Nb.s", line 7: error: statement syntax
make[4]: *** [Makefile:1433: runtime/go-context.lo] Error 1

* Solaris/x86 with as:

Assembler:
"/vol/gcc/src/hg/trunk/local/libgo/runtime/go-context.S", line 74 : 
Syntax error
Near line: " .section .note.GNU-stack,"",@progbits"
make[4]: *** [Makefile:1433: runtime/go-context.lo] Error 1

Rainer

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


libgo patch committed: Always mark assembly file as non-executable stack

2019-12-05 Thread Ian Lance Taylor
This libgo patch arranges for go-context.S to always be marked as
using a non-executable stack.  This is not required for all targets,
but should do little harm.  Bootstrapped on x86_64-pc-linux-gnu.
Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===
--- gcc/go/gofrontend/MERGE (revision 278984)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-017830d2a4bd2efbddf5e841ba9ccff8acf9d7c8
+a59794347b9db6dc2101a65c3e1a068051c0ee81
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: libgo/runtime/go-context.S
===
--- libgo/runtime/go-context.S  (revision 278984)
+++ libgo/runtime/go-context.S  (working copy)
@@ -66,8 +66,9 @@ __go_makecontext:
 
ret
 
-   .section.note.GNU-stack,"",@progbits
.section.note.GNU-split-stack,"",@progbits
.section.note.GNU-no-split-stack,"",@progbits
 
 #endif
+
+   .section.note.GNU-stack,"",@progbits