Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building WebKit for ARM #1

Open
galvesribeiro opened this issue Oct 13, 2016 · 17 comments
Open

Error building WebKit for ARM #1

galvesribeiro opened this issue Oct 13, 2016 · 17 comments

Comments

@galvesribeiro
Copy link

galvesribeiro commented Oct 13, 2016

cmake -DCMAKE_TOOLCHAIN_FILE=/mnt/c/Dev/Linux/webkit-src/arm-toolchain.cmake \
        -DPORT=GTK \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_SYSCONFDIR=/mnt/c/Dev/Linux/webkit-src/output/etc \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/mnt/c/Dev/Linux/webkit-src/output/var \
        -DCMAKE_INSTALL_PREFIX=/mnt/c/Dev/Linux/webkit-src/output/usr \

Btw, these last tree paths do not seem right: they should be the paths relative to the root of your ARM root filesystem, not to your local machine, so that when you run WebKit later on your device, it will look for the files in the right places.

For instance, I use this:

        -DCMAKE_INSTALL_SYSCONFDIR=/etc \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
        -DCMAKE_INSTALL_PREFIX=/usr \

Not that it will probably make any difference for compiling, but still worth mentioning.

@mariospr
Copy link
Owner

That's very weird, but from the log you pasted it looks like the compiler from the toolchain you're using is having trouble with finding the Thumb-2 extensions for the Thumb instruction set?

But that suggests a bug maybe in the code that detects that in WebKit, although I'm not 100% sure. What happens if you leave only line 110 in OptionsCommon.cmake and remove the following ones:

 if (WTF_CPU_ARM)
    set(ARM_THUMB2_TEST_SOURCE
    "
    #if !defined(thumb2) && !defined(__thumb2__)
    #error \"Thumb2 instruction set isn't available\"
    #endif
    int main() {}
   ")

    include(CheckCXXSourceCompiles)
    CHECK_CXX_SOURCE_COMPILES("${ARM_THUMB2_TEST_SOURCE}" ARM_THUMB2_DETECTED)
    if (NOT ARM_THUMB2_DETECTED)
        set(ARM_TRADITIONAL_DETECTED TRUE)
        # See https://bugs.webkit.org/show_bug.cgi?id=159880#c4 for details.
        message(STATUS "Disabling GNU gold linker, because it doesn't support ARM instruction set properly.")
    endif ()
endif ()

That should force your build to be configure your build as "ARM TRADITIONAL" and skip that check, which would not be a fix of course, but maybe drops some light...

Sorry not to be more helpful. As I said in my post, "I'm not a CMake expert", not at all :-)

@mariospr
Copy link
Owner

cmake -DCMAKE_TOOLCHAIN_FILE=/mnt/c/Dev/Linux/webkit-src/arm-toolchain.cmake \
        -DPORT=GTK \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_SYSCONFDIR=/mnt/c/Dev/Linux/webkit-src/output/etc \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/mnt/c/Dev/Linux/webkit-src/output/var \
        -DCMAKE_INSTALL_PREFIX=/mnt/c/Dev/Linux/webkit-src/output/usr \

Btw, these last tree paths do not seem right: they should be the paths relative to the root of your ARM root filesystem, not to your local machine, so that when you run WebKit later on your device, it will look for the files in the right places.

For instance, I use this:

        -DCMAKE_INSTALL_SYSCONFDIR=/etc \
        -DCMAKE_INSTALL_LOCALSTATEDIR=/var \
        -DCMAKE_INSTALL_PREFIX=/usr \

Not that it will probably make any difference for compiling, but still worth mentioning.

@mariospr
Copy link
Owner

Argh! Stupid github... I edited your first comment by mistake, and now I can't get it back. Sorry!

@galvesribeiro PS: if you by any chance still have the page open in your browser, please re-edit the description and add the info there back again. If only github had a way to see the history of an issue... dear-github/dear-github#129

@galvesribeiro
Copy link
Author

@mariospr oh gosh, I don't have the page. There is a history I think on the "edited" word but only you or any other contributor can see it.

@mariospr
Copy link
Owner

Nope, there's nothing like that... sigh. Anyway, I hope my comments are helpful to you at least

@galvesribeiro
Copy link
Author

