Message ID | 20250115145409.312226-1-mic@digikod.net (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | [v1] selftests/landlock: Fix build with non-default pthread linking | expand |
On Wed, Jan 15, 2025 at 03:54:07PM +0100, Mickaël Salaün wrote: > Old toolchains require explicit -lpthread (e.g. on Debian 11). > > Cc: Günther Noack <gnoack@google.com> > Cc: Nathan Chancellor <nathan@kernel.org> > Cc: Tahera Fahimi <fahimitahera@gmail.com> > Fixes: c8994965013e ("selftests/landlock: Test signal scoping for threads") > Signed-off-by: Mickaël Salaün <mic@digikod.net> > --- > tools/testing/selftests/landlock/Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile > index 348e2dbdb4e0..480f13e77fcc 100644 > --- a/tools/testing/selftests/landlock/Makefile > +++ b/tools/testing/selftests/landlock/Makefile > @@ -13,11 +13,11 @@ TEST_GEN_PROGS := $(src_test:.c=) > TEST_GEN_PROGS_EXTENDED := true > > # Short targets: > -$(TEST_GEN_PROGS): LDLIBS += -lcap > +$(TEST_GEN_PROGS): LDLIBS += -lcap -lpthread > $(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static > > include ../lib.mk > > # Targets with $(OUTPUT)/ prefix: > -$(TEST_GEN_PROGS): LDLIBS += -lcap > +$(TEST_GEN_PROGS): LDLIBS += -lcap -lpthread > $(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static > -- > 2.48.1 > Reviewed-by: Günther Noack <gnoack3000@gmail.com>
diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile index 348e2dbdb4e0..480f13e77fcc 100644 --- a/tools/testing/selftests/landlock/Makefile +++ b/tools/testing/selftests/landlock/Makefile @@ -13,11 +13,11 @@ TEST_GEN_PROGS := $(src_test:.c=) TEST_GEN_PROGS_EXTENDED := true # Short targets: -$(TEST_GEN_PROGS): LDLIBS += -lcap +$(TEST_GEN_PROGS): LDLIBS += -lcap -lpthread $(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static include ../lib.mk # Targets with $(OUTPUT)/ prefix: -$(TEST_GEN_PROGS): LDLIBS += -lcap +$(TEST_GEN_PROGS): LDLIBS += -lcap -lpthread $(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static
Old toolchains require explicit -lpthread (e.g. on Debian 11). Cc: Günther Noack <gnoack@google.com> Cc: Nathan Chancellor <nathan@kernel.org> Cc: Tahera Fahimi <fahimitahera@gmail.com> Fixes: c8994965013e ("selftests/landlock: Test signal scoping for threads") Signed-off-by: Mickaël Salaün <mic@digikod.net> --- tools/testing/selftests/landlock/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)