summaryrefslogtreecommitdiffstats
path: root/meta/recipes-qt/qt5/qtwebkit/0002-Remove-TEXTREL-tag-in-x86.patch
blob: 467b0cd7cafee2bcdb31cb87363d1e3409264c9e (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
From 38211ab724d5379dd393414cc8668cd906bde2cb Mon Sep 17 00:00:00 2001
From: Magnus Granberg <zorry@gentoo.org>
Date: Fri, 27 Feb 2015 11:55:09 +0100
Subject: [PATCH] Remove TEXTREL tag in x86

Fix textrel QA warnings when building qtwebkit for x86:

  WARNING: QA Issue: ELF binary '/home/andre/rdk/rdk-master/build-vbox32/tmp/work/core2-32-rdk-linux/qtwebkit/5.4.0-r0/packages-split/qtwebkit/usr/lib/libQt5WebKit.so.5.4.0' has relocations in .text [textrel]

Patch from upstream webkit:

  https://bugs.webkit.org/show_bug.cgi?id=70610

Minor refresh required to apply cleanly to the older webkit sources used
by qtwebkit. Specifically, the patch needed to be modified to account
for PLATFORM(MAC) -> OS(DARWIN) renaming in recent webkit which is not
part of qtwebkit yet ( https://bugs.webkit.org/show_bug.cgi?id=99683 ).

Upstream status [webkit] : backport
Upstream status [qtwebkit] : unclear

Bug: https://bugs.webkit.org/show_bug.cgi?id=70610
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 Source/JavaScriptCore/jit/ThunkGenerators.cpp | 24 ++++++++++++++++++++++++
 Source/WTF/wtf/InlineASM.h                    |  2 ++
 2 files changed, 26 insertions(+)

diff --git a/Source/JavaScriptCore/jit/ThunkGenerators.cpp b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
index 9684df2..8af82d8 100644
--- a/Source/JavaScriptCore/jit/ThunkGenerators.cpp
+++ b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
@@ -524,6 +524,30 @@ double jsRound(double d)
     } \
     static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
 
+#elif CPU(X86) && COMPILER(GCC) && OS(LINUX) && defined(__PIC__)
+#define defineUnaryDoubleOpWrapper(function) \
+    asm( \
+        ".text\n" \
+        ".globl " SYMBOL_STRING(function##Thunk) "\n" \
+        HIDE_SYMBOL(function##Thunk) "\n" \
+        SYMBOL_STRING(function##Thunk) ":" "\n" \
+        "pushl %ebx\n" \
+        "subl $20, %esp\n" \
+        "movsd %xmm0, (%esp) \n" \
+        "call __x86.get_pc_thunk.bx\n" \
+        "addl $_GLOBAL_OFFSET_TABLE_, %ebx\n" \
+        "call " GLOBAL_REFERENCE(function) "\n" \
+        "fstpl (%esp) \n" \
+        "movsd (%esp), %xmm0 \n" \
+        "addl $20, %esp\n" \
+        "popl %ebx\n" \
+        "ret\n" \
+    );\
+    extern "C" { \
+        MathThunkCallingConvention function##Thunk(MathThunkCallingConvention); \
+    } \
+    static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
+
 #elif CPU(X86) && COMPILER(GCC) && (PLATFORM(MAC) || OS(LINUX))
 #define defineUnaryDoubleOpWrapper(function) \
     asm( \
diff --git a/Source/WTF/wtf/InlineASM.h b/Source/WTF/wtf/InlineASM.h
index 0a2fe78..2dc40ef 100644
--- a/Source/WTF/wtf/InlineASM.h
+++ b/Source/WTF/wtf/InlineASM.h
@@ -46,6 +46,8 @@
 #define GLOBAL_REFERENCE(name) #name "@plt"
 #elif CPU(X86) && COMPILER(MINGW)
 #define GLOBAL_REFERENCE(name) "@" #name "@4"
+#elif OS(LINUX) && CPU(X86) && defined(__PIC__)
+#define GLOBAL_REFERENCE(name) SYMBOL_STRING(name) "@plt"
 #else
 #define GLOBAL_REFERENCE(name) SYMBOL_STRING(name)
 #endif