On Mon, Mar 8, 2021 at 12:07 PM Eric Botcazou wrote: > > > I wonder why we include from this file at all, > > and why it is not included from {t,}system.h instead which > > is where system header specific fixups should be made > > (and this one could be avoided because system headers > > are included _before_ poisoning anything). > > is the Mother of All Things on the platform so you don't want to > include it liberally (although it can be tamed e.g. with WIN32_LEAN_AND_MEAN). > Therefore including it from tsystem.h might be worse than the actual disease. > > Mikael, can you work around the problem by adding > > #ifdef __CYGWIN__ > #include "mingw32.h" > #endif > > at the appropriate spot in raise-gcc.c instead? This one worked. Is that what you had in mind? * raise-gcc.c: On Cygwin include mingw32.h to prevent windows.h from including x86intrin.h or emmintrin.h. --- gcc/ada/raise-gcc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c index 1446bfaaeb7..b096eba1b75 100644 --- a/gcc/ada/raise-gcc.c +++ b/gcc/ada/raise-gcc.c @@ -79,6 +79,12 @@ typedef char bool; (SJLJ or DWARF). We need a consistently named interface to import from a-except, so wrappers are defined here. */ +#ifdef __CYGWIN__ +/* Prevent compile error due to unwind-generic.h including , + see comment above #include in mingw32.h. */ +#include "mingw32.h" +#endif + #ifndef IN_RTS /* For gnat1/gnatbind compilation: cannot use unwind.h, as it is for the target. So mimic configure...