@mariospr yup I comented out that IF and the ARM thumb error goes away. Now it is complaining here:

-- Found BISON: /usr/bin/bison (found suitable version "3.0.2", minimum required is "2.1")
-- Found Gperf: /usr/bin/gperf (Required is at least version "3.0.1")
-- Found Perl: /usr/bin/perl (found suitable version "5.18.2", minimum required is "5.10.0")
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.6", minimum required is "2.7.0")
-- Could NOT find Ruby (missing:  RUBY_INCLUDE_DIR RUBY_LIBRARY RUBY_CONFIG_INCLUDE_DIR) (found suitable version "1.9.1", minimum required is "1.9")
-- Looking for include file features.h
-- Looking for include file features.h - found
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
CMake Error at Source/cmake/FindCairo.cmake:65 (message):
  Required version (1.10.2) is higher than found version ()
Call Stack (most recent call first):
  Source/cmake/OptionsGTK.cmake:33 (find_package)
  Source/cmake/WebKitCommon.cmake:47 (include)
  CMakeLists.txt:126 (include)

@galvesribeiro
Copy link
Author

And regarding the paths, I'm not using the chroot because it doesn't work on "Bash for Windows" (Ubuntu on Windows 10) yet but, the environment is clean and has everything you requested on the tutorial except the toolchain which I have to use the one from the device manufacturer.

Here is the toolchain + sysroot https://drive.google.com/open?id=0B7G82Sx-erLTUmlWZEZPNUVodjQ

Any idea?

@mariospr
Copy link
Owner

Good. Now, assuming you have the right paths set in the CMake toolchain file, pointing to your rootfs and all that, I'd say what's going on here is that your rootfs does not have a recent enough version of cairo for WebKit2GTK to compile against.

Or maybe, and actually this looks more likely, that you don't have the -devel package for cairo installed in your rootfs, so there are no header files, no pkgconfig .pc files... nothing. You need to get all the build dependencies for WebKit installed in the rootfs, or this won't work. For a hint on what exactly is needed, you can check the Build-Deps declared by debian in the debian/control file, inside this tarball: http://http.debian.net/debian/pool/main/w/webkit2gtk/webkit2gtk_2.14.0-1.debian.tar.xz

@mariospr
Copy link
Owner

You don't strictly need a chroot to build this, but I like to use it to have reproducible environments and not having to depend on my current host system, which might change.

@galvesribeiro
Copy link
Author

@mariospr yeah I know. Let me look at the list of the dependencies. I though webkit building process would build it. Will let you know about the updates. Thanks! :)

@mariospr
Copy link
Owner

WebKit2GTK builds the dependencies if you use the Tools/Script/build-webkitcommand inside a jhbuild, but the method described here assumes you have everything you need in the RootFS and simply uses cmake + make directly

@galvesribeiro
Copy link
Author

Alright, no problem. I just need to find out the dependency list for it.

Another question... The target device is a ARMv6l that has no Window Manager and only the framebuffer exposed... Do you think it is possible to use webkit on it? All I need is a full screen "browser" that render HTML5/CSS3/JS local web apps...

@mariospr
Copy link
Owner

It should be possible. IIRC, the buildbots used for WebKit2GTK+ use Xvfb to run the tests, so I'm guessing having a WM is not strictly required and that a framebuffer is enough.

@SomeoneWeird
Copy link

SomeoneWeird commented Mar 7, 2017

fwiw I'm having the same issue as above, it's not 'detecting' cairo properly, even though I have the lib + headers installed.

