public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/101283] New: Severaal test fail on Darwin with -gctf
@ 2021-07-01 11:42 dominiq at lps dot ens.fr
  2021-07-01 15:56 ` [Bug debug/101283] Several tests " cvs-commit at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-07-01 11:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101283
           Summary: Severaal test fail on Darwin with -gctf
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominiq at lps dot ens.fr
                CC: iains at gcc dot gnu.org
  Target Milestone: ---
              Host: x86_64-apple-darwin20
            Target: x86_64-apple-darwin20
             Build: x86_64-apple-darwin20

Severaal test fail on Darwin with -gctf

FAIL: gcc.dg/debug/20020220-1.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/20020220-1.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/20020327-1.c -gctf (test for excess errors)
FAIL: gcc.dg/debug/20050907-1.c -gctf (test for excess errors)
FAIL: gcc.dg/debug/pr29609-1.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/pr29609-1.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/pr29609-2.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/pr29609-2.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/pr36690-1.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/pr36690-1.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/pr36690-2.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/pr36690-2.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/pr36690-3.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/pr36690-3.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/pr37616.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/pr37616.c -gctf compilation failed to produce
executable
FAIL: gcc.dg/debug/pr41893-1.c -gctf (test for excess errors)
FAIL: gcc.dg/debug/pr49032.c -gctf (test for excess errors)
FAIL: gcc.dg/debug/pr65771.c -gctf (test for excess errors)
FAIL: gcc.dg/debug/tls-1.c -gctf (test for excess errors)
FAIL: gcc.dg/debug/trivial.c -gctf (test for excess errors)
UNRESOLVED: gcc.dg/debug/trivial.c -gctf compilation failed to produce
executable

The errors are

% /opt/gcc/gcc12w/bin/gcc /opt/gcc/work/gcc/testsuite/gcc.dg/debug/trivial.c
-gctf
/var/folders/ls/2kcvbftx2bj70mvvv8j7cclm0000gn/T//ccfWQsWN.s:1:15: error:
unexpected token in '.section' directive
        .section .ctf
                     ^

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
@ 2021-07-01 15:56 ` cvs-commit at gcc dot gnu.org
  2021-07-01 16:22 ` ibhagatgnu at gmail dot com
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-01 15:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

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

commit r12-1960-gcc8453012f75dc6dbd20bf3a94c4819a2bff46db
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Thu Jul 1 15:02:43 2021 +0100

    Darwin: Define a suitable section name for CTF [PR101283]

    This is a placeholder name ahead of any CTF implementation on
    LLVM (which sets Darwin ABI).  Ideally, we would get agreement
    on this choice (or any replacement) before GCC12 is shipped.

    PR debug/101283 - Several tests fail on Darwin with -gctf

            PR debug/101283

    gcc/ChangeLog:

            * config/darwin.h (CTF_INFO_SECTION_NAME): New.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
  2021-07-01 15:56 ` [Bug debug/101283] Several tests " cvs-commit at gcc dot gnu.org
@ 2021-07-01 16:22 ` ibhagatgnu at gmail dot com
  2021-07-01 16:32 ` iains at gcc dot gnu.org
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagatgnu at gmail dot com @ 2021-07-01 16:22 UTC (permalink / raw)
  To: gcc-bugs

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

Indu Bhagat <ibhagatgnu at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibhagatgnu at gmail dot com

--- Comment #2 from Indu Bhagat <ibhagatgnu at gmail dot com> ---
I see that .section directive needs a different semantic for Darwin.  The DWARF
debug_info section, for example, appears as:

        .section __DWARF,__debug_info,regular,debug
Lsection__debug_info:
Ldebug_info0:

This implies GCC needs to emit the .ctf section adhering to the required
semantics. I see now that this recent commit adds the required CTF section name
strings explicitly for Darwin (config/darwin.h).

Not only that, accompanying changes need to be made in gas/bfd to support the
new __CTF category or the CTF section ?

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
  2021-07-01 15:56 ` [Bug debug/101283] Several tests " cvs-commit at gcc dot gnu.org
  2021-07-01 16:22 ` ibhagatgnu at gmail dot com
