Here is a short example program that I try to compile (and it works for 
x86_64)

$ cat thex.c

# ----

#include <stdio.h>
#include <stdlib.h>
#include <unwind.h>

struct myException
{
     int a;
     int b;
     struct _Unwind_Exception unwindHeader;
};

int main() {

     struct myException *myEx = calloc( 1, sizeof(struct myException) );
     myEx->a = 47;
     myEx->b = 11;

     _Unwind_Reason_Code err = _Unwind_RaiseException(&myEx->unwindHeader);

     free(myEx);

   return 0;
}

# ----

It seems tha the unwind library interface is missing from the 32 Bit gcc 
build. What alternatives do I have for stack unwindingduring exceptions?

The error message is the following:

# ----


[barnaby@blasphemy exceptions]$ x86_64-w64-mingw32-gcc thex.c -o thex64.exe
[barnaby@blasphemy exceptions]$ # compiles fine
[barnaby@blasphemy exceptions]$ i686-w64-mingw32-gcc thex.c -o 
thex32.exe -v &> emsg.txt
[barnaby@blasphemy exceptions]$ cat emsg.txt

# ----

Using built-in specs.
COLLECT_GCC=i686-w64-mingw32-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-w64-mingw32/4.9.1/lto-wrapper
Target: i686-w64-mingw32
Configured with: /build/mingw-w64-gcc/src/gcc-4.9.1/configure 
--prefix=/usr --libexecdir=/usr/lib --target=i686-w64-mingw32 
--enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared 
--enable-static --enable-threads=posix --enable-fully-dynamic-string 
--enable-libstdcxx-time=yes --with-system-zlib 
--enable-cloog-backend=isl --disable-cloog-version-check 
--disable-isl-version-check --enable-lto --disable-dw2-exceptions 
--enable-libgomp --disable-multilib --enable-checking=release
Thread model: posix
gcc version 4.9.1 (GCC)
COLLECT_GCC_OPTIONS='-o' 'thex32.exe' '-v' '-mtune=generic' 
'-march=pentiumpro'
  /usr/lib/gcc/i686-w64-mingw32/4.9.1/cc1 -quiet -v -D_REENTRANT thex.c 
-quiet -dumpbase thex.c -mtune=generic -march=pentiumpro -auxbase thex 
-version -o /tmp/ccuWTViA.s
GNU C (GCC) version 4.9.1 (i686-w64-mingw32)
     compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 
3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory 
"/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/sys-include"
#include "..." search starts here:
#include <...> search starts here:
  /usr/lib/gcc/i686-w64-mingw32/4.9.1/include
  /usr/lib/gcc/i686-w64-mingw32/4.9.1/include-fixed
  /usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/include
End of search list.
GNU C (GCC) version 4.9.1 (i686-w64-mingw32)
     compiled by GNU C version 4.9.1, GMP version 6.0.0, MPFR version 
3.1.2-p10, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 40482ad5715bcdd97af64ab383d3fc38
COLLECT_GCC_OPTIONS='-o' 'thex32.exe' '-v' '-mtune=generic' 
'-march=pentiumpro'
  /usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/as -v -o 
/tmp/ccVMB2cs.o /tmp/ccuWTViA.s
GNU assembler version 2.24 (i686-w64-mingw32) using BFD version (GNU 
Binutils) 2.24
COMPILER_PATH=/usr/lib/gcc/i686-w64-mingw32/4.9.1/:/usr/lib/gcc/i686-w64-mingw32/4.9.1/:/usr/lib/gcc/i686-w64-mingw32/:/usr/lib/gcc/i686-w64-mingw32/4.9.1/:/usr/lib/gcc/i686-w64-mingw32/:/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bin/
LIBRARY_PATH=/usr/lib/gcc/i686-w64-mingw32/4.9.1/:/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/lib/../lib/:/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/lib/
COLLECT_GCC_OPTIONS='-o' 'thex32.exe' '-v' '-mtune=generic' 
'-march=pentiumpro'
  /usr/lib/gcc/i686-w64-mingw32/4.9.1/collect2 -plugin 
/usr/lib/gcc/i686-w64-mingw32/4.9.1/liblto_plugin.so 
-plugin-opt=/usr/lib/gcc/i686-w64-mingw32/4.9.1/lto-wrapper 
-plugin-opt=-fresolution=/tmp/cciVJX7j.res 
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc 
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname 
-plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt 
-plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 
-plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 
-plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh 
-plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex 
-plugin-opt=-pass-through=-lmsvcrt -m i386pe -Bdynamic -o thex32.exe 
/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/lib/../lib/crt2.o
 
/usr/lib/gcc/i686-w64-mingw32/4.9.1/crtbegin.o 
-L/usr/lib/gcc/i686-w64-mingw32/4.9.1 
-L/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/lib/../lib 
-L/usr/lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/lib 
/tmp/ccVMB2cs.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt 
-lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc 
-lgcc_eh -lmoldname -lmingwex -lmsvcrt 
/usr/lib/gcc/i686-w64-mingw32/4.9.1/crtend.o
/tmp/ccVMB2cs.o:thex.c:(.text+0x46): undefined reference to 
`_Unwind_RaiseException'
collect2: error: ld returned 1 exit status

TIA



------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to