Bug 127776 - Fix linking failure on EFL and GTK for the jsCStack branch merge
Summary: Fix linking failure on EFL and GTK for the jsCStack branch merge
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Blocker
Assignee: Nobody
URL:
Keywords:
Depends on: 127782
Blocks: 127763
  Show dependency treegraph
 
Reported: 2014-01-28 06:53 PST by Csaba Osztrogonác
Modified: 2014-01-28 09:20 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2014-01-28 06:53:06 PST
After adding the missing files to the cmake buildsystem and removed
the dead code I managed to build EFLWebKit. But I got linking failure
with SHARED_CORE=ON build. Unfortunately it is necessary to be able
run layout tests. (https://bugs.webkit.org/show_bug.cgi?id=80683)

Additionally I got the same linking failure with WebKitGTK build.


GTK build failure:
-------------------
/usr/bin/ld: Source/JavaScriptCore/llint/.libs/libjavascriptcoregtk_3_0_la-LowLevelInterpreter.o: relocation R_X86_64_PC32 against symbol `llint_throw_stack_overflow_error' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value


EFL build failure with SHARED_CORE=ON:
---------------------------------------
Linking CXX shared library ../../lib/libjavascriptcore_efl.so
/usr/bin/ld: CMakeFiles/JavaScriptCore.dir/llint/LowLevelInterpreter.cpp.o: relocation R_X86_64_PC32 against symbol `llint_throw_stack_overflow_error' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
Comment 1 Csaba Osztrogonác 2014-01-28 07:30:09 PST
Additional info: The build fails on GTK always and fails on EFL bots, 
because ENABLE_DRT=1 environment variable forces the SHARED_CORE=ON build.
Comment 2 Mark Hahnenberg 2014-01-28 08:33:41 PST
After reading a little bit about this error, it seems that gcc requires that code linked into a shared library should, by default, be compiled with -fpic due to the constraints of the small code model and the size of the address space on 64-bit platforms. I can see two obvious solutions:

(1) Use -fpic to enable position independent code when building shared libraries.
(2) Use -mcmodel=large to enable the large code model when building shared libraries.

Either one of these should work.
Comment 3 Mark Hahnenberg 2014-01-28 08:36:44 PST
(In reply to comment #2)
> After reading a little bit about this error, it seems that gcc requires that code linked into a shared library should, by default, be compiled with -fpic due to the constraints of the small code model and the size of the address space on 64-bit platforms. I can see two obvious solutions:
> 
> (1) Use -fpic to enable position independent code when building shared libraries.
> (2) Use -mcmodel=large to enable the large code model when building shared libraries.
> 
> Either one of these should work.

This also might be the result of a lack of proper extern-ing for these symbols. Let me try that first.
Comment 4 Csaba Osztrogonác 2014-01-28 09:20:11 PST
It seems https://bugs.webkit.org/show_bug.cgi?id=127782 solved the linking problem. Thanks for the quick fix.