Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1070210ybh; Thu, 16 Jul 2020 02:13:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEqY0U2e20a8eepqMJGj7qRs2r5CMG9+ZSOWvuu2Sv7sqbhNhXE0btnktmOkEg2mUB8w7w X-Received: by 2002:a17:906:1394:: with SMTP id f20mr2902108ejc.114.1594890809027; Thu, 16 Jul 2020 02:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594890809; cv=none; d=google.com; s=arc-20160816; b=QyE3Fv/ql1kipS94NEKApeu9QOUsZHPfrrib9mqRQBtNw9n2z/STIsHJM1pzYlaS3R nY5S/cYElv2x+PrDEqDL8IhFeh2FkkHu7CAgxXEYCHJ5VhKQseIefhxm3bH+rF89494X NCTbe+3CX47sUwaL6lPo/cqaP3raUc8axI65NP4mD3j5nRBrlOlUrJCBOVbUFmk1ENoE mUWJx6UPi1215EN7G7eyZ5guSV2S7swyTEDWi5JkcrJuCRe7GhQKnRAnAWlKx3xRJvTp 4Wxm7I8HDbnCkQuRKQUmCgZA6JTThgiWXESH7GHlKw9OjufhNqzoiTw7rH3qtUWAcXxU 0qoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=i3qUrWfI30L6Li+KMjgbJDMdK2ZHLmpgUjZKooMO4pQ=; b=D8P7RPnsNgxeId6uZ621aP9AztweGUNvOfVbs9PUIlfC8VMc7v0LbX5BE5Isu8tldS E05Ujd2w1D+v03HqBgcodIkOSoc/ZW264O0TrYtbyw43W1d9FkxwLwdZSaERDbf8utBH 2ueJh99gqUvVPgTlEyGyn+HMnbh1vnnE7F5SuHBmqBL4Ew07spbRzUpAFqM0TSY0xP6I hSOZX0IdEkWoQZmWC6Y9LrOzDQFe6euo/2HML2t+jeu0tRDBdFNuk1tEeBzDGefVzYLR A0jFWpFjqEgma9Eii+VihBFElmkUbUqi3lclNpWjUmrLBOUKsthmQ9BwoFUd07Xw3cy9 1DYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si2965742edd.139.2020.07.16.02.13.06; Thu, 16 Jul 2020 02:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726075AbgGPJKv (ORCPT + 99 others); Thu, 16 Jul 2020 05:10:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbgGPJKv (ORCPT ); Thu, 16 Jul 2020 05:10:51 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 572F6C061755 for ; Thu, 16 Jul 2020 02:10:51 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jvzuV-005dVk-Ii; Thu, 16 Jul 2020 11:10:35 +0200 Message-ID: <159691324719ca79fbb8c206da527fc1f2bbc1ed.camel@sipsolutions.net> Subject: Re: [PATCH v3 3/3] um: allow static linking for non-glibc implementations From: Johannes Berg To: Ignat Korchagin , jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, brendanhiggins@google.com, masahiroy@kernel.org, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel-team@cloudflare.com Date: Thu, 16 Jul 2020 11:10:19 +0200 In-Reply-To: <20200715201159.54166-4-ignat@cloudflare.com> References: <20200715201159.54166-1-ignat@cloudflare.com> <20200715201159.54166-4-ignat@cloudflare.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-07-15 at 21:11 +0100, Ignat Korchagin wrote: > It is possible to produce a statically linked UML binary with UML_NET_VECTOR, > UML_NET_VDE and UML_NET_PCAP options enabled using alternative libc > implementations, which do not rely on NSS, such as musl. > > Allow static linking in this case. > > Signed-off-by: Ignat Korchagin > Reviewed-by: Brendan Higgins > Tested-by: Brendan Higgins > --- > arch/um/Kconfig | 5 +---- > arch/um/drivers/Kconfig | 3 --- > 2 files changed, 1 insertion(+), 7 deletions(-) > > diff --git a/arch/um/Kconfig b/arch/um/Kconfig > index 9318dc6d1a0c..beb98b3b9f75 100644 > --- a/arch/um/Kconfig > +++ b/arch/um/Kconfig > @@ -62,12 +62,9 @@ config NR_CPUS > > source "arch/$(HEADER_ARCH)/um/Kconfig" > > -config FORBID_STATIC_LINK > - bool > - > config STATIC_LINK > bool "Force a static link" > - depends on !FORBID_STATIC_LINK > + depends on CC_CAN_LINK_STATIC_NO_RUNTIME_DEPS || (!UML_NET_VECTOR && !UML_NET_VDE && !UML_NET_PCAP) Come to think of it, in a way "FORBID_STATIC_LINK" was nicer because there didn't need to be a single list of "what has dynamic dependencies" like here the list of UML_NET_VECTOR, UML_NET_VDE, UML_NET_PCAP. Maybe it could be config MAY_HAVE_NON_STATIC_RUNTIME_DEPS bool config STATIC_LINK ... depends on !MAY_HAVE_NON_STATIC_RUNTIME_DEPS || CC_CAN_LINK_STATIC_NO_RUNTIME_DEPS and then UML_NET_VECTOR et al can select MAY_HAVE_NON_STATIC_RUNTIME_DEPS so that the knowledge is still distributed to the corresponding options? johannes