From: Masami Hiramatsu <mhiramat@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: Micah Morton <mortonm@chromium.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
jaswinder.singh@linaro.org
Subject: [BUGFIX PATCH v2 1/3] selftests: safesetid: Move link library to LDLIBS
Date: Thu, 5 Dec 2019 21:20:58 +0900 [thread overview]
Message-ID: <157554845808.11018.11000592632669206853.stgit@devnote2> (raw)
In-Reply-To: <157554844882.11018.13436399905210284553.stgit@devnote2>
Move -lcap to LDLIBS from CFLAGS because it is a library
to be linked.
Without this, safesetid failed to build with link error
as below.
----
/usr/bin/ld: /tmp/ccL8rZHT.o: in function `drop_caps':
safesetid-test.c:(.text+0xe7): undefined reference to `cap_get_proc'
/usr/bin/ld: safesetid-test.c:(.text+0x107): undefined reference to `cap_set_flag'
/usr/bin/ld: safesetid-test.c:(.text+0x10f): undefined reference to `cap_set_proc'
/usr/bin/ld: safesetid-test.c:(.text+0x117): undefined reference to `cap_free'
/usr/bin/ld: safesetid-test.c:(.text+0x136): undefined reference to `cap_clear'
collect2: error: ld returned 1 exit status
----
Fixes: c67e8ec03f3f ("LSM: SafeSetID: add selftest")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
tools/testing/selftests/safesetid/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/safesetid/Makefile b/tools/testing/selftests/safesetid/Makefile
index 98da7a504737..cac42cd36a1b 100644
--- a/tools/testing/selftests/safesetid/Makefile
+++ b/tools/testing/selftests/safesetid/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for mount selftests.
-CFLAGS = -Wall -lcap -O2
+CFLAGS = -Wall -O2
+LDLIBS = -lcap
TEST_PROGS := run_tests.sh
TEST_GEN_FILES := safesetid-test
next prev parent reply other threads:[~2019-12-05 12:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-05 12:20 [BUGFIX PATCH v2 0/3] selftests: safesetid: Fix some bugs in safesetid test Masami Hiramatsu
2019-12-05 12:20 ` Masami Hiramatsu [this message]
2019-12-05 12:21 ` [BUGFIX PATCH v2 2/3] selftests: safesetid: Check the return value of setuid/setgid Masami Hiramatsu
2019-12-05 12:21 ` [BUGFIX PATCH v2 3/3] selftests: safesetid: Fix Makefile to set correct test program Masami Hiramatsu
2019-12-05 16:40 ` [BUGFIX PATCH v2 0/3] selftests: safesetid: Fix some bugs in safesetid test Micah Morton
2019-12-05 16:44 ` shuah
2019-12-06 1:23 ` Masami Hiramatsu
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=157554845808.11018.11000592632669206853.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=jaswinder.singh@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mortonm@chromium.org \
--cc=shuah@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox