|
From: Tatsuro M. <tma...@ya...> - 2022-06-06 11:43:30
|
----- Original Message ----- Date: 2022/05/27 金 02:24 Subject: Re: ABI mismatch erorr on wxt terminal on the current msys2-windows build (GCC 12) and workaound On Wednesday, 25 May 2022 22:03:57 PDT Tatsuro MATSUOKA wrote: > I updated msys2-mingw64 recently and GCC is upgraded to version 12. > I tried to build gnuplot for windows using GCC 12 and tried to use the wxt terminal. > gnuplot> set terminal wxt > gnuplot> pl x > > Error windows poped up. > URL of the Screenshot http://tmacchant33.starfree.jp/Files/wxt_ABI_mismatch.png > > Fatal Error > Mismatch between the program and library build version > detected. > The library used 3.0(wchar_t,complier with C++ ABI 1016, wx > containers, compatible with 2.8), > and your program used 3.0 (wchr_t,compiler with C++ ABI > 1017, wx containers, compatible with 2.8). That is an unfortunate bug/mis-design introduced by the some runtime library support. I do not know whether something in gcc 12 is the cause, or whether the change from gcc 11 to gcc 12 coincidentally happened at the same time. I now get similar error messages when running programs compiled before the change For example: [] gnuplot_5.2.8 -e 'plot x' Warning: Mismatch between the program and library build versions detected. The library used 2.8 (no debug,Unicode,compiler with C++ ABI 1014,wx containers,compatible with 2.6), and your program used 2.8 (no debug,Unicode,compiler with C++ ABI 1002,wx containers,compatible with 2.6). [] gnuplot_5.4.2 -e 'plot x' Warning: Mismatch between the program and library build versions detected. The library used 3.0 (wchar_t,compiler with C++ ABI 1014,wx containers,compatible with 2.8), and wxNet used 3.0 (wchar_t,compiler with C++ ABI 1013,wx containers,compatible with 2.8). These executables were built in 2019 and 2021. The C compiler used at the time would not have been gcc 12. The programs executed correctly when they were built and continue to execute correctly now. But now they emit this annoying warning message. > Workaround is to insert " #define __GXX_ABI_VERSION 1016" > at the top of src/wxt_gui.cpp > --- a/src/wxterminal/wxt_gui.cpp 2022-05-26 12:37:23.464908700 +0900 > +++ b/src/wxterminal/wxt_gui.cpp 2022-05-26 13:10:10.970037600 +0900 > @@ -88,6 +88,8 @@ > * or multi-threaded operation. > */ > > +/* avoid mismatch message C++ ABI number*/ > +#define __GXX_ABI_VERSION 1016 I don't think that is a good idea. That work-around is likely to work only on a machine that happens to use that specific version of the runtime library. As soon as you run the executable on a machine with a newer or older runtime then it will probably complain about a mismatch between 1016 and some other version number. I'm pretty sure it is the warning message that is bogus, not the program. Having said that, however, your report claims a fatal error. My machines are only printing this as a warning. Perhaps the mismatch between versions 1016 and 1017 really is more serious? But then hiding it by lying about the true version would not fix it. The program may crash later on when it hits the incompatible ABI feature, whatever that is. I found some reports on the web that suggest the true problem is an improper configuration flag used to build the wxgtk library. However, that doesn't make sense to me, since the error message has only started to appear recently even though both the wxgtk library and the executable that links to it are several years old. I suspect rather that the linker/loader has become overly paranoid about comparing compiler versions reported by libraries and programs. I do not know how to fix that. Ethan Today I updated the msys2-mingw64. The wxWidgets package was updated. The new wxWidgets libraries seemed to be re-built with gcc-12. The ABI mismatch issue is disappeared. Thank you for your detailed comments and explanations. Tatsuro |