@ 2021-07-01 16:32 ` iains at gcc dot gnu.org
  2021-07-01 16:46 ` dominiq at lps dot ens.fr
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2021-07-01 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Indu Bhagat from comment #2)
> I see that .section directive needs a different semantic for Darwin.  The
> DWARF debug_info section, for example, appears as:
> 
>         .section __DWARF,__debug_info,regular,debug
> Lsection__debug_info:
> Ldebug_info0:
> 
> This implies GCC needs to emit the .ctf section adhering to the required
> semantics. I see now that this recent commit adds the required CTF section
> name strings explicitly for Darwin (config/darwin.h).

that's all fixed with the patch above.. .. but ..

> Not only that, accompanying changes need to be made in gas/bfd to support
> the new __CTF category or the CTF section ?

Well .. how this new feature will be used on non-ELF platforms remains to be
seen.

If there is no platform consumer for the format, then I imagine that the
take-up will be slow.

Darwin does not use GAS/binutils by default, the assembler comes from LLVM, the
"binutils" come in part from LLVM and in part from Apple's "cctools" package. 
Unless there is support for CTF in LLDB the majority of Darwin users will not
be able to make use of it.

GDB can (probably) be built for Darwin (there were some issues last time I
tried), but if there are BFD changes needed? 

There are also test fails which are most likely from Darwin's optimisation of
DWARF debug to eliminate most relocations (by using file-offsets from which the
addresses can be computed by the DWARF importer).  TBH I have not looked at any
of this (and Darwin is not the only non-ELF platform)

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (2 preceding siblings ...)
  2021-07-01 16:32 ` iains at gcc dot gnu.org
@ 2021-07-01 16:46 ` dominiq at lps dot ens.fr
  2021-07-02  6:16 ` [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf rguenth at gcc dot gnu.org
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dominiq at lps dot ens.fr @ 2021-07-01 16:46 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-07-01
     Ever confirmed|0                           |1

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (3 preceding siblings ...)
  2021-07-01 16:46 ` dominiq at lps dot ens.fr
@ 2021-07-02  6:16 ` rguenth at gcc dot gnu.org
  2021-07-02  9:01 ` iains at gcc dot gnu.org
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-02  6:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
It might make sense to provide targets a means to opt-out of CTF/BTF support
and thus diagnose -gctf as unsupported on them.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (4 preceding siblings ...)
  2021-07-02  6:16 ` [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf rguenth at gcc dot gnu.org
@ 2021-07-02  9:01 ` iains at gcc dot gnu.org
  2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2021-07-02  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> It might make sense to provide targets a means to opt-out of CTF/BTF support
> and thus diagnose -gctf as unsupported on them.

In the short-term, I've got fixes for the invocation-related issues, which I'll
commit today.

A new debug format is clearly a vast undertaking - requiring buy-in from many
organisations - in the case of Darwin, it will mean amendment to ld64 (to
recognise and deal with relocation-less offsets) and dsymutil (to handle
linking the debug) and then lldb / gdb / backtrace etc. to deal with common
consumers.  Releases for these tools are controlled by Apple - clearly one can
self-build hacked version, but that's extremely unlikely to reach the larger
majority of Darwin/macOS developers.

== for opt out.

It would be a simple matter to add a driver self-spec to reject '-gctf' and
'-gbtf' (which can be arranged to give an error) and then, I guess, to add
opt-out to the testsuite selectors?

In any event, opt-out is likely the only sensible action for older platforms
where "rebuild the world" is not an option; how can this interoperate with
existing libraries etc. using DWARF debug?

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (5 preceding siblings ...)
  2021-07-02  9:01 ` iains at gcc dot gnu.org
@ 2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
  2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-02 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

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

commit r12-1982-geb817f27e82769aef545d580a0c47a3aa50d1ec4
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Fri Jul 2 09:44:59 2021 +0100

    Darwin, BTF: Provide a suitable section name for BTF [PR101283].

    In a similar manner to r12-1960-gcc8453012f75d, this provides a
    placeholder section name for BTF data.  This change groups BTF
    and CTF debug formats in the same segment, but keeps them in
    separate sections.

    As per the CTF section designation, this should be agreed or
    amended to an agreed form before GCC 12 ships.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

    PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf

            PR debug/101283

    gcc/ChangeLog:

            * config/darwin.h (CTF_INFO_SECTION_NAME): Update the
            segment to include BTF.
            (BTF_INFO_SECTION_NAME): New.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (6 preceding siblings ...)
  2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
@ 2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
  2021-07-02 14:55 ` iains at gcc dot gnu.org
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-02 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:85017431068251628478f38346c273418c71209b

