<div dir="ltr">Hi all,<div><br></div><div>In continue to posts from <a href="http://www.mail-archive.com/lttng-dev@lists.lttng.org/msg02542.html">http://www.mail-archive.com/lttng-dev@lists.lttng.org/msg02542.html</a>,<br>
<div><br></div><div>I'm trying to build the LTTng kernel-tracer for Android on ARM:</div><div>(JB4.2.1 - kernel 3.0.31 - on Galaxy Nexus).<br></div><div>I'm having some trouble completing the process, didn't find any usable information so far, maybe u can help.<br>
</div><div><br></div><div>I want to build the: (I've managed in the past to build the modules for goldfish's 2.6.29 but this required patching the kernel).</div><div>(1) userspace-rcu</div><div>(2) modules</div><div>
(3) tools</div><div>I'm currently stuck in the first phase (building userspace-rcu).</div>
<div><br></div><div>My steps and the issues I've encountered are:</div><div>1. Clone the userspace-rcu git repository</div><div>2. Generate a sysroot for arm-linux-androideabi from google's NDK (using its "make-standalone-toolchain.sh" script with arm-linux-androideabi-4.4.3 toolchain).</div>
<div>3. Run ./bootstrap - creating <a href="http://config.h.in" target="_blank">config.h.in</a>, Makefile.in, configure, ...<br></div><div>4. Run ./configure with --host=arm-linux-androideabi and the relevant environment variables (CC, LD, CPPFLAGS, CFLAGS, LDFLAGS, LIB), pointing to the NDK ARM SYSROOT.</div>
<div style>5. Run make</div><div style><br></div><div style>Some errors I encoutered and their fixes (workarounds), while trying as much as I can leave the sources untouched:</div><div style>1. syscall.h not found. In some files, the <syscall.h> is included. In NDK SYSROOT the syscall.h lays in sys/</div>
<div style>FIX: created a link: SYSROOT/include/syscall.h -> SYSROOT/include/sys/syscall.h</div><div style>2. Android's libraries includes the pthread lib automatically, thus not having a stand-alone pthread library.</div>
<div style>FIX: removed "-lpthread" from Makefile.am, tests/Makefile.am</div><div style>3. static declaration of "gettid" follows non-static declaration (in SYSROOT/include/unistd.h, "gettid" is declared as "external")<br>
</div><div style>For the mean time I commented this declaration... Maybe adding "#ifndef gettid" before the declaration of "static gettid" in the sources will fix it ?</div><div style>4. rand_r not declared - added a module that implements rand_r (as seen in <a href="https://github.com/xbmc/xbmc/tree/master/xbmc/android/bionic_supplement">https://github.com/xbmc/xbmc/tree/master/xbmc/android/bionic_supplement</a>)</div>
<div style>5. undefined reference to rpl_malloc<br></div><div style>FIX: setting ac_cv_func_malloc_0_nonnull=yes before launching ./configure.</div><div style><br></div><div style>now, after running ./configure and make, still not completed. I get many "undefined reference to __sync_syncronize" messages. the urcu/arch/generic.h defines the memory barriers functions as cmm_* but their implementation is not taken from urcu/arch/arm.h but from Line 46 in the same file (generic.h).</div>
<div style>Can u help with this?</div><div style>Am I missing something here ?</div><div style><br></div><div style>Also, how does the build system use the kernel 3.0.31 (or any other) sysroot ?<br></div><div><br></div><div style>
Thank you</div></div><div style><br></div><div style>Amit.</div></div>