Following compilation errors occur when building the tests with userspace headers exported from kernel 4.4: binder_common.c:111:14: error: ‘const struct flat_binder_object’ has no member named ‘hdr’ switch (obj->hdr.type) { ^ client.c:58:9: error: dereferencing pointer to incomplete type if (obj->hdr.type != BINDER_TYPE_FD) { ^ It's been checked that member `hdr` of `struct flat_binder_object` and `struct binder_fd_object` were both introduced into kernel 4.11 by the same commit feba3900cabb ("binder: Split flat_binder_object"). Change the check to <linux/android/binder.h> before building binder tests to see if it contains the definition of `struct binder_fd_object`. Signed-off-by: GONG, Ruiqi <gongruiqi1@xxxxxxxxxx> --- tests/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 3f7cae3..273eed8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -53,9 +53,11 @@ ifeq ($(shell grep -q getrlimit $(POLDEV)/include/support/all_perms.spt && echo SUBDIRS += prlimit endif -ifeq ($(shell grep -q binder $(POLDEV)/include/support/all_perms.spt && test -e $(INCLUDEDIR)/linux/android/binder.h && echo true),true) +ifeq ($(shell grep -q binder $(POLDEV)/include/support/all_perms.spt && echo true),true) +ifeq ($(shell grep -q 'struct binder_fd_object' $(INCLUDEDIR)/linux/android/binder.h && echo true),true) SUBDIRS += binder endif +endif ifeq ($(shell grep -q bpf $(POLDEV)/include/support/all_perms.spt && echo true),true) ifneq ($(shell ./kvercmp $$(uname -r) 4.15),-1) -- 2.18.0.huawei.25