From patchwork Wed Oct 19 20:05:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= X-Patchwork-Id: 5830 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp518223wrs; Wed, 19 Oct 2022 13:20:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6LirJwo2ybhLG5MSn1QCSQSG+XvRzwSxfWKBWthCvehNl1J/Jz+9buklE3fe5KcjXXCvz4 X-Received: by 2002:a17:906:cc5a:b0:78d:c3cf:6ff7 with SMTP id mm26-20020a170906cc5a00b0078dc3cf6ff7mr8219334ejb.383.1666210828417; Wed, 19 Oct 2022 13:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666210828; cv=none; d=google.com; s=arc-20160816; b=ZW59JD8N24n7TqR35Rj8NzXpJAeG0LoCxDJ5G4vEFkOCzDixI7gKjbbXF2IVPr/liG ZiU6buxFY0zSEX5hA57gtAyKRC1glAjnkh4FDM08bXbraf7K7GPNTvBZA75OjmAxYnxQ b/5V/Ml1v1tgnIFb24dp4oLR5jte9Za3QM1S5GmFhApfOkaSrvX+Qsh8mfTQMLzbI0Y+ 9lR0KcYb7VYbKEg4bUeRujOD+cVZXcScpEllpAfHB3QtyCw748tv7uvI21o/2SvLNAy1 aDR8NHT3Dqk/J0q8xSY46jJ0M7WD1OEq7TjyZ+fpN39m4Y2JB3CsL37vZQ/djkgv9C0s GYaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iFd7v0LZnK8woem0M1bTu4M67TvDhAPYCJ56JTjRS8E=; b=n8BYQGj74HBOYJo0sdjJarnLiFlwa1JsjYSXGYdraJCBflwoih4YMLWi3M62uTFxkQ 2cPkQJotKbi5fwECzNCGKUNkYu+PfhE+nDRZwVnfGZ9DeVWDDzZtvpepa1pLuPylxApN kFMcyKg156exKOvZPDsvFhM97hb3+me7ef1jjly4osyckfXjnf7RKI+qpLOM9WA9mm1y PjZfchbRTAPFoxpZoOO0a1cpwYgdjLBP1aturKdewJIwaAXUWnJOGklDj39eX4v3sMOa LfQaTUMFr2RmcoiGJhbkvl0BxJUuK090qxO5X+8JJezlOIOj/vOKRk+FpwdQPqNDcV8h y6Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=AoGSdmPF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id en16-20020a056402529000b00457166171c6si12789989edb.432.2022.10.19.13.19.39; Wed, 19 Oct 2022 13:20:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@digikod.net header.s=20191114 header.b=AoGSdmPF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231124AbiJSUGB (ORCPT + 99 others); Wed, 19 Oct 2022 16:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbiJSUF6 (ORCPT ); Wed, 19 Oct 2022 16:05:58 -0400 Received: from smtp-bc0e.mail.infomaniak.ch (smtp-bc0e.mail.infomaniak.ch [IPv6:2001:1600:4:17::bc0e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07EFC18BE20 for ; Wed, 19 Oct 2022 13:05:55 -0700 (PDT) Received: from smtp-3-0000.mail.infomaniak.ch (unknown [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Mt1v13XXkzMq4cH; Wed, 19 Oct 2022 22:05:49 +0200 (CEST) Received: from localhost (unknown [23.97.221.149]) by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4Mt1v06dk9zxH; Wed, 19 Oct 2022 22:05:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=digikod.net; s=20191114; t=1666209949; bh=dLhBf8o1kXqp6sscAfSz5LKvdc7yEb7Q8TYdJPkHjFU=; h=From:To:Cc:Subject:Date:From; b=AoGSdmPF2lFsibBkqhvB5eYH60CouLgJ8QYefj+ta77rUi4JMemlGJVAt8EPpPaCk P+tS6NSCCXlNSCOxMpSJa4uhMtesUp5+kVEmXqiUFqIhu0KYl9/3fEoekhY7JwKyEr r1uI/wobcxe+Eb9kYM0tZ2vS3YpOOh+RzjhTgB6U= From: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= To: Shuah Khan Cc: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , Anders Roxell , Guillaume Tucker , Mark Brown , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-security-module@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v1] selftests/landlock: Build without static libraries Date: Wed, 19 Oct 2022 22:05:36 +0200 Message-Id: <20221019200536.2771316-1-mic@digikod.net> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747148685760221052?= X-GMAIL-MSGID: =?utf-8?q?1747148685760221052?= 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: a52540522c95 ("selftests/landlock: Fix out-of-tree builds") Cc: Anders Roxell Cc: Guillaume Tucker Cc: Mark Brown Cc: Shuah Khan Cc: stable@vger.kernel.org Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20221019200536.2771316-1-mic@digikod.net --- tools/testing/selftests/landlock/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) base-commit: 9abf2313adc1ca1b6180c508c25f22f9395cc780 diff --git a/tools/testing/selftests/landlock/Makefile b/tools/testing/selftests/landlock/Makefile index 6632bfff486b..348e2dbdb4e0 100644 --- a/tools/testing/selftests/landlock/Makefile +++ b/tools/testing/selftests/landlock/Makefile @@ -3,7 +3,6 @@ # First run: make -C ../../../.. headers_install CFLAGS += -Wall -O2 $(KHDR_INCLUDES) -LDLIBS += -lcap LOCAL_HDRS += common.h @@ -13,10 +12,12 @@ TEST_GEN_PROGS := $(src_test:.c=) TEST_GEN_PROGS_EXTENDED := true -# Static linking for short targets: +# Short targets: +$(TEST_GEN_PROGS): LDLIBS += -lcap $(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static include ../lib.mk -# Static linking for targets with $(OUTPUT)/ prefix: +# Targets with $(OUTPUT)/ prefix: +$(TEST_GEN_PROGS): LDLIBS += -lcap $(TEST_GEN_PROGS_EXTENDED): LDFLAGS += -static