diff options
author | Modestas Vainius <modestas@vainius.eu> | 2010-02-15 15:21:16 +0200 |
---|---|---|
committer | Modestas Vainius <modestas@vainius.eu> | 2010-02-15 15:23:05 +0200 |
commit | 50b45f15f7b4deedfec3d01835341815700f0122 (patch) | |
tree | 49239fc46ff7b40b0c6e92f3c88286422cd6d601 /debian/patches | |
parent | 2c0718bdc07887e8285092bdaaba239a0f3d3d62 (diff) | |
download | qt4-x11-50b45f15f7b4deedfec3d01835341815700f0122.tar.gz |
Simply armel ABI compatibility patch.
Create the alias with asm .symver directive rathen than overloading and casting
hacks.
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/92_armel_gcc43_valist_compat.diff | 67 |
1 files changed, 11 insertions, 56 deletions
diff --git a/debian/patches/92_armel_gcc43_valist_compat.diff b/debian/patches/92_armel_gcc43_valist_compat.diff index 1db7aa3..e690d5c 100644 --- a/debian/patches/92_armel_gcc43_valist_compat.diff +++ b/debian/patches/92_armel_gcc43_valist_compat.diff @@ -8,80 +8,35 @@ Subject: Restore QtCore ABI compatibility with binaries built with g++ 4.3 on ar qvsnprintf(char *str, size_t n, const char *fmt, va_list ap); QString &QString::vsprintf(const char* cformat, va_list ap); . - The patch uses overloading feature of the C++ language to add aliases for the - symbols above. Those aliases are mangled under g++ 4.4 in the same way as - original symbols are under g++ 4.3 and below. + 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. Forward: not-needed ---- a/src/corelib/tools/qbytearray.h -+++ b/src/corelib/tools/qbytearray.h -@@ -52,6 +52,10 @@ - #error qbytearray.h must be included before any header file that defines truncate - #endif - -+// Workaround type safety when casting to va_list. -+#define DEBIAN_CAST_TO_VA_LIST(list, type) \ -+ (*reinterpret_cast<va_list*>(reinterpret_cast<type*>(&list))) -+ - QT_BEGIN_HEADER - - QT_BEGIN_NAMESPACE -@@ -96,6 +100,11 @@ Q_CORE_EXPORT int qstrnicmp(const char * - - // implemented in qvsnprintf.cpp - Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap); -+#if defined __ARM_EABI__ && defined __GNUC__ && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) -+ // va_list mangling has been changed in g++ 4.4 on armel. Add binary -+ // compatibility hack for g++ 4.3 and below. -+ Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, void* ap); -+#endif - Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt, ...); - - #ifdef QT3_SUPPORT --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp -@@ -5289,6 +5289,12 @@ QString &QString::vsprintf(const char* c +@@ -5289,6 +5289,11 @@ 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) -+QString &QString::vsprintf(const char* cformat, void* ap) -+{ -+ return vsprintf(cformat, DEBIAN_CAST_TO_VA_LIST(ap, void*)); -+} ++__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. ---- a/src/corelib/tools/qstring.h -+++ b/src/corelib/tools/qstring.h -@@ -177,6 +177,15 @@ public: - __attribute__ ((format (printf, 2, 0))) - #endif - ; -+ // va_list mangling has been changed in g++ 4.4 on armel. Add binary -+ // compatibility hack for g++ 4.3 and below. -+#if defined __ARM_EABI__ && defined __GNUC__ && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4) -+ QString &vsprintf(const char *format, void* ap) -+#if defined(Q_CC_GNU) && !defined(__INSURE__) -+ __attribute__ ((format (printf, 2, 0))) -+#endif -+ ; -+#endif - QString &sprintf(const char *format, ...) - #if defined(Q_CC_GNU) && !defined(__INSURE__) - __attribute__ ((format (printf, 2, 3))) --- a/src/corelib/tools/qvsnprintf.cpp +++ b/src/corelib/tools/qvsnprintf.cpp -@@ -104,6 +104,13 @@ int qvsnprintf(char *str, size_t n, cons +@@ -104,6 +104,12 @@ #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) -+int qvsnprintf(char *str, size_t n, const char *fmt, void* ap) -+{ -+ return qvsnprintf(str, n, fmt, DEBIAN_CAST_TO_VA_LIST(ap, void*)); -+} ++__asm__(".symver _Z10qvsnprintfPcjPKcSt9__va_list, _Z10qvsnprintfPcjPKcPv@@"); +#endif + /*! |