WebKitNix / webkitnix

A WebKit2 port based on POSIX and OpenGL/ES
http://nix.openbossa.org
66 stars 24 forks source link

Build failure on nix-rpi-sdk #37

Open rcarmo opened 10 years ago

rcarmo commented 10 years ago

I just checked out the master branch and tried building on a clean install of the SDK (brand new install of everything on a clean VM) and it breaks inside JSCore. Is there a "stable" revision that I can roll back to?

[  5%] Built target test_wtf
[  5%] [  5%] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/jit/JITCode.cpp.o
Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/jit/JITExceptions.cpp.o
/home/pi/webkitnix/Source/JavaScriptCore/jit/JITExceptions.cpp: In function 'void JSC::genericUnwind(JSC::VM*, JSC::ExecState*, JSC::JSValue)':
/home/pi/webkitnix/Source/JavaScriptCore/jit/JITExceptions.cpp:60:54: error: 'returnFromJavaScript' was not declared in this scope
make[2]: *** [Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/jit/JITExceptions.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/home/pi/webkitnix/Source/JavaScriptCore/jit/JITCode.cpp: In member function 'JSC::JSValue JSC::JITCode::execute(JSC::JSStack*, JSC::CallFrame*, JSC::VM*)':
/home/pi/webkitnix/Source/JavaScriptCore/jit/JITCode.cpp:49:85: error: 'callToJavaScript' was not declared in this scope
make[2]: *** [Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/jit/JITCode.cpp.o] Error 1
make[1]: *** [Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/all] Error 2
make: *** [all] Error 2
rcarmo commented 10 years ago

I've been making a little more progress (by using --no-jit), but keep coming up against compile warnings as errors:

/home/pi/webkitnix/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp: In function 'JSC::EncodedJSValue JSC::setData(JSC::ExecState*) [with Adaptor = JSC::Float64Adaptor, JSC::EncodedJSValue = long long int]':
/home/pi/webkitnix/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp:243:40:   instantiated from here
/home/pi/webkitnix/Source/JavaScriptCore/runtime/JSDataViewPrototype.cpp:161:5: error: cast from 'uint8_t* {aka unsigned char*}' to 'JSC::FloatTypedArrayAdaptor, JSC::JSGenericTypedArrayView, (JSC::TypedArrayType)9u>::Type* {aka double*}' increases required alignment of target type [-Werror=cast-align]
cc1plus: all warnings being treated as errors
make[2]: *** [Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/runtime/JSDataViewPrototype.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/all] Error 2
make: *** [all] Error 2

I've built WebKit as part of Android before, so I'm wondering if this is some peculiarity of the RPi SDK or any settings I've missed. My current build invocation is:

Tools/Scripts/build-webkit --nix --cmakeargs="-DCMAKE_PREFIX_PATH=/opt/vc" --no-llint --opengles2 --prefix=/opt/nix --no-webrtc --no-jit 
hugopl commented 10 years ago

You can pass "-DDISABLE_STRICT_BUILD=ON" to cmake to disable -Werror.

rcarmo commented 10 years ago

Thanks - this got a fair bit further, but now I have linking errors. I'm going to see if there are further options to twiddle.

Linking CXX executable ../../../bin/jsc
../../../lib/libJavaScriptCore.a(Executable.cpp.o): In function `JSC::ScriptExecutable::prepareForExecutionImpl(JSC::ExecState*, JSC::JSScope*, JSC::CodeSpecializationKind)':
Executable.cpp:(.text+0x1c84): undefined reference to `JSC::LLInt::setEntrypoint(JSC::VM&, JSC::CodeBlock*)'
../../../lib/libJavaScriptCore.a(InitializeThreading.cpp.o): In function `JSC::initializeThreading()':
InitializeThreading.cpp:(.text+0x4c): undefined reference to `JSC::LLInt::initialize()'
../../../lib/libJavaScriptCore.a(VM.cpp.o): In function `JSC::VM::VM(JSC::VM::VMType, JSC::HeapType)':
VM.cpp:(.text+0x5cbc): undefined reference to `JSC::LLInt::Data::performAssertions(JSC::VM&)'
../../../lib/libJavaScriptCore.a(CodeBlock.cpp.o): In function `JSC::CodeBlock::frameRegisterCount()':
CodeBlock.cpp:(.text+0x2778): undefined reference to `JSC::LLInt::frameRegisterCountFor(JSC::CodeBlock*)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)':
Interpreter.cpp:(.text+0x203c): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::executeConstruct(JSC::ExecState*, JSC::JSObject*, JSC::ConstructType, JSC::ConstructData const&, JSC::ArgList const&)':
Interpreter.cpp:(.text+0x24b8): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::execute(JSC::CallFrameClosure&)':
Interpreter.cpp:(.text+0x2a5c): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::execute(JSC::EvalExecutable*, JSC::ExecState*, JSC::JSValue, JSC::JSScope*)':
Interpreter.cpp:(.text+0x3020): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::initialize(bool)':
Interpreter.cpp:(.text+0x3ff8): undefined reference to `JSC::LLInt::Data::s_opcodeMap'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*)':
Interpreter.cpp:(.text+0x6688): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
collect2: ld returned 1 exit status
make[2]: *** [bin/jsc] Error 1
make[1]: *** [Source/JavaScriptCore/shell/CMakeFiles/jsc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
rcarmo commented 10 years ago

OK, I've made a little more progress with:

Tools/Scripts/build-webkit --nix --cmakeargs="-DCMAKE_PREFIX_PATH=/opt/vc" --no-llint --opengles2 --prefix=/opt/nix --no-webrtc --no-jit --no-dfg-jit

...but I get a lot of warnings regarding undefined GLES symbols during completion:

[ 82%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp.o
In file included from /opt/vc/include/interface/vcos/vcos_assert.h:149:0,
                 from /opt/vc/include/interface/vcos/vcos.h:114,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/EGL/eglplatform.h:110,
                 from /opt/vc/include/EGL/egl.h:36,
                 from /home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:33:
/opt/vc/include/interface/vcos/vcos_types.h:157:5: warning: "__STDC_VERSION__" is not defined [-Wundef]
In file included from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:36:0,
                 from /opt/vc/include/EGL/eglplatform.h:110,
                 from /opt/vc/include/EGL/egl.h:36,
                 from /home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:33:
/opt/vc/include/interface/vmcs_host/vc_dispmanx_types.h:107:5: warning: "__VCCOREVER__" is not defined [-Wundef]
In file included from /opt/vc/include/interface/vchi/vchi.h:34:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:37,
                 from /opt/vc/include/EGL/eglplatform.h:110,
                 from /opt/vc/include/EGL/egl.h:36,
                 from /home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:33:
/opt/vc/include/interface/vchi/vchi_cfg.h:43:8: warning: "__VCCOREVER__" is not defined [-Wundef]
/opt/vc/include/interface/vchi/vchi_cfg.h:54:8: warning: "__VCCOREVER__" is not defined [-Wundef]
In file included from /opt/vc/include/interface/vcos/vcos.h:116:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/EGL/eglplatform.h:110,
                 from /opt/vc/include/EGL/egl.h:36,
                 from /home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:33:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h: In function 'void vcos_event_signal(VCOS_EVENT_T*)':
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:524:8: warning: variable 'ok' set but not used [-Wunused-but-set-variable]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp: At global scope:
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'srcX0' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'srcY0' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'srcX1' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'srcY1' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'dstX0' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'dstY0' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'dstX1' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'dstY1' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'mask' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:80:6: warning: unused parameter 'filter' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:163:6: warning: unused parameter 'n' [-Wunused-parameter]
/home/pi/webkitnix/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.cpp:163:6: warning: unused parameter 'bufs' [-Wunused-parameter]
[ 82%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/platform/graphics/GLContext.cpp.o

...and the build fails without a clear-cut error message:

[ 83%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/__/__/DerivedSources/WebCore/SVGNames.cpp.o
[ 83%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/__/__/DerivedSources/WebCore/SVGElementFactory.cpp.o
[ 83%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/__/__/DerivedSources/WebCore/JSSVGElementWrapperFactory.cpp.o
[ 83%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/__/__/DerivedSources/WebCore/XLinkNames.cpp.o
[ 83%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/__/__/DerivedSources/WebCore/XMLNSNames.cpp.o
[ 83%] Building CXX object Source/WebCore/CMakeFiles/WebCore.dir/__/__/DerivedSources/WebCore/XMLNames.cpp.o
Linking CXX static library ../../lib/libWebCore.a
[ 83%] Built target WebCore
make: *** [all] Error 2

Any "known good" build settings I can try?

elecro commented 10 years ago

Could you give a full build-webkit script output (on gist or something)?

rcarmo commented 10 years ago

Okay. So I've checked out the source again, and here's the output from update-webkitnix-libs:

https://gist.github.com/rcarmo/4fdb280ba910f2a6d226

I can't get webrtc to build at all. Still, that shouldn't be a problem, since I'm trying not to use it in my build.

Here's the build output:

https://gist.github.com/rcarmo/62a9b583c66269ef95a7

elecro commented 10 years ago

It seems the WebCore.a was built correctly. But there are errors for the jsc binaries:

Linking CXX executable ../../../bin/jsc
../../../lib/libJavaScriptCore.a(Executable.cpp.o): In function `JSC::ScriptExecutable::prepareForExecutionImpl(JSC::ExecState*, JSC::JSScope*, JSC::CodeSpecializationKind)':
Executable.cpp:(.text+0x1c84): undefined reference to `JSC::LLInt::setEntrypoint(JSC::VM&, JSC::CodeBlock*)'
../../../lib/libJavaScriptCore.a(InitializeThreading.cpp.o): In function `JSC::initializeThreading()':
InitializeThreading.cpp:(.text+0x4c): undefined reference to `JSC::LLInt::initialize()'
../../../lib/libJavaScriptCore.a(VM.cpp.o): In function `JSC::VM::VM(JSC::VM::VMType, JSC::HeapType)':
VM.cpp:(.text+0x5cbc): undefined reference to `JSC::LLInt::Data::performAssertions(JSC::VM&)'
../../../lib/libJavaScriptCore.a(CodeBlock.cpp.o): In function `JSC::CodeBlock::frameRegisterCount()':
CodeBlock.cpp:(.text+0x2778): undefined reference to `JSC::LLInt::frameRegisterCountFor(JSC::CodeBlock*)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&)':
Interpreter.cpp:(.text+0x203c): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::executeConstruct(JSC::ExecState*, JSC::JSObject*, JSC::ConstructType, JSC::ConstructData const&, JSC::ArgList const&)':
Interpreter.cpp:(.text+0x24b8): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::execute(JSC::CallFrameClosure&)':
Interpreter.cpp:(.text+0x2a5c): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::execute(JSC::EvalExecutable*, JSC::ExecState*, JSC::JSValue, JSC::JSScope*)':
Interpreter.cpp:(.text+0x3020): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::initialize(bool)':
Interpreter.cpp:(.text+0x3ff8): undefined reference to `JSC::LLInt::Data::s_opcodeMap'
../../../lib/libJavaScriptCore.a(Interpreter.cpp.o): In function `JSC::Interpreter::execute(JSC::ProgramExecutable*, JSC::ExecState*, JSC::JSObject*)':
Interpreter.cpp:(.text+0x6688): undefined reference to `JSC::LLInt::CLoop::execute(JSC::ExecState*, JSC::OpcodeID, bool)'
collect2: ld returned 1 exit status
make[2]: *** [bin/jsc] Error 1
make[1]: *** [Source/JavaScriptCore/shell/CMakeFiles/jsc.dir/all] Error 2

