cross compiling arm: Atomic operations not supported

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

cross compiling arm: Atomic operations not supported

Postby JonnyX » Thu Jun 25, 2015 7:27 am

I want to cross compile CEF for arm architecture on ubuntu14.04.

I have used the automate-git.py script for cloning repos and compiling.

used environmet variables:
GYP_GENERATORS=ninja
GYP_CROSSCOMPILE=1
GYP_DEFINES=target_arch=arm arm_float_abi=hard component=shared_library

:cry:
Compiling ends with an error on the libcef_dll_wrapper target:

Generating CEF project files...
________ running '/usr/bin/python ../build/gyp_chromium cef.gyp -I cef.gypi' in '/home/devel/workspace/cef3/chromium/src/cef'
Updating projects from gyp files...
-------- Running "ninja -C out/Release cefclient chrome_sandbox" in "/home/devel/workspace/cef3/chromium/src"...
ninja: Entering directory `out/Release'
ninja: warning: multiple rules generate gen/about_credits.html. builds involving this target will not be correct; continuing anyway
ninja: warning: multiple rules generate files/osr_test.html. builds involving this target will not be correct; continuing anyway
[6101/14108] ACTION cef_pak: make_pack_resources_header_257e1bb3c5349fb75dd8330e75fc96f7
File include/cef_pack_resources.h updated.
[6107/14108] ACTION cef_pak: make_pack_strings_header_257e1bb3c5349fb75dd8330e75fc96f7
File include/cef_pack_strings.h updated.
[13903/14108] CXX obj/cef/libcef_dll/ctocpp/libcef_dll_wrapper.callback_ctocpp.o
FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/cef/libcef_dll/ctocpp/libcef_dll_wrapper.callback_ctocpp.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=238013-3 -DCOMPONENT_BUILD -DTOOLKIT_VIEWS=1 -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_PRE_SYNC_BACKUP -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DSAFE_BROWSING_SERVICE -DUSING_CEF_SHARED -DGL_GLEXT_PROTOTYPES -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=0 -DMOJO_USE_SYSTEM_IMPL -DUSE_LIBPCI=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../cef -I../.. -I../../third_party/khronos -I../../gpu -I../../skia/config -I../../third_party/WebKit/Source -Igen/angle -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -fcolor-diagnostics -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -target arm-linux-gnueabihf -march=armv7-a -no-integrated-as -mtune=generic-armv7-a -mfpu=neon -mfloat-abi=hard -mthumb --sysroot=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot -O2 -fno-ident -fdata-sections -ffunction-sections -funwind-tables -funique-section-names -Wno-c++0x-compat -Wno-deprecated-declarations -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -std=gnu++11 -c ../../cef/libcef_dll/ctocpp/callback_ctocpp.cc -o obj/cef/libcef_dll/ctocpp/libcef_dll_wrapper.callback_ctocpp.o
In file included from ../../cef/libcef_dll/ctocpp/callback_ctocpp.cc:13:
In file included from ../../cef/libcef_dll/ctocpp/callback_ctocpp.h:21:
In file included from ../../cef/include/cef_callback.h:41:
In file included from ../../cef/include/cef_base.h:35:
In file included from ../../cef/include/base/cef_atomic_ref_count.h:55:

../../cef/include/base/cef_atomicops.h:187:2: error: "Atomic operations are not supported on your platform"
#error "Atomic operations are not supported on your platform"
^
1 error generated.
[13903/14108] CXX obj/cef/libcef_dll/ctocpp/libcef.scheme_handler_factory_ctocpp.o
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "automate-git.py", line 861, in <module>
if options.buildlogfile else None)
File "automate-git.py", line 55, in run
shell=(sys.platform == 'win32'))
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja', '-C', 'out/Release', 'cefclient', 'chrome_sandbox']' returned non-zero exit status 1


I read something about defining BUILDING_CEF_SHARED variable.
Doing this, brings me to other errors: OVERRIDE variable not defined :evil:
After defining OVERRIDE internal:: namespace problems did appear. :evil: :evil:

I have also tried other cef branches (2357, 2272) but there are the same problems.
What did I make wrong?

Is there anyone, how has successfully cross compiled CEF for arm :?:

Thanks,
Jonny
JonnyX
Newbie
 
Posts: 3
Joined: Thu Jun 25, 2015 2:38 am

Re: cross compiling arm: Atomic operations not supported

Postby crast » Thu Jun 25, 2015 11:19 pm

In file include/base/cef_atomicops.h replace
Code: Select all
#include "include/base/internal/cef_atomicops_x86_gcc.h"
#else

by
Code: Select all
 #include "include/base/internal/cef_atomicops_x86_gcc.h"
#elif defined(COMPILER_GCC) && defined(__ARM_ARCH)
#include "include/base/internal/cef_atomicops_arm_gcc.h"
#else


Copy cef_atomicops_arm_gcc.h in include/base/internal/. This is a file from chromium source code.
Attachments
cef_atomicops_arm_gcc.h
(10.51 KiB) Downloaded 662 times
crast
Techie
 
Posts: 15
Joined: Tue Sep 23, 2014 2:30 am

Re: cross compiling arm: Atomic operations not supported

Postby JonnyX » Mon Jun 29, 2015 3:17 pm

thank you so much, :D
where did you find this information?

the error has gone away but now libcef can't be linked because of many undefined references. :(

devel@ubuntu:~/workspace/cef3/chromium/src$ ninja -C out/Release cefclient
ninja: Entering directory `out/Release'
ninja: warning: multiple rules generate gen/about_credits.html. builds involving this target will not be correct; continuing anyway
ninja: warning: multiple rules generate files/osr_test.html. builds involving this target will not be correct; continuing anyway
[39/111] SOLINK lib/libcef.so
FAILED: if [ ! -e lib/libcef.so -o ! -e lib/libcef.so.TOC ]; then ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -B/home/devel/workspace/cef3/chromium/src/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -L. -L/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-uIsHeapProfilerRunning,-uProfilerStart -Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi -Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl -Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv -target arm-linux-gnueabihf --sysroot=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot -L/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -L/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -o lib/libcef.so -Wl,-soname=libcef.so @lib/libcef.so.rsp && { readelf -d lib/libcef.so | grep SONAME ; nm -gD -f p lib/libcef.so | cut -f1-2 -d' '; } > lib/libcef.so.TOC; else ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -B/home/devel/workspace/cef3/chromium/src/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -L. -L/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-uIsHeapProfilerRunning,-uProfilerStart -Wl,-u_Z21InitialMallocHook_NewPKvj,-u_Z22InitialMallocHook_MMapPKvS0_jiiix,-u_Z22InitialMallocHook_SbrkPKvi -Wl,-u_Z21InitialMallocHook_NewPKvm,-u_Z22InitialMallocHook_MMapPKvS0_miiil,-u_Z22InitialMallocHook_SbrkPKvl -Wl,-u_ZN15HeapLeakChecker12IgnoreObjectEPKv,-u_ZN15HeapLeakChecker14UnIgnoreObjectEPKv -target arm-linux-gnueabihf --sysroot=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot -L/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/lib/arm-linux-gnueabihf -L/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link=/home/devel/workspace/cef3/chromium/src/chrome/installer/linux/debian_wheezy_arm-sysroot/usr/lib/arm-linux-gnueabihf -Wl,-O1 -Wl,--as-needed -Wl,--gc-sections -o lib/libcef.so -Wl,-soname=libcef.so @lib/libcef.so.rsp && { readelf -d lib/libcef.so | grep SONAME ; nm -gD -f p lib/libcef.so | cut -f1-2 -d' '; } > lib/libcef.so.tmp && if ! cmp -s lib/libcef.so.tmp lib/libcef.so.TOC; then mv lib/libcef.so.tmp lib/libcef.so.TOC ; fi; fi
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.browser_main.o):../../cef/libcef/browser/browser_main.cc:function CefBrowserMainParts::ToolkitInitialized(): error: undefined reference to 'aura::Env::GetInstance()'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.browser_main.o):../../cef/libcef/browser/browser_main.cc:function CefBrowserMainParts::PostDestroyThreads(): error: undefined reference to 'aura::Env::DeleteInstance()'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.chrome_scheme_handler.o):../../cef/libcef/browser/chrome_scheme_handler.cc:function scheme::(anonymous namespace)::ChromeProtocolHandlerWrapper::MaybeCreateJob(net::URLRequest*, net::NetworkDelegate*) const: error: undefined reference to 'content::ViewHttpCacheJobFactory::IsSupportedURL(GURL const&)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.chrome_scheme_handler.o):../../cef/libcef/browser/chrome_scheme_handler.cc:function scheme::(anonymous namespace)::ChromeProtocolHandlerWrapper::MaybeCreateJob(net::URLRequest*, net::NetworkDelegate*) const: error: undefined reference to 'content::ViewBlobInternalsJobFactory::IsSupportedURL(GURL const&)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.content_browser_client.o):../../cef/libcef/browser/content_browser_client.cc:function CefContentBrowserClient::DidCreatePpapiPlugin(content::BrowserPpapiHost*): error: undefined reference to 'ppapi::host::PpapiHost::AddHostFactoryFilter(scoped_ptr<ppapi::host::HostFactory, base::DefaultDeleter<ppapi::host::HostFactory> >)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.cookie_manager_impl.o):../../cef/libcef/browser/cookie_manager_impl.cc:function CefCookieManagerImpl::SetStoragePath(CefStringBase<CefStringTraitsUTF16> const&, bool, CefRefPtr<CefCompletionCallback>): error: undefined reference to 'net::SQLitePersistentCookieStore::SQLitePersistentCookieStore(base::FilePath const&, scoped_refptr<base::SequencedTaskRunner> const&, scoped_refptr<base::SequencedTaskRunner> const&, bool, net::CookieCryptoDelegate*)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.devtools_scheme_handler.o):../../cef/libcef/browser/devtools_scheme_handler.cc:function scheme::(anonymous namespace)::Delegate::OnRequest(CefRefPtr<CefBrowser>, CefRefPtr<CefRequest>, scheme::InternalHandlerDelegate::Action*): error: undefined reference to 'kDevtoolsResourcesSize'
obj/cef/libcef_static.a(obj/cef/libcef/browser/libcef_static.devtools_scheme_handler.o):../../cef/libcef/browser/devtools_scheme_handler.cc:function scheme::(anonymous namespace)::Delegate::OnRequest(CefRefPtr<CefBrowser>, CefRefPtr<CefRequest>, scheme::InternalHandlerDelegate::Action*): error: undefined reference to 'kDevtoolsResources'
obj/cef/libcef_static.a(obj/cef/libcef/browser/pepper/libcef_static.browser_pepper_host_factory.o):../../cef/libcef/browser/pepper/browser_pepper_host_factory.cc:function CefBrowserPepperHostFactory::CreateResourceHost(ppapi::host::PpapiHost*, int, int, IPC::Message const&): error: undefined reference to 'ppapi::host::MessageFilterHost::MessageFilterHost(ppapi::host::PpapiHost*, int, int, scoped_refptr<ppapi::host::ResourceMessageFilter> const&)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/pepper/libcef_static.browser_pepper_host_factory.o):../../cef/libcef/browser/pepper/browser_pepper_host_factory.cc:function CefBrowserPepperHostFactory::CreateResourceHost(ppapi::host::PpapiHost*, int, int, IPC::Message const&): error: undefined reference to 'ppapi::host::internal::ResourceMessageFilterDeleteTraits::Destruct(ppapi::host::ResourceMessageFilter const*)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/pepper/libcef_static.pepper_flash_browser_host.o):../../cef/libcef/browser/pepper/pepper_flash_browser_host.cc:function PepperFlashBrowserHost::PepperFlashBrowserHost(content::BrowserPpapiHost*, int, int): error: undefined reference to 'ppapi::host::ResourceHost::ResourceHost(ppapi::host::PpapiHost*, int, int)'
obj/cef/libcef_static.a(obj/cef/libcef/browser/pepper/libcef_static.pepper_flash_browser_host.o)(.text._ZN22PepperFlashBrowserHostD2Ev+0x0): error: undefined reference to 'ppapi::host::ResourceHost::~ResourceHost()'
obj/cef/libcef_static.a(obj/cef/libcef/browser/pepper/libcef_static.pepper_flash_browser_host.o):../../cef/libcef/browser/pepper/pepper_flash_browser_host.cc:function PepperFlashBrowserHost::~PepperFlashBrowserHost(): error: undefined reference to 'ppapi::host::ResourceHost::~ResourceHost()'
...
obj/components/libprinting_common.a(obj/components/printing/common/printing_common.print_messages.o):../../components/printing/common/print_messages.cc:function IPC::ParamTraits<PrintMsg_Print_Params>::Read(IPC::Message const*, base::PickleIterator*, PrintMsg_Print_Params*): error: undefined reference to 'IPC::ParamTraits<gfx::Size>::Read(IPC::Message const*, base::PickleIterator*, gfx::Size*)'
obj/components/libprinting_common.a(obj/components/printing/common/printing_common.print_messages.o):../../components/printing/common/print_messages.cc:function IPC::ParamTraits<PrintMsg_Print_Params>::Read(IPC::Message const*, base::PickleIterator*, PrintMsg_Print_Params*): error: undefined reference to 'IPC::ParamTraits<gfx::Size>::Read(IPC::Message const*, base::PickleIterator*, gfx::Size*)'
obj/components/libprinting_common.a(obj/components/printing/common/printing_common.print_messages.o):../../components/printing/common/print_messages.cc:function IPC::ParamTraits<PrintMsg_Print_Params>::Read(IPC::Message const*, base::PickleIterator*, PrintMsg_Print_Params*): error: undefined reference to 'IPC::ParamTraits<gfx::Rect>::Read(IPC::Message const*, base::PickleIterator*, gfx::Rect*)'
obj/components/libprinting_common.a(obj/components/printing/common/printing_common.print_messages.o):../../components/printing/common/print_messages.cc:function IPC::ParamTraits<PrintHostMsg_DidPrintPage_Params>::Read(IPC::Message const*, base::PickleIterator*, PrintHostMsg_DidPrintPage_Params*): error: undefined reference to 'IPC::ParamTraits<gfx::Size>::Read(IPC::Message const*, base::PickleIterator*, gfx::Size*)'
obj/components/libprinting_common.a(obj/components/printing/common/printing_common.print_messages.o):../../components/printing/common/print_messages.cc:function IPC::ParamTraits<PrintHostMsg_DidPrintPage_Params>::Read(IPC::Message const*, base::PickleIterator*, PrintHostMsg_DidPrintPage_Params*): error: undefined reference to 'IPC::ParamTraits<gfx::Rect>::Read(IPC::Message const*, base::PickleIterator*, gfx::Rect*)'
obj/components/libprinting_common.a(obj/components/printing/common/printing_common.print_messages.o):../../components/printing/common/print_messages.cc:function IPC::ParamTraits<base::Tuple<printing::PageSizeMargins const&, gfx::Rect const&, bool const&> >::Write(IPC::Message*, base::Tuple<printing::PageSizeMargins const&, gfx::Rect const&, bool const&> const&): error: undefined reference to 'IPC::ParamTraits<gfx::Rect>::Write(IPC::Message*, gfx::Rect const&)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[39/111] CXX obj/cef/libcef_dll/cpptoc/libcef_dll_wrapper.web_plugin_unstable_callback_cpptoc.o
ninja: build stopped: subcommand failed.


The attached file contains the complete error output.

I'm not familiar with ninja and clang.
Is it possible, that same gyp files need to be patched?
In the out/Release/obj/.. the object files from the missing references are there.

The strage thing is that the x64 build works fine.
I would be truly grateful about any tips. :roll:
Attachments
libcef_linker_error.txt
(94.7 KiB) Downloaded 546 times
JonnyX
Newbie
 
Posts: 3
Joined: Thu Jun 25, 2015 2:38 am

Re: cross compiling arm: Atomic operations not supported

Postby crast » Tue Jun 30, 2015 4:53 am

Try this
GYP_DEFINES=target_arch=arm arm_float_abi=hard
crast
Techie
 
Posts: 15
Joined: Tue Sep 23, 2014 2:30 am

Re: cross compiling arm: Atomic operations not supported

Postby JonnyX » Wed Jul 01, 2015 3:31 pm

Thanks a lot! :D :D :D

Now it compiles and can be executed on arm.
JonnyX
Newbie
 
Posts: 3
Joined: Thu Jun 25, 2015 2:38 am

Re: cross compiling arm: Atomic operations not supported

Postby ashutoshd » Fri Aug 21, 2015 8:40 am

I am also trying to cross compile CEF for ARM platform.

I read your posts and it looks that you were already using "target_arch=arm arm_float_abi=hard" configuration.
What change you made to get rid of compilation errors?
Did you drop "component=shared_library" instead?
ashutoshd
Newbie
 
Posts: 5
Joined: Thu Aug 20, 2015 2:10 am

Re: cross compiling arm: Atomic operations not supported

Postby magreenblatt » Fri Sep 09, 2016 2:15 pm

magreenblatt
Site Admin
 
Posts: 12406
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 47 guests