Bug 126502

Summary: [GTK] v2.3.3 fails to build in Debian / FreeBSD
Product: WebKit Reporter: Alberto Garcia <berto>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue, mark.lam, zan
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 128598    
Attachments:
Description Flags
Patch mark.lam: review+

Description Alberto Garcia 2014-01-05 11:40:48 PST
Here's the error:

../Source/JavaScriptCore/interpreter/Interpreter.cpp: In member function 'JSC::JSValue JSC::Interpreter::executeCall(JSC::CallFrame*, JSC::JSObject*, JSC::CallType, const JSC::CallData&, JSC::JSValue, const JSC::ArgList&)':
../Source/JavaScriptCore/interpreter/Interpreter.cpp:973:168: error: 'callToNativeFunction' was not declared in this scope
             result = JSValue::decode(callToNativeFunction(reinterpret_cast<void*>(callData.native.function), &vm.topCallFrame, &protoCallFrame, m_stack.getTopOfStack()));
                                                                                                                                                                        ^
../Source/JavaScriptCore/interpreter/Interpreter.cpp: In member function 'JSC::JSObject* JSC::Interpreter::executeConstruct(JSC::CallFrame*, JSC::JSObject*, JSC::ConstructType, const JSC::ConstructData&, const JSC::ArgList&)':
../Source/JavaScriptCore/interpreter/Interpreter.cpp:1041:173: error: 'callToNativeFunction' was not declared in this scope
             result = JSValue::decode(callToNativeFunction(reinterpret_cast<void*>(constructData.native.function), &vm.topCallFrame, &protoCallFrame, m_stack.getTopOfStack()));

Complete build output here:

https://buildd.debian.org/status/fetch.php?pkg=webkitgtk&arch=kfreebsd-amd64&ver=2.3.3-1&stamp=1388886358
Comment 1 Zan Dobersek 2014-01-06 01:52:45 PST
ENABLE_LLINT is not being enabled on FreeBSD.
http://trac.webkit.org/browser/trunk/Source/WTF/wtf/Platform.h#L726
Comment 2 Alberto Garcia 2014-01-15 03:24:51 PST
(In reply to comment #1)
> ENABLE_LLINT is not being enabled on FreeBSD.
> http://trac.webkit.org/browser/trunk/Source/WTF/wtf/Platform.h#L726

Yeah, but JSC should anyway build without it, shouldn't it?

We can also enable LLINT in FreeBSD, is there any reason why it
wouldn't work? It seems to built fine at least...
Comment 3 Alberto Garcia 2014-01-15 03:34:02 PST
And it looks like this broke after r160186, adding Mark Lam to Cc.
Comment 4 Mark Lam 2014-01-15 07:01:04 PST
(In reply to comment #2)
> (In reply to comment #1)
> > ENABLE_LLINT is not being enabled on FreeBSD.
> > http://trac.webkit.org/browser/trunk/Source/WTF/wtf/Platform.h#L726
> 
> Yeah, but JSC should anyway build without it, shouldn't it?
> 
> We can also enable LLINT in FreeBSD, is there any reason why it
> wouldn't work? It seems to built fine at least...

Sorry about the breakage, but going forward, the LLINT will be an essential part of the JSC build.  This (breakage) wasn’t by design, but it came out of a natural progression in the development of the JSC JIT.

If you build with the JIT, the LLINT is needed to provide glue trampoline (e.g. callToJavaScript and callToNativeFunction).  If you build without the JIT, the LLINT is needed to provide the C loop interpreter.  Either way, you will need the LLINT.

The only alternative to this is to build with JIT only and provide your own glue trampoline.  For example, see jit/JITStubsX86.h and jit/JITStubsMSVC64.asm.  This is no recommended because the LLINT assembly will be undergoing continual development over time, and these one off bits of ASM code can easily bit rot.

I recommend you add LLINT support to the FreeBSD port.  Thanks.
Comment 5 Alberto Garcia 2014-01-15 09:20:26 PST
(In reply to comment #4)
> I recommend you add LLINT support to the FreeBSD port.  Thanks.

Thanks for the answer.

I wonder, instead of adding FREEBSD to the list, can I just replace
(OS(DARWIN) || OS(LINUX)) with OS(UNIX) or is there any reason why it
wouldn't work in some Unix system?
Comment 6 Mark Lam 2014-01-15 09:23:22 PST
(In reply to comment #5)
> (In reply to comment #4)
> > I recommend you add LLINT support to the FreeBSD port.  Thanks.
> 
> Thanks for the answer.
> 
> I wonder, instead of adding FREEBSD to the list, can I just replace
> (OS(DARWIN) || OS(LINUX)) with OS(UNIX) or is there any reason why it
> wouldn't work in some Unix system?

The LLINT requires an extra build phase to generate LLIntAssembly.h.  It is not guaranteed that all platforms support this build phase.
Comment 7 Alberto Garcia 2014-01-15 09:30:17 PST
Created attachment 221276 [details]
Patch

(In reply to comment #6)
> The LLINT requires an extra build phase to generate LLIntAssembly.h.
> It is not guaranteed that all platforms support this build phase.

I see. Here's the patch with FreeBSD only then.

Thanks again!
Comment 8 Mark Lam 2014-01-15 09:32:41 PST
Comment on attachment 221276 [details]
Patch

r=me assuming you’ve tested it and confirmed that it resolves the issue.
Comment 9 Alberto Garcia 2014-01-15 09:39:40 PST
(In reply to comment #8)
> (From update of attachment 221276 [details])
> r=me assuming you’ve tested it and confirmed that it resolves the issue.

Yeah, I'll anyway do a full rebuild again later to double check before
committing the change.
Comment 10 Alberto Garcia 2014-01-15 13:17:12 PST
Committed r162086: <http://trac.webkit.org/changeset/162086>