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

            Bug ID: 88772
           Summary: Exception handling configured mode does not match the
                    one finally used
           Product: gcc
           Version: 8.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ylatuya at gmail dot com
  Target Milestone: ---

I am building a multilib GCC+MinGW toolchain targeting Windows. I have built
the cross toolchain, which compiled and works correctly and I am now trying to
build the native one.
The cross toolchain is configured with:
../configure --prefix /home/andoni/mingw/linux/w64 --libdir
/home/andoni/mingw/linux/w64/lib --enable-introspection  
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--disable-shared --disable-libgomp --disable-libquadmath
--disable-libquadmath-support --disable-libmudflap --disable-libmpx
--disable-libssp --disable-nls --enable-threads=posix --enable-__cxa_atexit
--enable-lto --enable-plugin --enable-multiarch --enable-languages=c,c++
--enable-long-long 
--with-sysroot=/home/andoni/mingw/linux/w64/x86_64-w64-mingw32/sysroot 
--with-local-prefix=/home/andoni/mingw/linux/w64/x86_64-w64-mingw32/sysroot 
--target=x86_64-w64-mingw32


The native toolchain is configured with the same settings, only changing the
host:
../configure --prefix /home/andoni/mingw/windows/w64 --libdir
/home/andoni/mingw/windows/w64/lib --disable-introspection  
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm'
--disable-shared --disable-libgomp --disable-libquadmath
--disable-libquadmath-support --disable-libmudflap --disable-libmpx
--disable-libssp --disable-nls --enable-threads=posix --enable-__cxa_atexit
--enable-lto --enable-plugin --enable-multiarch --enable-languages=c,c++
--enable-long-long 
--with-sysroot=/home/andoni/mingw/windows/w64/x86_64-w64-mingw32/sysroot 
--with-local-prefix=/home/andoni/mingw/windows/w64/x86_64-w64-mingw32/sysroot 
--target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32

I none of them I force SJLJ or disable it, so from the documentation and the
headers  it should be using SEH for 64 bits and SJLJ for 32 bits:
gcc/config/i386/cygming.h
369 /* If configured with --disable-sjlj-exceptions, use DWARF2 for 32-bit
370    mode else default to SJLJ.  64-bit code uses SEH unless you request
371    SJLJ.  */


But what happens is that it ends up using i386/t-dw2-eh instead of
i386/t-seh-eh
 and there is compilation error:

../../../../libgcc/unwind.inc: In function '_Unwind_RaiseException_Phase2':
../../../../libgcc/unwind.inc:53:62: error: 'struct _Unwind_Exception' has no
member named 'private_2'; did you mean 'private_'?
       match_handler = (uw_identify_context (context) == exc->private_2

The error seems to be in the switch case for x86_64-mingw32 in
libgcc/config.host:

  762 >       # This has to match the logic for DWARF2_UNWIND_INFO in
gcc/config/i386/cygming.h
 763 >       if test x$ac_cv_sjlj_exceptions = xyes; then
 764 >       >       tmake_eh_file="i386/t-sjlj-eh"
 765 >       elif test "${host_address}" = 32; then
 766 >               # biarch -m32 with --disable-sjlj-exceptions
 767 >            >  tmake_eh_file="i386/t-dw2-eh"
 768 >       >       md_unwind_header=i386/w32-unwind.h
 769 >       else
 770 >       >       tmake_eh_file="i386/t-seh-eh"
 771 >       fi


                                                              ^~~~~~~~~
                                                              private_

Reply via email to