I'm guessing that's why the error at the end of the build. Could you check if the WebCore.a is in your WebKitBuild directory?

elecro commented 10 years ago

Oh and for the webrtc, you could pass the '-s libwebrtc' to your update-webkitnix-libs call to skip the build for that module. (At least last time it worked for me :))

rcarmo commented 10 years ago

Many thanks for that. I'm going to check the jsc build again (I expected the JIT stuff to be troublesome, but not this much), but I will surely get rid of webrtc at the earliest opportunity - it's nice and all, but not needed on the PI, and it's been a pain to try to get to build. :)

(and, in the process, I think I'm going to set up icecc...)

rcarmo commented 10 years ago

Hey guys, guess what. It turns out that the --no-llint option was the problem here. Since I got it from the SDK docs, I'm going to submit a pull request to remove it from that...

In the meantime, for future reference, what worked for me was:

Tools/Scripts/update-webkitnix-libs -s libwebrtc
Tools/Scripts/build-webkit --nix --cmakeargs="-DDISABLE_STRICT_BUILD=ON -DCMAKE_PREFIX_PATH=/opt/vc" --opengles2 --prefix=/opt/nix --no-webrtc

For the record, this gets me a working Sample browser that can render a fair amount of pages (including some of the WebKit 3D transform demos) fairly well, but which fails to render a lot of "common" pages like the Verge (probably due to some other issue I've yet to uncover).

Very impressive nonetheless.