Cross-compiling Pidgin 2.10.7: multiple definition of `___stack_chk_fail'

Konrad Gräfe kglists at teamblind.de
Fri Feb 7 09:02:20 EST 2014


Hello there,

I finally fixed the issue for Pidgin 2.10.9. The key was to not install
the mingw32 package but the gcc-mingw32 package which gives you a more
recent gcc (4.6.3 vs. 4.2.1, on Ubuntu 13.10 by now).

Additionally I had to modify libpurple/protocols/mxit/markup.c as it
uses uint8_t without including stdint.h (though I don't understand why
others aren't affected). See the attached fix_mxit_missing_header.patch.

Furthermore I adopted some patches to fix some recurring warnings in
Pidgin 2.10.9 (fix_errno_warning_mingw.patch) and win32/gtk_2_0-2.14
(fix_gtk_apple_cc_warning.patch). I hope I labeled the sources
sufficiently as I did not made the Patches by myself.

To be able to build a distribution package (installer_zip) I copied the
libssp-0.dll from the official Pidgin distribution to win32-dev/gcc_ssp/
and added the following line to my local.mak:
GCC_SSP_TOP := $(PIDGIN_TREE_TOP)/../win32-dev/gcc_ssp

Unfortunately I still have a problem: the officially distributed Pidgin
is not able to load plugins I built against "my" Pidgin. It says it
could not found some symbols but it didn't say which one and I had no
time to investigate it any further. "My" Pidgin is running well on
Windows and loads my plugin just fine. Does anyone have any thoughts on
that?

Besides I would like to know what versions of the compiler and the
w32api were used to build the official Pidgin as this is somewhat
unclear in the wiki [1].

Regards,
Konrad Gräfe

[1] https://developer.pidgin.im/wiki/BuildingWinPidgin
-------------- next part --------------
Fix missing header file when compiling the mxit plugin on mingw (error: ?uint8_t? undeclared)

Author: Konrad Gräfe <konradgraefe at aol.com>
Date:	 2014-02-04
--- a/libpurple/protocols/mxit/markup.c	2014-02-02 13:29:18.000000000 -0800
+++ b/libpurple/protocols/mxit/markup.c	2014-02-04 11:12:03.430078874 -0800
@@ -33,6 +33,9 @@
 #include	"formcmds.h"
 #include	"roster.h"
 
+#ifdef _WIN32
+#include <stdint.h>
+#endif
 
 /* define this to enable emoticon (markup) debugging */
 #undef		MXIT_DEBUG_EMO
-------------- next part --------------
Author: Konrad Gräfe <konradgraefe at aol.com>
Date: 2014-02-04

Fix warning when redefining errno constants on mingw

Original Author: Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-04-05 00:08 +0200
Part of https://hg.pidgin.im/pidgin/main/rev/af0723304ab3
--- a/libpurple/win32/wpurpleerror.h
+++ b/libpurple/win32/wpurpleerror.h
@@ -27,32 +27,55 @@
 
 /* Here we define unix socket errors as windows socket errors */
 
+#undef ENETDOWN
 #define ENETDOWN WSAENETDOWN
+#undef EAFNOSUPPORT
 #define EAFNOSUPPORT WSAEAFNOSUPPORT
+#undef EINPROGRESS
 #define EINPROGRESS WSAEINPROGRESS
+#undef ENOBUFS
 #define ENOBUFS WSAENOBUFS
+#undef EPROTONOSUPPORT
 #define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#undef EPROTOTYPE
 #define EPROTOTYPE WSAEPROTOTYPE
+#undef ESOCKTNOSUPPORT
 #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
 
+#undef EADDRINUSE
 #define EADDRINUSE WSAEADDRINUSE
-#define EINPROGRESS WSAEINPROGRESS
+#undef EALREADY
 #define EALREADY WSAEALREADY
+#undef EADDRNOTAVAIL
 #define EADDRNOTAVAIL WSAEADDRNOTAVAIL
+#undef ECONNREFUSED
 #define ECONNREFUSED WSAECONNREFUSED
+#undef EISCONN
 #define EISCONN WSAEISCONN
+#undef ENETUNREACH
 #define ENETUNREACH WSAENETUNREACH
+#undef ENOTSOCK
 #define ENOTSOCK WSAENOTSOCK
+#undef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
+#undef EWOULDBLOCK
 #define EWOULDBLOCK WSAEWOULDBLOCK
 
+#undef ENOTCONN
 #define ENOTCONN WSAENOTCONN
+#undef ENETRESET
 #define ENETRESET WSAENETRESET
+#undef EOPNOTSUPP
 #define EOPNOTSUPP WSAEOPNOTSUPP
+#undef ESHUTDOWN
 #define ESHUTDOWN WSAESHUTDOWN
+#undef EMSGSIZE
 #define EMSGSIZE WSAEMSGSIZE
+#undef ECONNABORTED
 #define ECONNABORTED WSAECONNABORTED
+#undef ECONNRESET
 #define ECONNRESET WSAECONNRESET
+#undef EHOSTUNREACH
 #define EHOSTUNREACH WSAEHOSTUNREACH
 
 #endif /* end _WPURPLEERROR_H */
-------------- next part --------------
Author: Konrad Gräfe <konradgraefe at aol.com>
Date: 2014-02-04

* libintl.h.in: Use (defined X && X) idiom to test whether a
  possibly undefined macro has a certain value. Pacifies users of the
  gcc option -Wundef.

Adapted from: http://lists.gnu.org/archive/html/bug-gnu-utils/2008-09/msg00033.html
Original Author: Bruno Haible
Date: 2008-09-20
--- gtk_2_0-2.14_ori/include/libintl.h	2008-01-24 23:54:50.000000000 +0100
+++ gtk_2_0-2.14/include/libintl.h	2014-02-04 11:19:44.000000000 +0100
@@ -1,5 +1,5 @@
 /* Message catalogs for internationalization.
-   Copyright (C) 1995-1997, 2000-2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-1997, 2000-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published
@@ -88,7 +88,7 @@
    If he doesn't, we choose the method.  A third possible method is
    _INTL_REDIRECT_ASM, supported only by GCC.  */
 #if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
-# if __GNUC__ >= 2 && !(__APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
+# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
 #  define _INTL_REDIRECT_ASM
 # else
 #  ifdef __cplusplus
@@ -110,7 +110,7 @@
 /* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
    its n-th argument literally.  This enables GCC to warn for example about
    printf (gettext ("foo %y")).  */
-#if __GNUC__ >= 3 && !(__APPLE_CC__ > 1 && defined __cplusplus)
+#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
 # define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
 #else
 # define _INTL_MAY_RETURN_STRING_ARG(n)
@@ -314,7 +314,7 @@
 #include <stddef.h>
 
 /* Get va_list.  */
-#if __STDC__ || defined __cplusplus || defined _MSC_VER
+#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
 # include <stdarg.h>
 #else
 # include <varargs.h>


More information about the Devel mailing list