MINGW-packages icon indicating copy to clipboard operation
MINGW-packages copied to clipboard

Error generating a full debug report using gcc 14.1.0-2

Open JaiSoone opened this issue 9 months ago • 3 comments

Description / Steps to reproduce the issue

  1. download wxWidgets 3.2.4
  2. make the following changes to wxWidgets for compiling on a Microsoft windows 10 system:
diff -r 11c2f3533abe -r 71959affad03 build/msw/config.gcc
--- a/build/msw/config.gcc      Sun Feb 11 08:29:01 2024 -0800
+++ b/build/msw/config.gcc      Sun Feb 11 09:32:43 2024 -0800
@@ -23,10 +23,10 @@
 CXX = g++

 # Standard flags for CC
-CFLAGS ?=
+CFLAGS ?= -Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-omit-frame-pointer -march=native -DwxUSE_OWNER_DRAWN -freport-bug

 # Standard flags for C++
-CXXFLAGS ?=
+CXXFLAGS ?= -Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-omit-frame-pointer -march=native -DwxUSE_OWNER_DRAWN -freport-bug

 # Standard preprocessor flags (common for CC and CXX)
 CPPFLAGS ?=
diff -r 11c2f3533abe -r 71959affad03 build/msw/makefile.gcc
--- a/build/msw/makefile.gcc    Sun Feb 11 08:29:01 2024 -0800
+++ b/build/msw/makefile.gcc    Sun Feb 11 09:32:43 2024 -0800
@@ -5217,7 +5217,7 @@
 endif
 ifeq ($(BUILD),debug)
 ifeq ($(DEBUG_INFO),default)
-__DEBUGINFO = -g
+__DEBUGINFO = -ggdb3
 endif
 endif
 ifeq ($(BUILD),release)
@@ -5235,7 +5235,7 @@
 __OPTIMIZEFLAG = -O0
 endif
 ifeq ($(BUILD),release)
-__OPTIMIZEFLAG = -O2
+__OPTIMIZEFLAG = -O3
 endif
 ifeq ($(USE_THREADS),0)
 __THREADSFLAG =
diff -r 11c2f3533abe -r 71959affad03 include/wx/msw/setup.h
--- a/include/wx/msw/setup.h    Sun Feb 11 08:29:01 2024 -0800
+++ b/include/wx/msw/setup.h    Sun Feb 11 09:32:43 2024 -0800
@@ -1648,7 +1648,7 @@
 #if defined(_MSC_VER) && _MSC_VER >= 1600
     #define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
 #else
-    #define wxUSE_GRAPHICS_DIRECT2D 0
+    #define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
 #endif

 // wxWebRequest backend based on WinHTTP.
diff -r 11c2f3533abe -r 71959affad03 include/wx/msw/setup_inc.h
--- a/include/wx/msw/setup_inc.h        Sun Feb 11 08:29:01 2024 -0800
+++ b/include/wx/msw/setup_inc.h        Sun Feb 11 09:32:43 2024 -0800
@@ -33,7 +33,7 @@
 #if defined(_MSC_VER) && _MSC_VER >= 1600
     #define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
 #else
-    #define wxUSE_GRAPHICS_DIRECT2D 0
+    #define wxUSE_GRAPHICS_DIRECT2D wxUSE_GRAPHICS_CONTEXT
 #endif

 // wxWebRequest backend based on WinHTTP.

NateJoe@TinkeringAround UCRT64 ~/wxWidgets/clang/dbgTesting324/wxWidgets-3.2.4

  1. cd wxWidgets-3.2.4/build/msw

  2. mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 USE_OPENGL=0 BUILD=release clean

  3. mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 USE_OPENGL=0 BUILD=release

  4. This ends up with an error I think is being caused by trying to generate a bug report. Something about not being able to open a temporary directory:

gcc -c -o gcc_mswudll\wxjpeg_jfdctint.o  -O3 -mthreads -DNDEBUG -I..\..\lib\gcc_dll\mswu  -Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-omit-frame-pointer -march=native -DwxUSE_OWNER_DRAWN=1 -freport-bug -MTgcc_mswudll\wxjpeg_jfdctint.o -MFgcc_mswudll\wxjpeg_jfdctint.o.d -MD -MP ../../src/jpeg/jfdctint.c
during RTL pass: final
../../src/jpeg/jfdctint.c: In function 'jpeg_fdct_6x6':
../../src/jpeg/jfdctint.c:577:1: internal compiler error: in seh_cfa_offset, at config/i386/winnt.cc:1137
  577 | }
      | ^
Please submit a full bug report, with preprocessed source.
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
gcc: fatal error: cannot execute 'C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/14.1.0/cc1.exe': open temporary output file: No such file or directory
compilation terminated.
mingw32-make: *** [makefile.gcc:6341: gcc_mswudll\wxjpeg_jfdctint.o] Error 1

P.S. The only reason I'm specifying the -fno-omit-frame-pointer option is because drmingw, the post-mortem dumper used by Code::Blocks, requires it.

Expected behavior

Compiles without errors when using gcc-13.2.0

Actual behavior

gets an error trying to generate bug report.

Verification

  • [X] I have verified that my MSYS2 is up-to-date before submitting the report (see https://www.msys2.org/docs/updating/)

Windows Version

MINGW64_NT-10.0-19045

MINGW environments affected

  • [ ] MINGW64
  • [ ] MINGW32
  • [X] UCRT64
  • [ ] CLANG64
  • [ ] CLANG32
  • [ ] CLANGARM64

Are you willing to submit a PR?

No response

JaiSoone avatar May 10 '24 16:05 JaiSoone

FWIW, native for me is 'haswell'.

JaiSoone avatar May 10 '24 16:05 JaiSoone

See #20861

lazka avatar May 10 '24 17:05 lazka

I've c-reduced the wxwidget build error as well and added it to the upstream bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115038#c1

lazka avatar May 11 '24 12:05 lazka

There is a temporary workaround now by passing -fno-fold-mem-offsets

lazka avatar May 12 '24 18:05 lazka

If you don't think that it is important to get the gcc -freport-bug option to work, that is OK by me.I'll just treat it as so much boiler plate BS to be ignored should the occasion ever arise in the future.  Joe Searle

On Sunday, May 12, 2024 at 10:02:03 PM PDT, Christoph Reiter ***@***.***> wrote:   

Closed #20864 as completed via #20884.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

JaiSoone avatar May 13 '24 13:05 JaiSoone

hm, yeah, not sure. It's annoying that -freport-bug can only be tested if gcc crashes from what I see.

I've created #20894 so we don't forget at least.

btw. the fixed package is now in the repo

lazka avatar May 13 '24 18:05 lazka

Thanks for the info. I've used gcc-14.1.0-3 and it works for me. rebuilt wxWidgets and Code::Blocks, then got that to compile a debug version of itself. I was wondering if some environment variable needed to be set in order for it to find suitable temporary directory. Thanks again!

JaiSoone avatar May 16 '24 19:05 JaiSoone