public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
@ 2022-05-04  8:24 ro at gcc dot gnu.org
  2022-05-04  8:24 ` [Bug target/105472] " ro at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: ro at gcc dot gnu.org @ 2022-05-04  8:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

            Bug ID: 105472
           Summary: [13 regression] .note.GNU-stack breaks many
                    Solaris/x86 tests
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: hjl.tools at gmail dot com
  Target Milestone: ---
            Target: i386-pc-solaris2.11, x86_64-pc-solaris2.11

Between 20220502 (1cb220498e1f59021dab36c39c5d726e9f070c6a) and 20220503
(2680f5eec23805ab8a344f942ca5a7e180d57905),
many tests began to FAIL on Solaris/x86 with /bin/as:

+FAIL: gcc.target/x86_64/abi/test_3_element_struct_and_unions.c compilation, 
-O0 
[...]

(332 tests total).  The failure is always the same:

Assembler:
       
"/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.target/x86_64/abi/asm-support.S",
line 85 : Syntax error
        Near line: " .section .note.GNU-stack,"",@progbits"

This happens because with /bin/as, '-' isn't valid in section names.

However, even with gas which can assemble the test, this doesn't really make
sense: Solaris ld doesn't know or care about .note.GNU-stack, so this has no
effect.  Instead, the Solaris security extensions framework is used, which
defaults to non-exec stack on Solaris 11 anyway:

$ sxadm status nxstack
EXTENSION           STATUS                        FLAGS
nxstack             enabled (all)                 u-c--

On top of that, ld provides -z sx=nxstack to control the behaviour on an
per-executable basis.

gld doesn't know about all this, of course, but let's cross that bridge when
the binutils 2.39 release approaches.

The usual way throughout the code base is to guard .note.GNU-stack with
__ELF__ && __linux__ to avoid all this.

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
@ 2022-05-04  8:24 ` ro at gcc dot gnu.org
  2022-05-04  8:36 ` marxin at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ro at gcc dot gnu.org @ 2022-05-04  8:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
  2022-05-04  8:24 ` [Bug target/105472] " ro at gcc dot gnu.org
@ 2022-05-04  8:36 ` marxin at gcc dot gnu.org
  2022-05-06 17:16 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-05-04  8:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-05-04
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
  2022-05-04  8:24 ` [Bug target/105472] " ro at gcc dot gnu.org
  2022-05-04  8:36 ` marxin at gcc dot gnu.org
@ 2022-05-06 17:16 ` hjl.tools at gmail dot com
  2022-05-06 17:29 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-05-06 17:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Rainer Orth from comment #0)
> 
> The usual way throughout the code base is to guard .note.GNU-stack with
> __ELF__ && __linux__ to avoid all this.

Isn't checking __linux__ sufficient?

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-05-06 17:16 ` hjl.tools at gmail dot com
@ 2022-05-06 17:29 ` jakub at gcc dot gnu.org
  2022-05-06 18:01 ` hjl.tools at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-06 17:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I hope nobody cares about Linux a.out anymore.
But
#if defined(__ELF__) && defined(__linux__)
        .section .note.GNU-stack,"",@progbits
        .previous
#endif
is I think the most widely used way how to do it.

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-05-06 17:29 ` jakub at gcc dot gnu.org
@ 2022-05-06 18:01 ` hjl.tools at gmail dot com
  2022-05-06 18:01 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-05-06 18:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 52935
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52935&action=edit
A patch

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-05-06 18:01 ` hjl.tools at gmail dot com
@ 2022-05-06 18:01 ` hjl.tools at gmail dot com
  2022-05-09 10:15 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-05-06 18:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-05-06 18:01 ` hjl.tools at gmail dot com
@ 2022-05-09 10:15 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2022-05-10 16:42 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2022-05-09 10:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

--- Comment #4 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
> Created attachment 52935
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52935&action=edit
> A patch

This fixed all the failures.  Thanks.

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-05-09 10:15 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2022-05-10 16:42 ` cvs-commit at gcc dot gnu.org
  2022-05-10 16:43 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 16:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:71eae0fd3dd7a5f30067ea26a06a8774355fd5cc

commit r13-276-g71eae0fd3dd7a5f30067ea26a06a8774355fd5cc
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 6 10:55:53 2022 -0700

    x86: Add .note.GNU-stack section only for Linux

    Add .note.GNU-stack section only for Linux since it may not be supported
    on non-Linux OSes.  __ELF__ isn't checked since these tests can only run
    on Linux/x86 ELF systems.

            PR target/105472
            * gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section
            only for Linux.
            * gcc.target/x86_64/abi/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512fp16/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise.

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-05-10 16:42 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 16:43 ` cvs-commit at gcc dot gnu.org
  2022-05-10 16:51 ` cvs-commit at gcc dot gnu.org
  2022-05-10 20:14 ` hjl.tools at gmail dot com
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 16:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:ab8a8d053734d6abc6ee9c5bfb772ff95ba74fc9

commit r12-8363-gab8a8d053734d6abc6ee9c5bfb772ff95ba74fc9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 6 10:55:53 2022 -0700

    x86: Add .note.GNU-stack section only for Linux

    Add .note.GNU-stack section only for Linux since it may not be supported
    on non-Linux OSes.  __ELF__ isn't checked since these tests can only run
    on Linux/x86 ELF systems.

            PR target/105472
            * gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section
            only for Linux.
            * gcc.target/x86_64/abi/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512fp16/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise.

    (cherry picked from commit 71eae0fd3dd7a5f30067ea26a06a8774355fd5cc)

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2022-05-10 16:43 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 16:51 ` cvs-commit at gcc dot gnu.org
  2022-05-10 20:14 ` hjl.tools at gmail dot com
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 16:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:6b5ca56fec4f713add424a5131350b28ce81e9da

commit r11-9976-g6b5ca56fec4f713add424a5131350b28ce81e9da
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri May 6 10:55:53 2022 -0700

    x86: Add .note.GNU-stack section only for Linux

    Add .note.GNU-stack section only for Linux since it may not be supported
    on non-Linux OSes.  __ELF__ isn't checked since these tests can only run
    on Linux/x86 ELF systems.

            PR target/105472
            * gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section
            only for Linux.
            * gcc.target/x86_64/abi/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise.
            * gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise.

    (cherry picked from commit 71eae0fd3dd7a5f30067ea26a06a8774355fd5cc)

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

* [Bug target/105472] [13 regression] .note.GNU-stack breaks many Solaris/x86 tests
  2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2022-05-10 16:51 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 20:14 ` hjl.tools at gmail dot com
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2022-05-10 20:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105472

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|WAITING                     |RESOLVED

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed.

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

end of thread, other threads:[~2022-05-10 20:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04  8:24 [Bug target/105472] New: [13 regression] .note.GNU-stack breaks many Solaris/x86 tests ro at gcc dot gnu.org
2022-05-04  8:24 ` [Bug target/105472] " ro at gcc dot gnu.org
2022-05-04  8:36 ` marxin at gcc dot gnu.org
2022-05-06 17:16 ` hjl.tools at gmail dot com
2022-05-06 17:29 ` jakub at gcc dot gnu.org
2022-05-06 18:01 ` hjl.tools at gmail dot com
2022-05-06 18:01 ` hjl.tools at gmail dot com
2022-05-09 10:15 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-05-10 16:42 ` cvs-commit at gcc dot gnu.org
2022-05-10 16:43 ` cvs-commit at gcc dot gnu.org
2022-05-10 16:51 ` cvs-commit at gcc dot gnu.org
2022-05-10 20:14 ` hjl.tools at gmail dot com

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