All of lore.kernel.org
 help / color / mirror / Atom feed
From: "GONG, Ruiqi" <gongruiqi1@huawei.com>
To: <selinux@vger.kernel.org>
Cc: Wang Weiyang <wangweiyang2@huawei.com>,
	Xiu Jianfeng <xiujianfeng@huawei.com>,
	Xiang Yang <xiangyang3@huawei.com>,
	Cui Gaosheng <cuigaosheng1@huawei.com>,
	Lu Jialin <lujialin4@huawei.com>, Yi Yang <yiyang13@huawei.com>,
	Gong Ruiqi <gongruiqi1@huawei.com>
Subject: [PATCH testsuite] tests/binder: Build only for 4.11 and later kernels
Date: Thu, 13 Jan 2022 02:09:15 +0000	[thread overview]
Message-ID: <20220113020915.13560-1-gongruiqi1@huawei.com> (raw)

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 by commit feba3900cabb
("binder: Split flat_binder_object") in kernel v4.11-rc1. Fix this
by adding kernel version check at compile time.

Signed-off-by: GONG, Ruiqi <gongruiqi1@huawei.com>
---
 tests/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/Makefile b/tests/Makefile
index 3f7cae3..22458a7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -54,8 +54,10 @@ SUBDIRS += prlimit
 endif
 
 ifeq ($(shell grep -q binder $(POLDEV)/include/support/all_perms.spt && test -e $(INCLUDEDIR)/linux/android/binder.h && echo true),true)
+ifneq ($(shell ./kvercmp $$(uname -r) 4.11),-1)
 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.17.1


             reply	other threads:[~2022-01-13  1:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-13  2:09 GONG, Ruiqi [this message]
2022-01-31 13:47 ` [PATCH testsuite] tests/binder: Build only for 4.11 and later kernels Ondrej Mosnacek
2022-02-09  6:58   ` Gong Ruiqi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220113020915.13560-1-gongruiqi1@huawei.com \
    --to=gongruiqi1@huawei.com \
    --cc=cuigaosheng1@huawei.com \
    --cc=lujialin4@huawei.com \
    --cc=selinux@vger.kernel.org \
    --cc=wangweiyang2@huawei.com \
    --cc=xiangyang3@huawei.com \
    --cc=xiujianfeng@huawei.com \
    --cc=yiyang13@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.