From: Modestas Vainius Date: Wed, 9 Nov 2016 16:50:49 +0000 (+0000) Subject: Restore QtCore ABI compatibility with binaries built with g++ 4.3 on armel Once Qt... X-Git-Tag: archive/raspbian/4%4.8.7+dfsg-15+rpi1~1^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=24242ab09014d44663796dbf2cc86c76c7475cdf;p=qt4-x11.git Restore QtCore ABI compatibility with binaries built with g++ 4.3 on armel Once Qt is rebuilt with g++ 4.4, it becomes ABI incompatible with binaries built with g++ 4.3 on armel. That's because g++ 4.4 mangles va_list differently on armel. As a result, affected symbols are those which have va_list type in their argument list. Qt exports 2 such symbols: . qvsnprintf(char *str, size_t n, const char *fmt, va_list ap); QString &QString::vsprintf(const char* cformat, va_list ap); . The patch uses .symver assembler directive to add aliases for the symbols above. Those aliases are mangled in the same way as g++ 4.3 would mangle original symbols. Gbp-Pq: Name 92_armel_gcc43_valist_compat.diff --- diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3b046edbb..6f5db649f 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -5560,6 +5560,11 @@ QString &QString::vsprintf(const char* cformat, va_list ap) return *this; } +// va_list mangling has been changed in g++ 4.4 +// Add ABI compatibility hack for g++ 4.3 and below. +#if defined __ARM_EABI__ && defined __GNUC__ && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) +__asm__(".symver _ZN7QString8vsprintfEPKcSt9__va_list, _ZN7QString8vsprintfEPKcPv@@"); +#endif /*! Returns the string converted to a \c{long long} using base \a base, which is 10 by default and must be between 2 and 36, or 0. diff --git a/src/corelib/tools/qvsnprintf.cpp b/src/corelib/tools/qvsnprintf.cpp index 8ac6433f5..aa0ab1469 100644 --- a/src/corelib/tools/qvsnprintf.cpp +++ b/src/corelib/tools/qvsnprintf.cpp @@ -104,6 +104,12 @@ int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap) #endif +// va_list mangling has been changed in g++ 4.4 +// Add ABI compatibility hack for g++ 4.3 and below. +#if defined __ARM_EABI__ && defined __GNUC__ && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) +__asm__(".symver _Z10qvsnprintfPcjPKcSt9__va_list, _Z10qvsnprintfPcjPKcPv@@"); +#endif + /*! \relates QByteArray