ubuntu@ip-172-31-1-32:~/webkit/BUILD$ cmake -DCMAKE_TOOLCHAIN_FILE=~/toolchain.cmake         -DPORT=GTK         -DCMAKE_BUILD_TYPE=Release         -DCMAKE_INSTALL_SYSCONFDIR=/etc         -DCMAKE_INSTALL_LOCALSTATEDIR=/var         -DCMAKE_INSTALL_PREFIX=/usr         -DCMAKE_INSTALL_LIBDIR=lib/arm-linux-gnueabihf         -DCMAKE_INSTALL_LIBEXECDIR=lib/arm-linux-gnueabihf         -DENABLE_PLUGIN_PROCESS_GTK2=OFF         -DENABLE_GEOLOCATION=OFF         -DENABLE_GLES2=ON         -DUSE_LD_GOLD=OFF         ..
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc-4.9
-- Check for working C compiler: /usr/bin/arm-linux-gnueabihf-gcc-4.9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++-4.9
-- Check for working CXX compiler: /usr/bin/arm-linux-gnueabihf-g++-4.9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Gperf: /usr/bin/gperf (Required is at least version "3.0.1")
-- Found Perl: /usr/bin/perl (found suitable version "5.22.1", minimum required is "5.10.0")
-- Found PythonInterp: /usr/bin/python2.7 (found suitable version "2.7.12", minimum required is "2.7.0")
-- Could NOT find Ruby (missing:  RUBY_INCLUDE_DIR RUBY_LIBRARY RUBY_CONFIG_INCLUDE_DIR) (found suitable version "2.3.0", minimum required is "1.9")
-- Performing Test ARM_THUMB2_DETECTED
-- Performing Test ARM_THUMB2_DETECTED - Success
-- Looking for features.h
-- Looking for features.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for langinfo.h
-- Looking for langinfo.h - found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for pthread_np.h
-- Looking for pthread_np.h - not found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for sys/timeb.h
-- Looking for sys/timeb.h - found
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for IsDebuggerPresent
-- Looking for IsDebuggerPresent - not found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for strnstr
-- Looking for strnstr - not found
-- Looking for timegm
-- Looking for timegm - found
-- Looking for vasprintf
-- Looking for vasprintf - found
-- Looking for SIGTRAP
-- Looking for SIGTRAP - found
-- Performing Test HAVE_STAT_BIRTHTIME_value
-- Performing Test HAVE_STAT_BIRTHTIME_value - Failed
-- Performing Test HAVE_TM_GMTOFF_value
-- Performing Test HAVE_TM_GMTOFF_value - Success
-- Performing Test HAVE_TM_ZONE_value
-- Performing Test HAVE_TM_ZONE_value - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find Cairo (missing: CAIRO_LIBRARIES) (found suitable version
  "1.14.6", minimum required is "1.10.2")
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  Source/cmake/FindCairo.cmake:71 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  Source/cmake/OptionsGTK.cmake:32 (find_package)
  Source/cmake/WebKitCommon.cmake:42 (include)
  CMakeLists.txt:137 (include)


-- Configuring incomplete, errors occurred!
See also "/home/ubuntu/webkit/BUILD/CMakeFiles/CMakeOutput.log".
See also "/home/ubuntu/webkit/BUILD/CMakeFiles/CMakeError.log".
ubuntu@ip-172-31-1-32:~/webkit/BUILD$ sudo apt-get install libcairo2-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcairo2-dev is already the newest version (1.14.6-1).
libcairo2-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

It even finds it (found suitable version "1.14.6", minimum required is "1.10.2") but for some reason won't use it when building..

Would appreciate any help :)

@mariospr
Copy link
Owner

mariospr commented Mar 7, 2017

I think it's finding the Cairo libraries in your host system and somehow CMake is getting confused and not reporting a very useful error by saying that "you have "1.14.6 (in your host) installed but minimum required is 1.10.2 (in your ARM rootfs, where you probably don't have Cairo's dev files).

Please check whether you have the relevant .pc file for cairo inside the ARM rootfs and, if present, which version it does specify. My guessing is that you don't have it there, and you'll have to first install it.

FWIW, I add extra dependencies in my ARM rootfs by chrooting into it (using qemu-arm-static + binfmt) and then apt-get installing things from there. It's slow, but works :)

@SomeoneWeird
Copy link

@mariospr Ah, sorry - I forgot to mention I'm doing this all on my host. Clean ubuntu 16.04, I edited the toolchain file to remove all the references to ROOTFS, is that correct or did I screw up something else?

@mariospr
Copy link
Owner

mariospr commented Mar 7, 2017

I'm a bit confused now: if you're doing all this directly in your host machine, why do you need to use this toolchain file at all? WebKitGTK+ builds fine both on Intel and ARM (and other arches too) natively, this toolchain file is only meant to be used for cross compiling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants