public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files
@ 2021-08-19 20:57 dcmay at copper dot net
  2021-08-19 21:04 ` [Bug debug/101987] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dcmay at copper dot net @ 2021-08-19 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101987
           Summary: gcc 10.3.1 fails to generate debugging information for
                    aarch64 .S files
           Product: gcc
           Version: 10.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcmay at copper dot net
  Target Milestone: ---

Created attachment 51325
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51325&action=edit
simple makefile project

Using the ARM / linaro aarch64-none-elf build of gcc 10.3.1, building a bare
metal bootloader, (at least) the boot.S entry code is missing all debugging
information. As such, gdb fails to step or honor breakpoints in the startup
code.

linaro's 10.2.1 version generates debugging information as expected; and the
same file compiled with the Ubuntu 20.04 gcc-10.3.0 aarch64 cross compiler
matches exactly (except for AS version number), when viewed using objdump -W.

The problem is trivially reproduced using the attached project, which builds
with missing debug info in target/boot.o using linaro's 10.3.1 cross compiler.

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

* [Bug debug/101987] gcc 10.3.1 fails to generate debugging information for aarch64 .S files
  2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
@ 2021-08-19 21:04 ` pinskia at gcc dot gnu.org
  2021-08-19 21:08 ` dcmay at copper dot net
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-19 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-08-19
             Status|UNCONFIRMED                 |WAITING

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC seems to be involving as correctly with -g on the trunk:
 ./as --gdwarf2 -v -EL -mabi=lp64 -o /tmp/ccu6moah.o /tmp/ccOieH6c.s


Can you provide the output of "aarch64-none-elf-gcc -v -g boot.S -c"

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

* [Bug debug/101987] gcc 10.3.1 fails to generate debugging information for aarch64 .S files
  2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
  2021-08-19 21:04 ` [Bug debug/101987] " pinskia at gcc dot gnu.org
@ 2021-08-19 21:08 ` dcmay at copper dot net
  2021-08-19 21:11 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dcmay at copper dot net @ 2021-08-19 21:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Dietmar May <dcmay at copper dot net> ---
$ /opt/linaro/10.3.1/bin/aarch64-none-elf-gcc -v -g src/boot.S -c
Using built-in specs.
COLLECT_GCC=/opt/linaro/10.3.1/bin/aarch64-none-elf-gcc
Target: aarch64-none-elf
Configured with: /data/jenkins/workspace/GNU-toolchain/arm-10/src/gcc/configure
--target=aarch64-none-elf
--prefix=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-elf/install//
--with-gmp=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-elf/host-tools
--with-mpfr=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-elf/host-tools
--with-mpc=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-elf/host-tools
--with-isl=/data/jenkins/workspace/GNU-toolchain/arm-10/build-aarch64-none-elf/host-tools
--disable-shared --disable-nls --disable-threads --disable-tls
--enable-checking=release --enable-languages=c,c++,fortran --with-newlib
--with-pkgversion='GNU Toolchain for the A-profile Architecture 10.3-2021.07
(arm-10.29)' --with-bugurl=https://bugs.linaro.org/
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 10.3.1 20210621 (GNU Toolchain for the A-profile Architecture
10.3-2021.07 (arm-10.29)) 
COLLECT_GCC_OPTIONS='-v' '-g' '-c' '-mlittle-endian' '-mabi=lp64'
 /opt/linaro/10.3.1/bin/../libexec/gcc/aarch64-none-elf/10.3.1/cc1 -E -lang-asm
-quiet -v -iprefix /opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/
src/boot.S -mlittle-endian -mabi=lp64 -g -fworking-directory
-fno-directives-only -o /tmp/ccjOmWwv.s
ignoring nonexistent directory
"/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/sys-include"
ignoring duplicate directory
"/opt/linaro/10.3.1/bin/../lib/gcc/../../lib/gcc/aarch64-none-elf/10.3.1/include"
ignoring duplicate directory
"/opt/linaro/10.3.1/bin/../lib/gcc/../../lib/gcc/aarch64-none-elf/10.3.1/include-fixed"
ignoring nonexistent directory
"/opt/linaro/10.3.1/bin/../lib/gcc/../../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/sys-include"
ignoring duplicate directory
"/opt/linaro/10.3.1/bin/../lib/gcc/../../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/include
 /opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/include-fixed

/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-g' '-c' '-mlittle-endian' '-mabi=lp64'

/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/bin/as
--gdwarf2 -EL -mabi=lp64 -o boot.o /tmp/ccjOmWwv.s
COMPILER_PATH=/opt/linaro/10.3.1/bin/../libexec/gcc/aarch64-none-elf/10.3.1/:/opt/linaro/10.3.1/bin/../libexec/gcc/:/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/bin/
LIBRARY_PATH=/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/:/opt/linaro/10.3.1/bin/../lib/gcc/:/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/lib/
COLLECT_GCC_OPTIONS='-v' '-g' '-c' '-mlittle-endian' '-mabi=lp64'

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

* [Bug debug/101987] gcc 10.3.1 fails to generate debugging information for aarch64 .S files
  2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
  2021-08-19 21:04 ` [Bug debug/101987] " pinskia at gcc dot gnu.org
  2021-08-19 21:08 ` dcmay at copper dot net
@ 2021-08-19 21:11 ` pinskia at gcc dot gnu.org
  2021-08-19 21:26 ` dcmay at copper dot net
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-19 21:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> /opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/../../../../aarch64-none-elf/bin/as --gdwarf2 -EL -mabi=lp64 -o boot.o /tmp/ccjOmWwv.s

So GCC is doing the right thing; that is passing --gdwarf2 which enables
emitting debug info for the assembly file.  It is either a binutils issue or it
is a bug in your makefile.

You should report this to the Linaro folks anyways since they are the release
of the toolchain.

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

* [Bug debug/101987] gcc 10.3.1 fails to generate debugging information for aarch64 .S files
  2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
                   ` (2 preceding siblings ...)
  2021-08-19 21:11 ` pinskia at gcc dot gnu.org
@ 2021-08-19 21:26 ` dcmay at copper dot net
  2021-08-19 22:02 ` schwab@linux-m68k.org
  2021-08-20  0:25 ` dcmay at copper dot net
  5 siblings, 0 replies; 7+ messages in thread
