Skip to content

Commit 091873e

Browse files
committed
selftests/landlock: Build without static libraries
The only (forced) static test binary doesn't depend on libcap. Because using -lcap on systems that don't have such static library would fail (e.g. on Arch Linux), let's be more specific and require only dynamic libcap linking. Fixes: a525405 ("selftests/landlock: Fix out-of-tree builds") Cc: Anders Roxell <[email protected]> Cc: Guillaume Tucker <[email protected]> Cc: Mark Brown <[email protected]> Cc: Shuah Khan <[email protected]> Cc: [email protected] Signed-off-by: Mickaël Salaün <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 9abf231 commit 091873e

File tree

1 file changed

+4
-3
lines changed
  • tools/testing/selftests/landlock

1 file changed

+4
-3
lines changed

tools/testing/selftests/landlock/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# First run: make -C ../../../.. headers_install
44

55
CFLAGS += -Wall -O2 $(KHDR_INCLUDES)
6-
LDLIBS += -lcap
76

87
LOCAL_HDRS += common.h
98

@@ -13,10 +12,12 @@ TEST_GEN_PROGS := $(src_test:.c=)
1312

1413
TEST_GEN_PROGS_EXTENDED := true
1514

16-
# Static linking for short targets:
15+
# Short targets:
16+
$(TEST_GEN_PROGS): LDLIBS += -lcap
1717
$(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static
1818

1919
include ../lib.mk
2020

21-
# Static linking for targets with $(OUTPUT)/ prefix:
21+
# Targets with $(OUTPUT)/ prefix:
22+
$(TEST_GEN_PROGS): LDLIBS += -lcap
2223
$(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static

0 commit comments

Comments
 (0)