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