Skip to content

Commit

Permalink
Merge r172759 - TEXTREL in libjavascriptcoregtk-1.0.so.0.11.0 on x86 …
Browse files Browse the repository at this point in the history
…(or i586)

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

Patch by Magnus Granberg <zorry@gentoo.org> on 2014-08-19
Reviewed by Darin Adler.

Source/JavaScriptCore:

Setup %ebx so we can use the plt.

* jit/ThunkGenerators.cpp:

Source/WTF:

Add PLT if we're building with PIC.

* wtf/InlineASM.h:
  • Loading branch information
zorry authored and carlosgcampos committed Apr 7, 2015
1 parent c26a847 commit a4a9a95
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
2014-08-19 Magnus Granberg <zorry@gentoo.org>

TEXTREL in libjavascriptcoregtk-1.0.so.0.11.0 on x86 (or i586)
https://bugs.webkit.org/show_bug.cgi?id=70610

Reviewed by Darin Adler.

Setup %ebx so we can use the plt.

* jit/ThunkGenerators.cpp:

2014-10-06 Philip Chimento <philip.chimento@gmail.com>

webkit-gtk fails to link JavaScriptCore, missing symbols add_history and readline
Expand Down
24 changes: 24 additions & 0 deletions Source/JavaScriptCore/jit/ThunkGenerators.cpp
Expand Up @@ -619,6 +619,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) && (OS(DARWIN) || OS(LINUX))
#define defineUnaryDoubleOpWrapper(function) \
asm( \
Expand Down
11 changes: 11 additions & 0 deletions Source/WTF/ChangeLog
@@ -1,3 +1,14 @@
2014-08-19 Magnus Granberg <zorry@gentoo.org>

TEXTREL in libjavascriptcoregtk-1.0.so.0.11.0 on x86 (or i586)
https://bugs.webkit.org/show_bug.cgi?id=70610

Reviewed by Darin Adler.

Add PLT if we're building with PIC.

* wtf/InlineASM.h:

2015-04-07 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Fix the build with newer GLib.
Expand Down
2 changes: 2 additions & 0 deletions Source/WTF/wtf/InlineASM.h
Expand Up @@ -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
Expand Down

0 comments on commit a4a9a95

Please sign in to comment.