commit r12-1983-g85017431068251628478f38346c273418c71209b
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Fri Jul 2 09:51:57 2021 +0100

    Darwin, CTF, BTF: Do not run the DWARF debug link for BTF/CTF [PR101283].

    Darwin uses an efficient two-stage process for debug linking.
    The static linker (ld64) notes the inputs required but does not
    link the debug.  When required / on demand the debug is linked
    into a separate package by the debug linker (dsymutil).  At
    present none of the Darwin tools consume or understand BTF/CTF.
    The static linker silently accepts the sections (but will not
    act on them as containing anything to be processed).

    However, the debug linker produces a warning that it has been
    presented with input with no [DWARF] debug content:
    warning: no debug symbols in executable (-arch x86_64).

    This causes several testsuite fails with excess errors.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

    PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf

            PR debug/101283

    gcc/ChangeLog:

            * config/darwin.h (DSYMUTIL_SPEC): Do not try to run
            dsymutil for BTF/CTF.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (7 preceding siblings ...)
  2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
@ 2021-07-02 14:55 ` iains at gcc dot gnu.org
  2021-07-02 15:13 ` iains at gcc dot gnu.org
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2021-07-02 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> ---
we are now left with (where I suspect that the remaining fails are an artefact
of the way in which Darwin represents offsets instead of relocations in DWARF
debug sections):

Running target unix/-m64

Running /src-local/gcc-master/gcc/testsuite/gcc.dg/debug/btf/btf.exp ...
FAIL: gcc.dg/debug/btf/btf-bitfields-1.c scan-assembler-times [\t ]0xa000020[\t
]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-1.c scan-assembler-times [\t ]0x700002a[\t
]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-1.c scan-assembler-times [\t
]0x13000040[\t ]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-2.c scan-assembler-times [\t
]0x20000020[\t ]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-3.c scan-assembler-times [\t ]0x2[\t
]+[^\n]*btm_type 1
FAIL: gcc.dg/debug/btf/btf-bitfields-4.c scan-assembler-times [\t ]0x4000003[\t
]+[^\n]*btt_info 1
FAIL: gcc.dg/debug/btf/btf-cvr-quals-1.c scan-assembler-times [\t ]0xb000000[\t
]+[^\n]*btt_info 2
Running /src-local/gcc-master/gcc/testsuite/gcc.dg/debug/ctf/ctf.exp ...
FAIL: gcc.dg/debug/ctf/ctf-attr-mode-1.c scan-assembler-times [\t ]0x3[\t
]+[^\n]*ctv_typeidx 1
FAIL: gcc.dg/debug/ctf/ctf-cvr-quals-1.c scan-assembler-times [\t ]0[\t
]+[^\n]*ctt_name 7
FAIL: gcc.dg/debug/ctf/ctf-cvr-quals-1.c scan-assembler-times [\t
]0x36000000[\t ]+[^\n]*ctt_info 2
Running /src-local/gcc-master/gcc/testsuite/gcc.dg/debug/debug.exp ...

                === gcc Summary for unix/-m64 ===

# of expected passes            1214
# of unexpected failures        10
# of unsupported tests          24
Running target unix/-m32

