public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* libgo patch committed: Always mark assembly file as non-executable stack
@ 2019-12-05 17:51 Ian Lance Taylor
  2019-12-06 11:28 ` Rainer Orth
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2019-12-05 17:51 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

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

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 835 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libgo patch committed: Always mark assembly file as non-executable stack
  2019-12-05 17:51 libgo patch committed: Always mark assembly file as non-executable stack Ian Lance Taylor
@ 2019-12-06 11:28 ` Rainer Orth
  2019-12-06 16:18   ` Matthias Klose
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Orth @ 2019-12-06 11:28 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libgo patch committed: Always mark assembly file as non-executable stack
  2019-12-06 11:28 ` Rainer Orth
@ 2019-12-06 16:18   ` Matthias Klose
  2019-12-06 17:20     ` Rainer Orth
  0 siblings, 1 reply; 5+ messages in thread
From: Matthias Klose @ 2019-12-06 16:18 UTC (permalink / raw)
  To: Rainer Orth, Ian Lance Taylor; +Cc: gcc-patches, gofrontend-dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libgo patch committed: Always mark assembly file as non-executable stack
  2019-12-06 16:18   ` Matthias Klose
@ 2019-12-06 17:20     ` Rainer Orth
  2019-12-06 19:53       ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Rainer Orth @ 2019-12-06 17:20 UTC (permalink / raw)
  To: Matthias Klose; +Cc: Ian Lance Taylor, gcc-patches, gofrontend-dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libgo patch committed: Always mark assembly file as non-executable stack
  2019-12-06 17:20     ` Rainer Orth
@ 2019-12-06 19:53       ` Ian Lance Taylor
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Lance Taylor @ 2019-12-06 19:53 UTC (permalink / raw)
  To: Rainer Orth; +Cc: Matthias Klose, gcc-patches, gofrontend-dev

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

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

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1062 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-06 19:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-05 17:51 libgo patch committed: Always mark assembly file as non-executable stack Ian Lance Taylor
2019-12-06 11:28 ` Rainer Orth
2019-12-06 16:18   ` Matthias Klose
2019-12-06 17:20     ` Rainer Orth
2019-12-06 19:53       ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).