Windows: Fix possible crash when using longjmp and gcc 4.6
authorPete Batard <pete@akeo.ie>
Thu, 7 Jun 2012 10:55:30 +0000 (11:55 +0100)
committerPete Batard <pete@akeo.ie>
Thu, 7 Jun 2012 10:55:30 +0000 (11:55 +0100)
* With gcc-4.6 the option -fomit-frame-pointer is turned on per default
  even for the win32 target. This results in segfaults for any application
  using setjmp/longjmp and MSVCRT.dll on WinXP.
  See http://gcc.gnu.org/ml/gcc/2011-10/msg00351.html
* Issue reported by Lars Kanis

configure.ac
libusb/version_nano.h

index b305f68..b29b2bb 100644 (file)
@@ -71,6 +71,7 @@ case $host in
        AC_MSG_RESULT([Windows])
        backend="windows"
        threads="windows"
+       AM_CFLAGS="${AM_CFLAGS} -fno-omit-frame-pointer"
        ;;
 *-cygwin*)
        AC_MSG_RESULT([Cygwin (using Windows backend)])
@@ -212,7 +213,7 @@ AM_CONDITIONAL([HAVE_SIGACTION], [test "x$have_sigaction" = "xyes"])
 AC_CHECK_HEADERS([sys/time.h])
 AC_CHECK_FUNCS(gettimeofday)
 
-AM_CFLAGS="-std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow"
+AM_CFLAGS="${AM_CFLAGS} -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow"
 
 AC_SUBST(VISIBILITY_CFLAGS)
 AC_SUBST(AM_CFLAGS)
index 3b30253..f4b4197 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 10523
+#define LIBUSB_NANO 10524