Running /src-local/gcc-master/gcc/testsuite/gcc.dg/debug/btf/btf.exp ...
FAIL: gcc.dg/debug/btf/btf-bitfields-1.c scan-assembler-times [\t ]0xa000020[\t
]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-1.c scan-assembler-times [\t ]0x700002a[\t
]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-1.c scan-assembler-times [\t
]0x13000040[\t ]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-2.c scan-assembler-times [\t
]0x20000020[\t ]+[^\n]*btm_offset 1
FAIL: gcc.dg/debug/btf/btf-bitfields-3.c scan-assembler-times [\t ]0x2[\t
]+[^\n]*btm_type 1
FAIL: gcc.dg/debug/btf/btf-bitfields-4.c scan-assembler-times [\t ]0x4000003[\t
]+[^\n]*btt_info 1
FAIL: gcc.dg/debug/btf/btf-cvr-quals-1.c scan-assembler-times [\t ]0xb000000[\t
]+[^\n]*btt_info 2
Running /src-local/gcc-master/gcc/testsuite/gcc.dg/debug/ctf/ctf.exp ...
FAIL: gcc.dg/debug/ctf/ctf-attr-mode-1.c scan-assembler-times [\t ]0x3[\t
]+[^\n]*ctv_typeidx 1
FAIL: gcc.dg/debug/ctf/ctf-cvr-quals-1.c scan-assembler-times [\t ]0[\t
]+[^\n]*ctt_name 7
FAIL: gcc.dg/debug/ctf/ctf-cvr-quals-1.c scan-assembler-times [\t
]0x36000000[\t ]+[^\n]*ctt_info 2
Running /src-local/gcc-master/gcc/testsuite/gcc.dg/debug/debug.exp ...

                === gcc Summary for unix/-m32 ===

# of expected passes            1214
# of unexpected failures        10
# of unsupported tests          24

                === gcc Summary ===

# of expected passes            2428
# of unexpected failures        20
# of unsupported tests          48

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (8 preceding siblings ...)
  2021-07-02 14:55 ` iains at gcc dot gnu.org
@ 2021-07-02 15:13 ` iains at gcc dot gnu.org
  2021-07-05 15:27 ` ibhagatgnu at gmail dot com
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2021-07-02 15:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #8)
> we are now left with (where I suspect that the remaining fails are an
> artefact of the way in which Darwin represents offsets instead of
> relocations in DWARF debug sections):

on a bit more looking, that is probably not the reason - I guess we will have
to look at what the represented structures are and why they have different
renderings for Darwin.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (9 preceding siblings ...)
  2021-07-02 15:13 ` iains at gcc dot gnu.org
