fix some build issues under Android NDK/Clang

Submitted by Zhang, Ning A on March 29, 2019, 5:45 a.m.

Details

Reviewer None
Submitted March 29, 2019, 5:45 a.m.
Last Updated March 29, 2019, 5:42 p.m.
Revision 1

Cover Letter

From: Zhang Ning <ning.a.zhang@intel.com>

Hi, All 

I'm trying to build criu under Android NDK, and meet some build issues.

some of them are fixed, and send patches for review. some of them haven't.

here is my build script:
https://gist.github.com/zhangn1985/366c591895766d1721dc1f674179d419
you need download code firstly, and modify tools.mk

- CC            := $(CROSS_COMPILE)$(HOSTCC)
+ CC            ?= $(CROSS_COMPILE)$(HOSTCC)

to support using Clang.

with below fix, I still get an issue, that related to linker.
I don't know how to fix.

here is build log:
x86_64-linux-android-ld  -L/home/ning/source/criu/protobuf-c/../target/lib -lprotobuf-c -r -z noexecstack -T ./compel/arch/x86/scripts/compel-pack.lds.S  -o criu/pie/parasite.built-in.o  criu/pie/parasite.o criu/pie/pie.lib.a ./compel/plugins/std.lib.a
./compel/compel-host hgen -f criu/pie/parasite.built-in.o -o criu/pie/parasite-blob.h
Error (compel/src/lib/handle-elf-host.c:335): Unexpected undefined symbol: `'. External symbol in PIE?
criu/pie/Makefile:49: recipe for target 'criu/pie/parasite-blob.h' failed

but when I re-run it using host ld (debian 9) instead of x86_64-linux-android-ld, no error reported.

could you help to review, and provide some help?


Zhang Ning (3):
  fix build issue under Android NDK
  fix build error under newer version Clang
  fix build error under Android NDK/Clang

 compel/arch/x86/src/lib/infect.c      | 1 +
 compel/include/uapi/sigframe-common.h | 2 +-
 criu/include/util-vdso.h              | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)
  

Revisions

Patches download mbox

Tests