msys2/MINGW-packages

GCC is missing support for gcodeview

Febbe opened this issue · 9 comments

Febbe commented

Description / Steps to reproduce the issue

When compiling something on windows/msys2/UCRT64 with the -gcodeview option, to generate windbg pdb files, the compilation fails. The installed GCC does not support gcodeview, even when it should, because it compiles for windows.
See https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

Maybe, gcc must be built with an additional flag to support it.

Steps to reproduce:

  1. Open UCRT
  2. pacman -Syuu mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gdb 13.2-2
  3. gcc -gcodeview path/to/some/source-file

Expected behavior

It compiles

Actual behavior

$ gcc -gcodeview
gcc.exe: error: unrecognized debug output level 'codeview'
gcc.exe: fatal error: no input files
compilation terminated.

Note that clang on clang64 compiles just fine.

Verification

Windows Version

MINGW64_NT-10.0-22621

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANG32
  • CLANGARM64

Are you willing to submit a PR?

No response

Febbe commented

Requires gcc-14, so probably not solvable for now.

lazka commented

Is this really just gcc-mirror/gcc@2f7e7bf ?

We can certainly backport that if wanted.

edit: more context: https://inbox.sourceware.org/gcc-patches/a22433f5-b4d2-19b7-86a2-31e2ee45fb61@martin.st/T/

Febbe commented

I can wait until gcc-14 is released :).

I believe the backport may have been premature - The -gcodeview option is reportedly not fully implemented yet, and produces incomplete debug information that results in an error when used with Visual Studio's debugger "A matching symbol was not found in this folder"

lazka commented

Some more info for future reference, afer some digging in the mailing lists:

Since gcc 14 will have the option as we have it now, I think the backport does no harm.

Sorry @TheShermanTanker for the false hopes :)

Sigh, looks like the JDK will have to continue using DWARF debuginfo for now. Thanks for the info, no worries

Febbe commented

Sigh, looks like the JDK will have to continue using DWARF debuginfo for now. Thanks for the info, no worries

You could use clang / llvm instead. They support -gcodeview

Sigh, looks like the JDK will have to continue using DWARF debuginfo for now. Thanks for the info, no worries

You could use clang / llvm instead. They support -gcodeview

That would require me to throw away all the work I've done with porting the JDK to work with the primary compiler for MSYS2 (gcc), which I unfortunately cannot do

Febbe commented

That would require me to throw away all the work I've done with porting the JDK to work with the primary compiler for MSYS2 (gcc), which I unfortunately cannot do

What do you mean with primary compiler?
one of ucrt64/bin/gcc / mingw64/bin/gcc or the one in /bin/gcc directly?
For the first, just install clang64/bin/clang, it supports nearly all GCC intrinsics and compile flags.
Regarding the latter, you could try to compile llvm with gcc and then compile the jdk with the newly created clang.