@ 2021-07-05 15:27 ` ibhagatgnu at gmail dot com
  2021-07-05 20:42 ` iains at gcc dot gnu.org
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagatgnu at gmail dot com @ 2021-07-05 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Indu Bhagat <ibhagatgnu at gmail dot com> ---
(In reply to Iain Sandoe from comment #9)
> (In reply to Iain Sandoe from comment #8)
> > we are now left with (where I suspect that the remaining fails are an
> > artefact of the way in which Darwin represents offsets instead of
> > relocations in DWARF debug sections):
> 
> on a bit more looking, that is probably not the reason - I guess we will
> have to look at what the represented structures are and why they have
> different renderings for Darwin.

I am looking into these failures one by one.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (10 preceding siblings ...)
  2021-07-05 15:27 ` ibhagatgnu at gmail dot com
@ 2021-07-05 20:42 ` iains at gcc dot gnu.org
  2021-07-05 21:20 ` ibhagatgnu at gmail dot com
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2021-07-05 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Indu Bhagat from comment #10)
> (In reply to Iain Sandoe from comment #9)
> > (In reply to Iain Sandoe from comment #8)
> > > we are now left with (where I suspect that the remaining fails are an
> > > artefact of the way in which Darwin represents offsets instead of
> > > relocations in DWARF debug sections):
> > 
> > on a bit more looking, that is probably not the reason - I guess we will
> > have to look at what the represented structures are and why they have
> > different renderings for Darwin.
> 
> I am looking into these failures one by one.

It seems that the issue is as you noted on IRC, that Darwin defaults to
generating DWARF-2.

I have confirmed that overriding this to DWARF-4 for btf/ctf fixes the test
fails - I'll make an interim patch to do this in Darwin's option processing.

However, I guess the bottom line question is "do you intend to support versions
of DWARF earlier than 4 as a source for BTF/CTF"?

The corner-case comes when a user enables both CTF and DWARF, in which case we
could be demanding a higher version of DWARF to support CTF than the system
tools can handle for the dwarf output.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (11 preceding siblings ...)
  2021-07-05 20:42 ` iains at gcc dot gnu.org
@ 2021-07-05 21:20 ` ibhagatgnu at gmail dot com
  2021-07-06  0:47 ` cvs-commit at gcc dot gnu.org
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagatgnu at gmail dot com @ 2021-07-05 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Indu Bhagat <ibhagatgnu at gmail dot com> ---
The intention is to be able to generate CTF/BTF correctly irrespective of the
DWARF version.

The case of DW_TAG_restrict_type is unique though, and looks like we will need
special handling.  To be specific, the 'restrict' keyword related failures are:
  - gcc.dg/debug/ctf/ctf-cvr-quals-1.c
  - gcc.dg/debug/btf/btf-cvr-quals-1.c 
DW_TAG_restrict_type is not generated for DWARF-2. So, adding a target specific
option for these looks like a reasonable way forward.

So for the btf testcase, something like - 
/* { dg-options "-O0 -gbtf -dA -gdwarf-4" { target { *-*-darwin* } } } */

Next, for some of the *-bitfield-*.c test failures, the issue can be masked
away by forcing -gdwarf-4, yes. But the correct fix can be done in dwarf2ctf.c
and with that, there is not need to force a -gdwarf-4 in those tests.

I will post a patch for these two soon.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (12 preceding siblings ...)
  2021-07-05 21:20 ` ibhagatgnu at gmail dot com
@ 2021-07-06  0:47 ` cvs-commit at gcc dot gnu.org
  2021-07-06  1:28 ` ibhagatgnu at gmail dot com
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-06  0:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Indu Bhagat <ibhagat@gcc.gnu.org>:

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

commit r12-2044-ga3543b5e8002c033b2304d7ac1d1e58218eebb51
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Mon Jul 5 17:28:24 2021 -0700

    CTF,BTF testsuite: Use -gdwarf-4 for restrict type qualifier [PR101283]

    DWARF DIEs do not contain DW_TAG_restrict_type when DWARF version is 2.
CTF/BTF
    generation feeds off DWARF DIEs, and as such, CTF records of kind
    CTF_K_RESTRICT cease to be generated when DWARF version is 2.

    This patch fixes the failure of these testcases on Darwin by using an
explicit
    -gdwarf-4 in the dg-options. This keeps the CTF record generation for
restrict
    type qualifier tested.

      PR debug/101283 - Several tests fail on Darwin with -gctf/gbtf

    2021-07-05  Indu Bhagat  <indu.bhagat@oracle.com>

    gcc/testsuite/ChangeLog:

            PR debug/101283
            * gcc.dg/debug/btf/btf-cvr-quals-1.c: Use -gdwarf-4 on Darwin
targets.
            * gcc.dg/debug/ctf/ctf-cvr-quals-1.c: Likewise.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (13 preceding siblings ...)
  2021-07-06  0:47 ` cvs-commit at gcc dot gnu.org
@ 2021-07-06  1:28 ` ibhagatgnu at gmail dot com
  2021-07-06 21:08 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagatgnu at gmail dot com @ 2021-07-06  1:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Indu Bhagat <ibhagatgnu at gmail dot com> ---
With the two patches (commit r12-2044-ga3543b5e8002c033b2304d7ac1d1e58218eebb51
+ the other in review) only two further failures remain to be looked into:

FAIL: gcc.dg/debug/btf/btf-bitfields-3.c scan-assembler-times [\t ]0x2[\t
]+[^\n]*btm_type 1
FAIL: gcc.dg/debug/ctf/ctf-attr-mode-1.c scan-assembler-times [\t ]0x3[\t
]+[^\n]*ctv_typeidx 1

I will look into them next.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (14 preceding siblings ...)
  2021-07-06  1:28 ` ibhagatgnu at gmail dot com
@ 2021-07-06 21:08 ` cvs-commit at gcc dot gnu.org
  2021-07-06 23:05 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-06 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Indu Bhagat <ibhagat@gcc.gnu.org>:

https://gcc.gnu.org/g:151b423a82f4bf15e3225833028f5258ea254cb9

commit r12-2090-g151b423a82f4bf15e3225833028f5258ea254cb9
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Tue Jul 6 13:53:58 2021 -0700

    dwarf2ctf: the unit of sou field location is bits [PR101283]

    If the value of the DW_AT_data_member_location attribute is constant, the
    associated unit is bytes. This patch amends incorrect behaviour which was
being
    exercised with -gdwarf-2. This caused some of the failures as noted in PR
    debug/101283 (specifically the BTF tests involving btm_offset).

    The testcase ctf-struct-array-2.c was erroneously checking for the value of
    ctm_offset in number of bytes.

    The patch fixes the calculation of the field location value for a struct
member
    in dwarf2ctf and adjusts the testcase. This patch also fixes some of the
    failing tests as noted in PR debug/101283.

    2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

    gcc/ChangeLog:

            PR debug/101283
            * dwarf2ctf.c (ctf_get_AT_data_member_location): Multiply by 8 to
get
            number of bits.

    gcc/testsuite/ChangeLog:

            PR debug/101283
            * gcc.dg/debug/ctf/ctf-struct-array-2.c: Adjust the value in the
testcase.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (15 preceding siblings ...)
  2021-07-06 21:08 ` cvs-commit at gcc dot gnu.org
@ 2021-07-06 23:05 ` cvs-commit at gcc dot gnu.org
  2021-07-06 23:14 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-06 23:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Indu Bhagat <ibhagat@gcc.gnu.org>:

https://gcc.gnu.org/g:97bcacfb5ac49afa4e305489dd110cc446451549

commit r12-2093-g97bcacfb5ac49afa4e305489dd110cc446451549
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Tue Jul 6 16:02:38 2021 -0700

    CTF testsuite: Remove explicit check on ctv_typeidx

    The value of ctv_typeidx is the CTF type ID of the data type of the
associated
    variable.  The order in which the CTF types are added can change across
    platforms and also as the code evolves, hence changing the CTF type ID. As
    there is no direct and portable method of testing that the data type of a
CTF
    variable is of a specific kind, remove the check on ctv_typeidx.

    This also fixes a subset of failures as seen on Darwin.

    2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

    gcc/testsuite/ChangeLog:

            PR debug/101283
            * gcc.dg/debug/ctf/ctf-attr-mode-1.c: Remove the check for
ctv_typeidx.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (16 preceding siblings ...)
  2021-07-06 23:05 ` cvs-commit at gcc dot gnu.org
@ 2021-07-06 23:14 ` cvs-commit at gcc dot gnu.org
  2021-07-06 23:20 ` ibhagatgnu at gmail dot com
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-06 23:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Indu Bhagat <ibhagat@gcc.gnu.org>:

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

commit r12-2094-gd9e9532bb3bf5db4cd6afd49d343ede5b27c3c9f
Author: Indu Bhagat <indu.bhagat@oracle.com>
Date:   Tue Jul 6 16:11:47 2021 -0700

    BTF testsuite: Remove explicit check on btm_type

    The value of btm_type is the BTF type ID of the referred type.  The order
in
    which the BTF types are added can change across platforms and also as the
code
    evolves, hence changing the BTF type ID. As there is no direct and portable
    method of testing that a BTF type refers to another BTF type of a specific
    kind, remove the explicit check on btm_type.

    This patch adjusts the testcase without affecting the test coverage as
other
    testcases already have similar constructs. It also fixes a subset of
failures
    as seen on Darwin.

    2021-07-06  Indu Bhagat  <indu.bhagat@oracle.com>

    gcc/testsuite/ChangeLog:

            PR debug/101283
            * gcc.dg/debug/btf/btf-bitfields-3.c: Remove the check on btm_type.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (17 preceding siblings ...)
  2021-07-06 23:14 ` cvs-commit at gcc dot gnu.org
@ 2021-07-06 23:20 ` ibhagatgnu at gmail dot com
  2021-07-09  1:51 ` dje at gcc dot gnu.org
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagatgnu at gmail dot com @ 2021-07-06 23:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Indu Bhagat <ibhagatgnu at gmail dot com> ---
(In reply to Richard Biener from comment #4)
> It might make sense to provide targets a means to opt-out of CTF/BTF support
> and thus diagnose -gctf as unsupported on them.

Yes, I agree. It makes sense to have provide some means to opt out of CTF/BTF
support. I will look into this.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (18 preceding siblings ...)
  2021-07-06 23:20 ` ibhagatgnu at gmail dot com
@ 2021-07-09  1:51 ` dje at gcc dot gnu.org
  2021-09-27 19:05 ` ibhagatgnu at gmail dot com
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 24+ messages in thread
From: dje at gcc dot gnu.org @ 2021-07-09  1:51 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

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

--- Comment #19 from David Edelsohn <dje at gcc dot gnu.org> ---
I disabled on AIX because CTF and BTF were not enumerated as explicit debug
formats that emitted the normal GCC warning checked by DejaGNU.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (19 preceding siblings ...)
  2021-07-09  1:51 ` dje at gcc dot gnu.org
@ 2021-09-27 19:05 ` ibhagatgnu at gmail dot com
  2021-09-27 19:09 ` iains at gcc dot gnu.org
  2021-09-29 18:08 ` ibhagat at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagatgnu at gmail dot com @ 2021-09-27 19:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Indu Bhagat <ibhagatgnu at gmail dot com> ---
Commit https://gcc.gnu.org/g:f007a638a86e4b59bef0a0d8efa5bb8c5e5b200a added
support for targets to opt out of CTF/BTF support.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (20 preceding siblings ...)
  2021-09-27 19:05 ` ibhagatgnu at gmail dot com
@ 2021-09-27 19:09 ` iains at gcc dot gnu.org
  2021-09-29 18:08 ` ibhagat at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: iains at gcc dot gnu.org @ 2021-09-27 19:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Indu Bhagat from comment #20)
> Commit https://gcc.gnu.org/g:f007a638a86e4b59bef0a0d8efa5bb8c5e5b200a added
> support for targets to opt out of CTF/BTF support.

I think that from the Darwin perspective the problem was already fixed before
this - if that  action handles the bug for other affected targets, then it
could certainly be closed from the Darwin-PoV.

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

* [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf
  2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
                   ` (21 preceding siblings ...)
  2021-09-27 19:09 ` iains at gcc dot gnu.org
@ 2021-09-29 18:08 ` ibhagat at gcc dot gnu.org
  22 siblings, 0 replies; 24+ messages in thread
From: ibhagat at gcc dot gnu.org @ 2021-09-29 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

Indu Bhagat <ibhagat at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibhagat at gcc dot gnu.org
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #22 from Indu Bhagat <ibhagat at gcc dot gnu.org> ---
Failing tests have been fixed and target now have an option to opt out of
CTF/BTF. Closing the bug.

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

end of thread, other threads:[~2021-09-29 18:08 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01 11:42 [Bug debug/101283] New: Severaal test fail on Darwin with -gctf dominiq at lps dot ens.fr
2021-07-01 15:56 ` [Bug debug/101283] Several tests " cvs-commit at gcc dot gnu.org
2021-07-01 16:22 ` ibhagatgnu at gmail dot com
2021-07-01 16:32 ` iains at gcc dot gnu.org
2021-07-01 16:46 ` dominiq at lps dot ens.fr
2021-07-02  6:16 ` [Bug debug/101283] Several tests fail on Darwin with -gctf/gbtf rguenth at gcc dot gnu.org
2021-07-02  9:01 ` iains at gcc dot gnu.org
2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
2021-07-02 14:50 ` cvs-commit at gcc dot gnu.org
2021-07-02 14:55 ` iains at gcc dot gnu.org
2021-07-02 15:13 ` iains at gcc dot gnu.org
2021-07-05 15:27 ` ibhagatgnu at gmail dot com
2021-07-05 20:42 ` iains at gcc dot gnu.org
2021-07-05 21:20 ` ibhagatgnu at gmail dot com
2021-07-06  0:47 ` cvs-commit at gcc dot gnu.org
2021-07-06  1:28 ` ibhagatgnu at gmail dot com
2021-07-06 21:08 ` cvs-commit at gcc dot gnu.org
2021-07-06 23:05 ` cvs-commit at gcc dot gnu.org
2021-07-06 23:14 ` cvs-commit at gcc dot gnu.org
2021-07-06 23:20 ` ibhagatgnu at gmail dot com
2021-07-09  1:51 ` dje at gcc dot gnu.org
2021-09-27 19:05 ` ibhagatgnu at gmail dot com
2021-09-27 19:09 ` iains at gcc dot gnu.org
2021-09-29 18:08 ` ibhagat at gcc dot gnu.org

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