Package: qt4-x11 / 4:4.8.7+dfsg-18

92_armel_gcc43_valist_compat.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From: Modestas Vainius <modax@debian.org>
Subject: 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.
Forward: not-needed

---
 src/corelib/tools/qstring.cpp    |    5 +++++
 src/corelib/tools/qvsnprintf.cpp |    6 ++++++
 2 files changed, 11 insertions(+)

--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -5560,6 +5560,11 @@ QString &QString::vsprintf(const char* c
     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.
--- a/src/corelib/tools/qvsnprintf.cpp
+++ b/src/corelib/tools/qvsnprintf.cpp
@@ -104,6 +104,12 @@ int qvsnprintf(char *str, size_t n, cons
 
 #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