Tickling a GCC 8.2.0 bug cross-compiling to mingw-w64
Congratulations on the latest releases and continuing work on the suite.
This is not an MKVToolNix bug. This is a problem with GCC, but I thought you would like to know, and I can't see it elsewhere on this list.
GCC 8.2.0 when cross-compiling to the mingw-w64 platform has a bug which is tickled by MKVToolNix's compiler flags. The binaries crash with SEGSEGV on start-up when functions withing the MKVToolNix code start to get called. For example, this is what happens in mkvinfo.exe
#0 __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at src/common/unique_numbers.cpp:97
#1 0x00000000004616f9 in _GLOBAL__sub_I__Z28clear_list_of_unique_numbers20unique_id_category_e ()
at src/common/unique_numbers.cpp:97
#2 0x0000000000492ab2 in __do_global_ctors () at ../../src/mingw-w64-git/mingw-w64-crt/crt/gccmain.c:67
#3 0x0000000000492b0f in __main () at ../../src/mingw-w64-git/mingw-w64-crt/crt/gccmain.c:83
#4 0x000000000040137f in __tmainCRTStartup () at ../../src/mingw-w64-git/mingw-w64-crt/crt/crtexe.c:329
#5 0x000000000040150b in mainCRTStartup () at ../../src/mingw-w64-git/mingw-w64-crt/crt/crtexe.c:223
Altering ac/compiler_flags.m4 to remove references to "-fstack-protection" and "-fstack-protection-strong" causes the binaries not to crash, and full goodness to resume.
This seems to be understood and noted as a concern among those developing GCC, but I thought you might want to know here, in case anyone else thinks is a bug in your code, which it is not.