[CRIU] Android cross-compilation

Domenico Iezzi domenico.iezzi.201 at gmail.com
Thu Sep 21 00:04:00 MSK 2017


Hi everyone,

I want to ask you if it's possible to cross-compile criu for android 
(arm-linux-androideabi).

I am trying to cross-compile it with the android ndk, following the 
instructions both on the wiki and on github. For the ndk, I'm using the 
script 'make_standalone_toolchain.sh' inside the build/tools folder, 
which prepares an environment similar to the linaro toolchain, but the 
compilation results in some errors related to redefined or non-existant 
variables, like this:

   CC       compel/plugins/std/std.o
   CC       compel/plugins/std/fds.o
In file included from compel/plugins/std/fds.c:10:0:
include/common/compiler.h:25:0: error: "__section" redefined [-Werror]
  #define __section(S)  __attribute__ ((__section__(#S)))
  ^
In file included from /build/cross/sysroot/usr/include/errno.h:31:0,
                  from compel/plugins/std/fds.c:1:
/build/cross/sysroot/usr/include/sys/cdefs.h:209:0: note: this is the 
location of the previous definition
  #define __section(x) __attribute__((__section__(x)))
  ^
In file included from compel/plugins/std/fds.c:10:0:
include/common/compiler.h:42:0: error: "__aligned" redefined [-Werror]
  #define __aligned(x)  __attribute__((aligned(x)))
  ^
In file included from /build/cross/sysroot/usr/include/errno.h:31:0,
                  from compel/plugins/std/fds.c:1:
/build/cross/sysroot/usr/include/sys/cdefs.h:208:0: note: this is the 
location of the previous definition
  #define __aligned(x) __attribute__((__aligned__(x)))
  ^
cc1: all warnings being treated as errors
make[1]: *** [compel/plugins/std/fds.o] Error 1
make: *** [compel/plugins/std.lib.a] Error 2
make: *** Waiting for unfinished jobs....
   PBCC     images/autofs.pb-c.c

Can you point me in the right direction? Here [0] are the file I use to 
cross-compile.

Many thanks

Domenico Iezzi

[0] https://github.com/NoMore201/criu-android-build


More information about the CRIU mailing list