Linux: Add ARM build support

Issue #1990 resolved
Marshall Greenblatt created an issue

CEF currently supports building for x86/64 processors only. Chromium supports building for ARM processors [1] [2]. It should therefore be possible to support CEF building for ARM processors.

ARM support will be implemented in stages:

  1. Support building of CEF for Debian-based ARM platforms that include X11 (e.g. Ubuntu for ARM).
  2. Support building of CEF for arbitrary Linux ARM platforms. This step is blocked on completion of issue #1989 (add ozone support and remove X11 dependency).

Example of target systems:

[1] https://chromium.googlesource.com/chromium/src/+/master/docs/linux_chromium_arm.md

[2] https://bugs.chromium.org/p/chromium/issues/detail?id=564059

Comments (40)

  1. Gutemberg Ribeiro

    Having non-X11 support on ARM devices that doesn't have a Window Manager and only have the device framebuffer(i.e. /dev/fb) is something really needed. Also there is a requirement that the device MUST have VFP/FPU which is not true on many embedded devices so would be good to have it optional as well.

  2. Marshall Greenblatt reporter

    ARM build support has been added in master revision 6158110 and 2840 branch revision c316966.

    To cross-compile CEF for ARM using an Ubuntu 14.04 64-bit host system and either the automated or manual build method:

    • export GYP_DEFINES=target_arch=arm. This will cause the debian_wheezy_arm-sysroot to be installed by gclient [1].
    • export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 arm_float_abi=hard" Creating an official build avoids failures due to the linker running out of memory.
    • See build/config/arm.gni for other ARM-related configuration settings: https://cs.chromium.org/chromium/src/build/config/arm.gni?sq=package:chromium&dr

    Automated build: In addition to the instructions on the AutomatedBuildSetup Wiki page:

    • Run automate-git.py with the --arm-build command-line flag.

    Manual build: In addition to the instructions on the MasterBuildQuickStart Wiki page:

    • Run ninja -C out/Debug_GN_arm cefsimple to build the Debug configuration. Change "Debug" to "Release" to build the Release configuration. Note that the cefclient target cannot be built when using a sysroot environment.
    • Run make_distrib.sh with the --arm-build command-line flag to generate a binary distribution from the ARM build.

    To verify the architecture of the resulting binaries:

    $ file out/Debug_GN_arm/cefsimple
    cefsimple: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=d29f0414c30e44c7248a71adc59f74b4221f2985, not stripped
    

    [1] Alternately, you can run ./build/linux/sysroot_scripts/install-sysroot.py --arch=arm manually after downloading Chromium source code.

  3. Marshall Greenblatt reporter

    The attached arm64.patch file adds ARM64 build support to master. It won't build successfully until CEF has moved past the changes in the above Chromium issue.

  4. Marshall Greenblatt reporter

    ARM build tested to run successfully on an ASUS C201 Chromebook running Crouton.

    1. Install Crouton with xfce as described at http://www.howtogeek.com/162120/how-to-install-ubuntu-linux-on-your-chromebook-with-crouton/. If Crouton fails to start with "Fatal server error: no screens found" error see the fix here: https://github.com/dnschneid/crouton/issues/1978#issuecomment-228258065
    2. Create an ARM Release build as described above and copy to the Chromebook.
    3. Install additional required packages (use ldd to identify missing libs): sudo apt-get install libnss3 libnspr4 libxss1
    4. Run cefsimple with sandbox disabled: cefsimple --no-sandbox

    Running with sandbox enabled fails with the following error:

    The setuid sandbox is not running as root. Common causes:
      * An unprivileged process using ptrace on it, like a debugger.
      * A parent process set prctl(PR_SET_NO_NEW_PRIVS, ...)
    Failed to move to new namespace: PID namespaces supported, Network namespace supported, but failed: errno = Operation not permitted
    
  5. Fredrik Qvarnstrom

    Same here, any update? @magreenblatt? I have been waiting for you for over 5 months.

    I need to use CEF on Raspberry Pi.

    Thanks

  6. Robert Blanckaert

    After hand applying the patch to master, copying the atomicops for arm64 out of the google protobuf project, and a little manual tweaking, I got a working aarch64 build.

    Hope to have a pull request ready soon.

  7. David Ambarsumov

    Hello, is there any news about arm support and raspberry support? How can I compile it by myself ?

  8. Boscop

    Is there any Update on this?

    @basicer Can you please share your steps you did to get it working on Raspberry Pi? :)

    Thanks!

  9. Robert Blanckaert

    For Raspberry Pi 3 it pretty much just works out of the box.

    • Install cross tools
    • export GYP_DEFINES=target_arch=arm
    • export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 arm_float_abi=hard
    • Run automate-git.sh with --build-arm
  10. Boscop

    @basicer Thanks for the quick reply. Which cross tools do you mean? And where can I find automate-git.sh? :)

  11. David Ambarsumov

    @basicer hello thank you is this for cross compile or do i need to compile it exactly at raspberry pi3?

  12. Paulo Coutinho

    Hi, any update to ARM support? More specific to Raspberry 3. Thanks. I want add support to CEF on my tool EzoRed (ezored.com).

  13. AndreRenaud

    Following these instructions, and performing the build on Ubuntu 17.10 x86_64, I'm seeing issues with the cross compilation: [29/42847] ASM obj/third_party/boringssl/boringssl_asm/aes-armv4.o FAILED: obj/third_party/boringssl/boringssl_asm/aes-armv4.o ../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/boringssl/boringssl_asm/aes-armv4.o.d -DBORINGSSL_CLANG_SUPPORTS_DOT_ARCH -DV8_DEPRECATION_WARNINGS -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"318667-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../third_party/boringssl/src/include -I../.. -Igen -fno-integrated-as -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -fcolor-diagnostics -no-canonical-prefixes -std=gnu11 --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -mfpu=neon -gdwarf-3 -g1 --sysroot=../../build/linux/debian_stretch_arm-sysroot -c ../../third_party/boringssl/linux-arm/crypto/fipsmodule/aes-armv4.S -o obj/third_party/boringssl/boringssl_asm/aes-armv4.o /usr/bin/as: unrecognized option '-mfloat-abi=hard' clang: error: assembler command failed with exit code 1 (use -v to see invocation) [38/42847] CXX obj/third_party/webrtc/...ideo_stream_api/video_receive_stream.o ninja: build stopped: subcommand failed.

    It looks like it's ending up on a native clang instance rather than the cross compilation. Does anyone have any pointers on how best to resolve this?

  14. Marcos Cereijo

    I am having some troubles while trying to compile CEF for ARM. Can anybody give me some insight about what is going wrong?

    Here is the output log:

    #!bash
    
    [47414/47785] CXX obj/cef/libcef_static/window_x11.o
    FAILED: obj/cef/libcef_static/window_x11.o 
    ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/cef/libcef_static/window_x11.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"328716-2\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=329375 -DCR_LIBCXXABI_REVISION=329629 -DCR_SYSROOT_HASH=ed31924757f11885a21793dc4b928d07ab25740c -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBUILDING_CEF_SHARED -DUSING_CHROMIUM_INCLUDES -DWEBP_EXTERN=extern -DUSE_EGL -DTOOLKIT_VIEWS=1 -DEXPAT_RELATIVE_PATH -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_SUPPORT_GPU=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DV8_USE_EXTERNAL_STARTUP_DATA -DLEVELDB_PLATFORM_CHROMIUM=1 -DMESA_EGL_NO_X11_HEADERS -DI18N_ADDRESS_VALIDATION_DATA_URL=\"https://chromium-i18n.appspot.com/ssl-aggregate-address/\" -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DGTEST_RELATIVE_PATH -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DHUNSPELL_STATIC -DHUNSPELL_CHROME_CLIENT -DUSE_HUNSPELL -DFT_CONFIG_CONFIG_H=\"freetype-custom-config/ftconfig.h\" -DFT_CONFIG_MODULES_H=\"freetype-custom-config/ftmodule.h\" -DFT_CONFIG_OPTIONS_H=\"freetype-custom-config/ftoption.h\" -DPDFIUM_REQUIRED_MODULES -DCHROMIUM_RESTRICT_VISIBILITY -I../../third_party/crashpad/crashpad -I../.. -Igen -I../../cef -I../../third_party/libwebp/src -I../../third_party/khronos -I../../gpu -I../../third_party/libyuv/include -I../../third_party/webrtc_overrides -I../../testing/gtest/include -I../../third_party/libyuv/include -I../../third_party/usrsctp/usrsctplib -I../../third_party/webrtc -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/gpu -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/boringssl/src/include -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include -I../../third_party/libwebm/source -I../../third_party/blink -Igen/third_party/blink -I../../v8/include -Igen/v8/include -Igen/third_party/metrics_proto -I../../third_party/re2/src -I../../third_party/mesa/src/include -Igen -Igen -I../../third_party/libaddressinput/src/cpp/include -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Igen -I../../third_party/flatbuffers/src/include -I../../third_party/brotli/include -I../../third_party/libxml/src/include -I../../third_party/libxml/linux/include -I../../third_party/zlib -I../../v8/include -Igen/v8/include -I../../third_party/freetype/include -I../../third_party/freetype/src/include -I../../third_party/harfbuzz-ng/src/src -I../../third_party/breakpad/breakpad/src -fno-strict-aliasing -fmerge-all-constants --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -fcolor-diagnostics -no-canonical-prefixes --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -mfpu=neon -mthumb -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -gdwarf-3 -g1 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-header-guard -isystem../../build/linux/debian_sid_arm-sysroot/usr/include/nss -isystem../../build/linux/debian_sid_arm-sysroot/usr/include/nspr -Wno-exit-time-destructors -DLIBXML_STATIC= -std=gnu++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_arm-sysroot -fvisibility-inlines-hidden -c ../../cef/libcef/browser/native/window_x11.cc -o obj/cef/libcef_static/window_x11.o
    ../../cef/libcef/browser/native/window_x11.cc:30:26: error: no member named 'xany' in 'ui::Event'
      ::Window target = xev->xany.window;
                        ~~~  ^
    ../../cef/libcef/browser/native/window_x11.cc:31:12: error: reference to non-static member function must be called; did you mean to call it with no arguments?
      if (xev->type == GenericEvent)
          ~~~~~^~~~
                   ()
    ../../cef/libcef/browser/native/window_x11.cc:32:47: error: no member named 'xcookie' in 'ui::Event'
        target = static_cast<XIDeviceEvent*>(xev->xcookie.data)->event;
                                             ~~~  ^
    ../../cef/libcef/browser/native/window_x11.cc:278:11: error: cannot initialize a variable of type 'XEvent *' (aka '_XEvent *') with an lvalue of type 'const ui::PlatformEvent' (aka 'ui::Event *const')
      XEvent* xev = event;
              ^     ~~~~~
    4 errors generated.
    [47419/47785] CXX obj/cef/libcef_static/render_widget_host_view_osr_linux.o
    FAILED: obj/cef/libcef_static/render_widget_host_view_osr_linux.o 
    ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/cef/libcef_static/render_widget_host_view_osr_linux.o.d -DV8_DEPRECATION_WARNINGS -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DNO_TCMALLOC -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DOFFICIAL_BUILD -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DCR_CLANG_REVISION=\"328716-2\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -DCR_LIBCXX_REVISION=329375 -DCR_LIBCXXABI_REVISION=329629 -DCR_SYSROOT_HASH=ed31924757f11885a21793dc4b928d07ab25740c -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBUILDING_CEF_SHARED -DUSING_CHROMIUM_INCLUDES -DWEBP_EXTERN=extern -DUSE_EGL -DTOOLKIT_VIEWS=1 -DEXPAT_RELATIVE_PATH -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_SUPPORT_GPU=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DV8_USE_EXTERNAL_STARTUP_DATA -DLEVELDB_PLATFORM_CHROMIUM=1 -DMESA_EGL_NO_X11_HEADERS -DI18N_ADDRESS_VALIDATION_DATA_URL=\"https://chromium-i18n.appspot.com/ssl-aggregate-address/\" -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DGTEST_RELATIVE_PATH -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DHUNSPELL_STATIC -DHUNSPELL_CHROME_CLIENT -DUSE_HUNSPELL -DFT_CONFIG_CONFIG_H=\"freetype-custom-config/ftconfig.h\" -DFT_CONFIG_MODULES_H=\"freetype-custom-config/ftmodule.h\" -DFT_CONFIG_OPTIONS_H=\"freetype-custom-config/ftoption.h\" -DPDFIUM_REQUIRED_MODULES -DCHROMIUM_RESTRICT_VISIBILITY -I../../third_party/crashpad/crashpad -I../.. -Igen -I../../cef -I../../third_party/libwebp/src -I../../third_party/khronos -I../../gpu -I../../third_party/libyuv/include -I../../third_party/webrtc_overrides -I../../testing/gtest/include -I../../third_party/libyuv/include -I../../third_party/usrsctp/usrsctplib -I../../third_party/webrtc -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/encode -I../../third_party/skia/include/gpu -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/src/gpu -I../../third_party/skia/src/sksl -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/boringssl/src/include -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include -I../../third_party/libwebm/source -I../../third_party/blink -Igen/third_party/blink -I../../v8/include -Igen/v8/include -Igen/third_party/metrics_proto -I../../third_party/re2/src -I../../third_party/mesa/src/include -Igen -Igen -I../../third_party/libaddressinput/src/cpp/include -I../../third_party/webrtc_overrides -I../../third_party/webrtc -Igen -I../../third_party/flatbuffers/src/include -I../../third_party/brotli/include -I../../third_party/libxml/src/include -I../../third_party/libxml/linux/include -I../../third_party/zlib -I../../v8/include -Igen/v8/include -I../../third_party/freetype/include -I../../third_party/freetype/src/include -I../../third_party/harfbuzz-ng/src/src -I../../third_party/breakpad/breakpad/src -fno-strict-aliasing -fmerge-all-constants --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -pthread -fcolor-diagnostics -no-canonical-prefixes --target=arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mtune=generic-armv7-a -mfpu=neon -mthumb -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-ignored-pragma-optimize -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -gdwarf-3 -g1 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-header-guard -isystem../../build/linux/debian_sid_arm-sysroot/usr/include/nss -isystem../../build/linux/debian_sid_arm-sysroot/usr/include/nspr -Wno-exit-time-destructors -DLIBXML_STATIC= -std=gnu++14 -fno-exceptions -fno-rtti -nostdinc++ -isystem../../buildtools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/debian_sid_arm-sysroot -fvisibility-inlines-hidden -c ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc -o obj/cef/libcef_static/render_widget_host_view_osr_linux.o
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:170:3: error: use of undeclared identifier 'window_'
      window_ = new CefWindowX11(NULL, None, gfx::Rect(0, 0, 1, 1));
      ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:171:24: error: use of undeclared identifier 'window_'
      compositor_widget_ = window_->xwindow();
                           ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:178:10: error: unknown type name 'window_'; did you mean 'Window'?
      DCHECK(window_);
             ^~~~~~~
             Window
    ../../base/logging.h:888:54: note: expanded from macro 'DCHECK'
    #define DCHECK(condition) EAT_STREAM_PARAMETERS << !(condition)
                                                         ^
    ../../cef/libcef/browser/native/window_x11.h:11:23: note: 'Window' declared here
    typedef unsigned long Window;
                          ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:178:18: error: expected expression
      DCHECK(window_);
                     ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:179:3: error: use of undeclared identifier 'window_'
      window_->Close();
      ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:186:10: error: use of undeclared identifier 'invisible_cursor_'
        if (!invisible_cursor_) {
             ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:187:7: error: use of undeclared identifier 'invisible_cursor_'
          invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(),
          ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:190:12: error: use of undeclared identifier 'invisible_cursor_'
        return invisible_cursor_->get();
               ^
    ../../cef/libcef/browser/osr/render_widget_host_view_osr_linux.cc:192:12: error: cannot initialize return object of type 'ui::PlatformCursor' (aka 'void *') with an rvalue of type '::Cursor' (aka 'unsigned long')
        return GetXCursor(ToCursorID(type));
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9 errors generated.
    ninja: build stopped: subcommand failed.
    
  15. Seth LaForge

    I'm trying to get ARM build to work with automate-git.py. I've successfully built for ARM and run on a Raspberry Pi 3+. I had to make a few changes to automate-git.py and make_distrib.py to make it work. I tried to create a pull request, but I don't see any way within bitbucket to create one - the left bar has no "Create Pull Request" item - maybe I need additional permissions? In case, the following change lets me build for ARM:

    https://bitbucket.org/Seth-LaForge/cef/commits/e12bf363bcec9b26541f17e6c916cc8b9f566636?at=arm-build

    It doesn't seem to build swiftshader - I haven't figured out why, or if it would be reasonable to do so.

    Here's how I've gotten it to build, on a clean VM with ubuntu 16.04 server:

    mkdir cef
    cd cef
    sudo apt-get install curl libgtkglext1-dev
    curl 'https://chromium.googlesource.com/chromium/src/+/master/build/install-build-deps.sh?format=TEXT' | base64 -d > install-build-deps.sh
    chmod 755 install-build-deps.sh
    sudo ./install-build-deps.sh --no-chromeos-fonts
    wget https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py
    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    # Make changes in my commit above #
    export PATH=$HOME/cef/depot_tools:$PATH
    export GYP_DEFINES=target_arch=arm
    export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 arm_float_abi=hard"
    python ./automate-git.py --download-dir=$HOME/cef --branch=3497 --arm-build --build-target=cefsimple
    scp -r chromium/src/cef/binary_distrib/cef_binary_3.3497.1818.g17f0192_linuxarm pi@my-pi:cef/
    

    I can build & run cefsimple on the Pi:

    cd cef/cef_binary_3.3497.1818.g17f0192_linuxarm
    mkdir build && cd build
    sudo apt install gcc-6 g++-6
    # comment out swiftshader from ../cmake/cef_variables.cmake
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DPROJECT_ARCH=arm ..
    make -j4 cefsimple
    EXE="/home/pi/cef/cef_binary_3.3497.1818.g17f0192_linuxarm/build/tests/cefsimple/Debug/chrome-sandbox" && sudo -- chown root:root $EXE && sudo -- chmod 4755 $EXE
    ./tests/cefsimple/Debug/cefsimple
    

  16. Romain Caire

    If it's usefull to anyone, I've managed to build the arm64 build using this patch (loosely based on the previous patch, with the atomic file embedded)

    https://gist.github.com/supercairos/3a5c296333fe1641ab6a60f8d49d94b8

    To use:

    1. Setup your build environment properly (follow MasterBuildQuickStart for a quick start guide roughly until step 5)

    2. Download CEF source within your download folder (using automate-git.py)

    #!bash
    mkdir ~/cef-3729
    mkdir ~/cef-3729/automate
    mkdir ~/cef-3729/chromium_git
    
    cd ~/cef-3729/automate/
    wget https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py
    
    cd ~/cef-3729/chromium_git/
    python $HOME/cef-3729/automate/automate-git.py --download-dir=$HOME/cef-3729/chromium_git --branch=3729 --force-clean --no-distrib --no-build
    
    1. Apply patch in "chromium/src/cef" folder
    #!bash
    cd ~/cef-3729/chromium_git/chromium/src/cef/
    wget https://gist.githubusercontent.com/supercairos/3a5c296333fe1641ab6a60f8d49d94b8/raw/b37ea4f5155875e245205af3c86e6f58fcf96127/cef_3729_arm64.patch
    git apply cef_3729_arm64.patch
    rm cef_3729_arm64.patch
    
    1. Download the arm64 toolchain
    #!bash
    cd ~/cef-3729/chromium_git/chromium/src/
    ./build/linux/sysroot_scripts/install-sysroot.py --arch=arm64
    
    1. Set appropriate GN & GYP defines. (Note that i've disabled CUPS and NaCL)

    #!bash
    export GYP_DEFINES=target_arch=arm64
    export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 enable_nacl=false use_cups=false"
    
    4. And run build command :

    #!bash
    cd ~/cef-3729/chromium_git/
    python $HOME/cef-3729/chromium_git/chromium/src/cef/tools/automate/automate-git.py --download-dir=$HOME/cef-3729/chromium_git --branch=3729 --arm64-build --no-update --force-build --minimal-distrib --client-distrib --force-distrib --build-target=cefsimple
    

    Again those commands are based on my (poor) experience of compiling CEF and might probably be optimized.

    @magreenblatt I'm wondering why the arm64 has not been merged onto master ? It's quite useful for linux setup box :)

  17. Tejendra Singh Tomar

    After following normal steps by adding arm flag to buildeps and automated build, I am getting following errors

    ninja: Entering directory `out/Debug_GN_arm' [1/370] ACTION //tools/v8_context_snapshot:generate_v8_context_snapshot(//build/toolchain/linux:clang_arm) FAILED: v8_context_snapshot.bin python ../../build/gn_run_binary.py ./clang_x86_v8_arm/v8_context_snapshot_generator --output_file=v8_context_snapshot.bin ././clang_x86_v8_arm/v8_context_snapshot_generator: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory ./clang_x86_v8_arm/v8_context_snapshot_generator failed with exit code 127 ninja: build stopped: subcommand failed.

    I already have this library under code/chromium_git/chromium/src/build/linux/debian_sid_arm-sysroot/usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0, any idea what might be causing this, as i am not able to find any solution for this?

  18. Romain Caire

    Chromium flags seams fine. On our end we’ve removed CUPS and NaCL both to improve build time & less dependency.

    Unfortunalty, I won’t have time to provide a PR until end of next week…

  19. Marshall Greenblatt reporter

    @super-cairos Thanks for the feedback. The CEF build should be setting enable_nacl=false by default (from gn_args.py). We’d probably want to leave CUPS enabled for the official builds.

  20. David Sowa

    I have built the current master for arm64 using the patch from @Romain Caire as a guide. There are 2 or 3 little changes needed as the python scripts have changed over time. I would really like to see the arm64 support get finalized as a feature. Is this planned? Can I assist to get this added?

  21. Marshall Greenblatt reporter

    @David Sowa Can you submit a PR with Romain’s patch plus your changes? Thanks.

  22. David Sowa

    I submitted the PR for the arm64 build additions.

    Just a side note I started the process on an Ubuntu VM with 64GB of disk which filled up and failed, it succeeded after raising the disk to 100GB. Just to save anyone trying to replicate this a time consuming extra step.

  23. Marshall Greenblatt reporter

    Add ARM64 build and binary distribution support (see issue #1990)

    Adds a new --arm64-build option to automate-git.py and make_distrib.py.

    → <<cset f0c82200ba7f>>

  24. Gutemberg Ribeiro

    Hey folks!

    I know it is pretty late to ask but, the final overcome here looks like we finally have an ARM64 build option. That is awesome! Great work for everyone!

    I’m looking on Spotify builds here http://opensource.spotify.com/cefbuilds/index.html and look like we don’t have those pre-built binaries there…

    @magreenblatt you mentioned that you could add it there. Is there a chance to have the binaries on it?

    Thank you!

  25. Fabien Picarougne

    Hi everybody.

    Builds provided by @Frank Pfattheicher on the chromely website works very well for my application on a raspberry pi 4. @Marshall Greenblatt is it possible to have automated builds on spotify as you mentioned it? or @Frank Pfattheicher is it possible to update your build with the current version?

    Thank you very much for the work you have already done.

  26. Log in to comment