Multiple definition of malloc while compiling on ARM

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.

Multiple definition of malloc while compiling on ARM

Postby danwickstrom » Mon Mar 04, 2013 2:10 pm

I've successfully compiled chrome for ARM using a panda board (cortex-a9, OMAP 4430) image as the target, and now I'm trying to compile cefclient, and I'm running into an error for multiple definition of 'malloc' while linking:

CXX(target) out/Release/obj.target/libcef/cef/libcef_dll/ctocpp/write_handler_ctocpp.o
CXX(target) out/Release/obj.target/libcef/cef/libcef_dll/cpptoc/xml_reader_cpptoc.o
CXX(target) out/Release/obj.target/libcef/cef/libcef_dll/cpptoc/zip_reader_cpptoc.o
SOLINK(target) out/Release/obj.target/cef/libcef.so
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'malloc'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'realloc'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'calloc'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'memalign'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'valloc'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'pvalloc'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: out/Release/obj.target/base/allocator/liballocator.a(out/Release/obj.target/base/allocator/../../allocator/base/allocator/debugallocation_shim.o): multiple definition of 'posix_memalign'
out/Release/../../third_party/gold/gold64: out/Release/obj.target/base/libbase.a(out/Release/obj.target/base/base/process_util_linux.o): previous definition here
out/Release/../../third_party/gold/gold64: error: cannot open /home/dan/qemu-arm/panda/usr/lib/arm-linux-gnueabihf/libcom_err.so: No such file or directory
collect2: ld returned 1 exit status
make: *** [out/Release/obj.target/cef/libcef.so] Error 1

I'm bulding the Release target, and my include.gypi settings are as follows:
{
'target_defaults': {
'target_conditions': [
['_toolset=="target"', {

'cflags+': [ '-mfloat-abi=hard', ], # '-Wa,-mimplicit-it=thumb'
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': [],
}],
],
},
'variables': {
'target_arch': 'arm',
'sysroot': '/home/dan/qemu-arm/panda',
'linux_use_tcmalloc': 0, # tcmalloc does not build for ARM.
'armv7': 1, # Optional, for targeting ARMv7.
'arm_thumb': 1, # Optional, for targetting thumb. Combine with armv7 to target thumb2.
'arm_neon': 1, # Optional, to disable NEON. 1 is the default, and most people want to keep it that way.
'arm_fpu': 'vfpv3-d16', # Optional, to select which version of vfp to use if NEON is off. Default is vfpv3.
}
}

It seems like this problem might be caused by tcmalloc being compiled in even though I have linux_use_tcmalloc set to false in my .gypi settings.

Note: I didn't see this problem when building chrome by itself using this same configuration.

Any advice on how to work to work around this would be appreciated.

Note, the host platform is ubuntu 12.04, x86_64, and the target is ubuntu 12.04 32-bit arm cortex-a9, and I'm using the gcc arm-linux-eabihf tools for cross-compiling, and I'm trying to build cefclient cef3 version 1364.

Thanks,

Dan
danwickstrom
Newbie
 
Posts: 2
Joined: Mon Mar 04, 2013 2:06 pm

Re: Multiple definition of malloc while compiling on ARM

Postby magreenblatt » Mon Mar 04, 2013 6:22 pm

You will likely need to audit cef.gyp to make sure it doesn't make any assumptions unfriendly to ARM builds. You can loosely compare to content/content_shell.gypi and chrome/chrome_browser.gypi. Patches to make CEF compile on ARM are welcome but there are no plans at this time to actively support building on ARM platforms.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Multiple definition of malloc while compiling on ARM

Postby danwickstrom » Tue Mar 05, 2013 10:07 am

It appears that the problem is caused by liballocator.a getting included in the build for cefclient, but not in the build for chrome. cef.gyp includes allocator.gyp, but it is excluded by content_shell.gypi if linux_use_tcmalloc = 0. I will try some test builds to see if I can come up with a patch.
danwickstrom
Newbie
 
Posts: 2
Joined: Mon Mar 04, 2013 2:06 pm

Re: Multiple definition of malloc while compiling on ARM

Postby Dublanc » Thu Mar 07, 2013 9:16 am

In cef.gyp : Please take a look at this line : [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
'dependencies':[
<(DEPTH)/base/allocator/allocator.gyp:allocator',

Add a test for linux_use_tcmalloc here to elimate the allocator for arm compile.

I managed to compile for ARM but the resulting cefclient does not run on ARM. If you get any further let me know.
Dublanc
Mentor
 
Posts: 53
Joined: Thu Mar 29, 2012 4:22 am

Re: Multiple definition of malloc while compiling on ARM

Postby tsuckow » Thu Jun 13, 2013 12:31 am

I have been trying to compile on the Raspberry Pi. I am currently stuck at a Floating Point related linker issue "VFP register arguments, output does not". That is one of many possible reasons it may have compiled but not run if you crosscompiled(Hell of a lot faster if you can get it to work).
tsuckow
Newbie
 
Posts: 3
Joined: Sat May 25, 2013 9:01 pm

Re: Multiple definition of malloc while compiling on ARM

Postby shivg » Fri Dec 13, 2013 12:34 am

Dublanc wrote:I managed to compile for ARM but the resulting cefclient does not run on ARM. If you get any further let me know.


Hi Dublanc,
Can u share config/file(s) that u used to compile for ARM target.
I want to compile CEF for armhf (OdroidU2, running debian jessy).
Thanx
shivg
Newbie
 
Posts: 3
Joined: Mon Nov 11, 2013 8:04 am

Re: Multiple definition of malloc while compiling on ARM

Postby mezl » Fri Feb 21, 2014 4:00 am

hi,
I would also trying to compile CEF on ARM Ubuntu in order to use WebGl stuff in the program.
Do you have any updates for Arm?
Thanks a lot.
shivg wrote:
Dublanc wrote:I managed to compile for ARM but the resulting cefclient does not run on ARM. If you get any further let me know.


Hi Dublanc,
Can u share config/file(s) that u used to compile for ARM target.
I want to compile CEF for armhf (OdroidU2, running debian jessy).
Thanx
mezl
Newbie
 
Posts: 1
Joined: Fri Feb 21, 2014 12:17 am

Re: Multiple definition of malloc while compiling on ARM

Postby ssnkumar » Sat Jun 14, 2014 12:30 pm

danwickstrom wrote:I've successfully compiled chrome for ARM using a panda board (cortex-a9, OMAP 4430) image as the target,
......
Thanks,
Dan


Hi,

I want to know, the steps you followed to build ChromimOs for PandaBoard.
Also, I want to know, how did you copy the ChromiumOs image to PandaBoard SD Card.

Regards,
Narendra
ssnkumar
Newbie
 
Posts: 1
Joined: Sat Jun 14, 2014 12:27 pm

Re: Multiple definition of malloc while compiling on ARM

Postby tleveque » Tue Aug 19, 2014 8:47 am

Hi all,

My company is looking for someone to build cef3 on armv9.
We would like to pay him to do it and then redistribute the whole code to cef.
Does anybody know someone who would be interested in the job ?

Thanks
PS: you could contact me on leveque.thomas@gmail.com
tleveque
Newbie
 
Posts: 2
Joined: Tue Aug 19, 2014 8:34 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 94 guests