Compile error when building for Android on Chromium 40?

119 views
Skip to first unread message

Peter Pettersson

unread,
Dec 9, 2014, 11:27:53 AM12/9/14
to dmp...@chromium.org
Hello,

Last time I used dmprof was on some time around Chromium 37-39 and then it worked well. But I just tried to build it with the latest Chromium and now it gives me a compile error that I'm guessing is related to a new NDK version.

I was following the build instructions on http://www.chromium.org/developers/deep-memory-profiler , are they still up to date?

My gyp configuration:

OS=android profiling=1 profiling_full_stack_frames=1 linux_dump_symbols=1 use_allocator="tcmalloc"

Ninja output:

peterp@peterp-ubuntu:/path/to/src$ ninja -C out/Release content_shell_apk
ninja: Entering directory `out/Release'
[19/9957] CXX obj/third_party/tcmalloc/chromium/src/allocator.profiler.o
FAILED: /path/to/src/third_party/android_tools/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -MMD -MF obj/third_party/tcmalloc/chromium/src/allocator.profiler.o.d -DV8_DEPRECATION_WARNINGS -D_FILE_OFFSET_BITS=64 -DDISABLE_NACL -DCHROMIUM_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_PROFILING=1 -DENABLE_WEBRTC=1 -DUSE_PROPRIETARY_CODECS -DENABLE_BROWSER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DENABLE_AUTOFILL_DIALOG=1 -DCLD_VERSION=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_SUPERVISED_USERS=1 -DVIDEO_HOLE=1 -DENABLE_LOAD_COMPLETION_HACKS=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DNO_HEAP_CHECK -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -DANDROID -D__GNU_SOURCE=1 -DUSE_STLPORT=1 -D_STLP_USE_PTR_SPECIALIZATIONS=1 '-DCHROME_BUILD_ID=""' -DHAVE_SYS_UIO_H -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -Igen -I../../base/allocator -I../../third_party/tcmalloc/chromium/src/base -I../../third_party/tcmalloc/chromium/src -I../.. -fstack-protector --param=ssp-buffer-size=4 -fno-strict-aliasing -Wno-unused-parameter -Wno-missing-field-initializers -pipe -fPIC -g -Wno-unused-local-typedefs -Wno-sign-compare -Wno-unused-result -Wno-format -march=armv7-a -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -mthumb -fno-tree-sra -fno-caller-saves -Wno-psabi -mthumb-interwork -marm -mapcs-frame -fno-optimize-sibling-calls -ffunction-sections -funwind-tables -g -fstack-protector -fno-short-enums -finline-limit=64 -Wa,--noexecstack --sysroot=/path/to/src/third_party/android_tools/ndk//platforms/android-14/arch-arm -isystem/path/to/src/third_party/android_tools/ndk//sources/cxx-stl/stlport/stlport -Os -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g -fno-inline -fno-optimize-sibling-calls -funwind-tables -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-deprecated -Wno-abi -std=gnu++11 -Wno-narrowing -Wno-literal-suffix  -c ../../third_party/tcmalloc/chromium/src/profiler.cc -o obj/third_party/tcmalloc/chromium/src/allocator.profiler.o
In file included from /path/to/src/third_party/android_tools/ndk/platforms/android-14/arch-arm/usr/include/signal.h:42:0,
                 from /path/to/src/third_party/android_tools/ndk/sources/cxx-stl/stlport/stlport/signal.h:28,
                 from ../../third_party/tcmalloc/chromium/src/profiler.cc:38:
/path/to/src/third_party/android_tools/ndk/platforms/android-14/arch-arm/usr/include/sys/ucontext.h:77:3: error: conflicting declaration 'typedef struct ucontext ucontext_t'
 } ucontext_t;
   ^
In file included from ../../third_party/tcmalloc/chromium/src/profiler.cc:37:0:
../../third_party/tcmalloc/chromium/src/getpc.h:178:32: note: previous declaration as 'typedef struct _Unwind_Context ucontext_t'
 typedef struct _Unwind_Context ucontext_t;
                                ^
[19/9957] CXX obj/third_party/webrtc/modules/gen/protoc_out/webrtc/audio_processing/audioproc_debug_proto.debug.pb.o
ninja: build stopped: subcommand failed.



Thankful for any help.


Regards,
Peter

Kui Zheng

unread,
Dec 19, 2014, 4:25:53 AM12/19/14
to dmp...@chromium.org
Hi, Same issue with commit 56fe65679b79312cb84b42d127bb8a84f79167d5 Date:   Thu Dec 18 22:33:46 2014 -0800. 
Do you know any workaround?

Seems some thing wrong when compiling tcmalloc, How about upgrading tcmalloc? So far, tcmalloc(Revision: 144) is too old to enabling dmprof on ARM64 (see Issue 423298).

JungJik

unread,
Dec 19, 2014, 5:03:45 AM12/19/14
to dmp...@chromium.org
Hi,

I was working on this issue.
afaik , it's because latest NDK L includes ucontext_t as different struct.
we want to use ucontext_t as Unwind_Context.
however unfortunately it is written by typedef. so we can not avoid or undef the typedef.
so I made a patch with namespace. maybe this would resolve this issue.
it is still checking...


2014년 12월 19일 금요일 오후 6시 25분 53초 UTC+9, Kui Zheng 님의 말:
Reply all
Reply to author
Forward
0 new messages