From: dcmay at copper dot net @ 2021-08-19 21:26 UTC (permalink / raw)
  To: gcc-bugs

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

Dietmar May <dcmay at copper dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #4 from Dietmar May <dcmay at copper dot net> ---
You're correct.


$ /opt/linaro/10.3.1/bin/../libexec/gcc/aarch64-none-elf/10.3.1/cc1 -E
-lang-asm -quiet -v -iprefix
/opt/linaro/10.3.1/bin/../lib/gcc/aarch64-none-elf/10.3.1/ src/boot.S
-mlittle-endian -mabi=lp64 -g -fworking-directory -fno-directives-only -o tmp.s

preprocesses the .S -> .s for as


$ /opt/linaro/10.2.1/bin/aarch64-none-elf-as --gdwarf2 -EL -mabi=lp64 -o boot.o
tmp.s

yields a .o file with debug info


$ /opt/linaro/10.3.1/bin/aarch64-none-elf-as --gdwarf2 -EL -mabi=lp64 -o boot.o
tmp.s

yields a .o file missing debug info


ergo it's not a gcc issue.

Thanks for helping to diagnose this so quickly.

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

* [Bug debug/101987] gcc 10.3.1 fails to generate debugging information for aarch64 .S files
  2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
                   ` (3 preceding siblings ...)
  2021-08-19 21:26 ` dcmay at copper dot net
@ 2021-08-19 22:02 ` schwab@linux-m68k.org
  2021-08-20  0:25 ` dcmay at copper dot net
  5 siblings, 0 replies; 7+ messages in thread
From: schwab@linux-m68k.org @ 2021-08-19 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |INVALID

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

* [Bug debug/101987] gcc 10.3.1 fails to generate debugging information for aarch64 .S files
  2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
                   ` (4 preceding siblings ...)
  2021-08-19 22:02 ` schwab@linux-m68k.org
@ 2021-08-20  0:25 ` dcmay at copper dot net
  5 siblings, 0 replies; 7+ messages in thread
From: dcmay at copper dot net @ 2021-08-20  0:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Dietmar May <dcmay at copper dot net> ---
I've confirmed that the issue is present in binutils 2.36.1, but not 2.35.1

ARM / Linaro's aarch64 10.2.1 toolchain uses binutils 2.35.1
Their 10.3.1 toolchain uses binutils 2.36.1

By copying the 'as' binary from 10.2.1 to the 10.3.1 toolchain, I've confirmed
that the boot.o file contains debugging information, and this problem does not
appear.

In other words, running with gcc 10.3.1, but with the binutils 2.35.1 as
assembler, there is no problem.

I've also confirmed this by assembling using my own mingw build of binutils
2.36.1

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

end of thread, other threads:[~2021-08-20  0:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 20:57 [Bug debug/101987] New: gcc 10.3.1 fails to generate debugging information for aarch64 .S files dcmay at copper dot net
2021-08-19 21:04 ` [Bug debug/101987] " pinskia at gcc dot gnu.org
2021-08-19 21:08 ` dcmay at copper dot net
2021-08-19 21:11 ` pinskia at gcc dot gnu.org
2021-08-19 21:26 ` dcmay at copper dot net
2021-08-19 22:02 ` schwab@linux-m68k.org
2021-08-20  0:25 ` dcmay at copper dot net

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