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

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> For 64bits the result is "no":
>  643 configure:4751: checking whether the compiler is configured for
> setjmp/longjmp exceptions
>  644 configure:4769: x86_64-w64-mingw32-gcc
> -L/home/andoni/mingw/windows/multilib/x86_64-w64-mingw32/lib
> -L/home/andoni/mingw/windows/multilib/mingw/lib -isystem /home    
> /andoni/mingw/windows/multilib/x86_64-w64-mingw32/include -isystem
> /home/andoni/mingw/windows/multilib/mingw/include    -c -Wall -g -O2 
> -DWINVER=0x0600 -D_WIN32_     WINNT=0x0600   conftest.c >&5
>  645 conftest.c: In function 'main':
>  646 conftest.c:30:5: warning: unused variable 'i' [-Wunused-variable]
>  647  int i;
>  648      ^
>  649 configure:4769: $? = 0
>  650 configure:4776: result: no   

As expected.

> for 32 bits the result is "yes":
>  631 configure:4751: checking whether the compiler is configured for
> setjmp/longjmp exceptions
>  632 configure:4769: x86_64-w64-mingw32-gcc
> -L/home/andoni/mingw/windows/multilib/x86_64-w64-mingw32/lib
> -L/home/andoni/mingw/windows/multilib/mingw/lib -isystem /home    
> /andoni/mingw/windows/multilib/x86_64-w64-mingw32/include -isystem
> /home/andoni/mingw/windows/multilib/mingw/include  -m32 -c -Wall -g -O2 
> -DWINVER=0x0600 -D_WIN     32_WINNT=0x0600   conftest.c >&5
>  633 conftest.c:25:11: error: unknown type name 'this'
>  634            this will fail
>  635            ^~~~
>  636 conftest.c:25:21: error: expected '=', ',', ';', 'asm' or
> '__attribute__' before 'fail'
>  637            this will fail
>  638                      ^~~~
>  639 configure:4769: $? = 1
> [...]
>  674 configure:4776: result: yes

As expected.

> For 32 bits the final EH model being used is Dwarf2:
> 
> 340 # Additional sources to handle exceptions; overridden by targets as
> needed.
> 341 LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
> 342   $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
> 
> 
> What I understand is happening in a multilib build is that for 64 it chooses
> SEH because ac_cv_sjlj_exceptions is not "yes" but for 32, it chooses dw2
> instead of SJLJ for the same reason, because ac_cv_sjlj_exceptions is not
> "yes":
> if test x$ac_cv_sjlj_exceptions = xyes; then
>      tmake_eh_file="i386/t-sjlj-eh"
>  elif test "${host_address}" = 32; then
>      # biarch -m32 with --disable-sjlj-exceptions
>      tmake_eh_file="i386/t-dw2-eh"
>      md_unwind_header=i386/w32-unwind.h
>  else
>      tmake_eh_file="i386/t-seh-eh"
>  fi

But you said above that the result is "yes" for 32-bit, so how come the test:

  x$ac_cv_sjlj_exceptions = xyes;

is false?  Does it help to rewrite it into just:

  $ac_cv_sjlj_exceptions = yes;

like in libgcc/configure.ac?

Reply via email to