Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1035641ybl; Fri, 24 Jan 2020 14:15:39 -0800 (PST) X-Google-Smtp-Source: APXvYqw4EkwnZaSnvV7Rm9O6nOMd2eQSpLEF1ZxVJwCTD7SxmxAQBrptz5Z/5cUsuolsjYiuKfo/ X-Received: by 2002:a9d:7f83:: with SMTP id t3mr4191180otp.115.1579904139762; Fri, 24 Jan 2020 14:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579904139; cv=none; d=google.com; s=arc-20160816; b=JcpCn+UW46xubZldnOwUhmIWy5U8VwcVrWz1RdJ30fnp/4Q2L2BXqHlRxJQKJGQb0q +dm8InnyZLPs7EUQO/GNtY/HiBMt0QPHdiUbxYjEOvcAVFJ2M6ZYPgcvXGkMjHFOMmk2 8WaRSXAXzhSSPuLmI6mX1u7c2Imp18YBJtu7DXqmVx2guakhYr4Texa8kJV7/KpVAKoC C6dW59VF6pLjm3l1UiuQiTd2maI/BvRJczjl5jv1TV4o7vIeLA9idYkNAjDVCgstt/7p 6a88Ommg3STEChgCKyQM5WKlfh3q/UtjUuFgPnvfZHXsxMriSTa0ijdXMBJ13gHKZTh7 pOXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=geC9hix2m9kGrQA1AgAiVyPdofDuegQV+sdp/6AkzSY=; b=VZPBicW9QFXowWAMlEpa6YKdfVfG+TQdkWTfFjdTjBOfgQjYhjLXS3hU+A0LV6iy2T UoLKVSm9cwTcMEKcQqtqU8huM9WScEDMJ8nVWNo5o4YXEQpkFlf3bPH4tSiYkQIwvPRV jA1w5IwzfezIC/0tiAVRJymGlaRUJHipn/WwajKWj6+a04sHx5Fmb8w2LMyyBYDaP0Ce W6u4/j2BMgOzpk1PKrxjyrg46+Tng1seHBsAVi6kULCadrB/Dd6tTk8xCb76wzCsDxaj hxV3pvIQAVsZb1N/Gqgt8rFJpXqAY+ODO4eFafPLVhxFA+Ms8Xw6vSThkl4VHCZam9kb z3Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iRRfETWs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si405580oii.57.2020.01.24.14.15.27; Fri, 24 Jan 2020 14:15:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iRRfETWs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbgAXWOI (ORCPT + 99 others); Fri, 24 Jan 2020 17:14:08 -0500 Received: from mail-pg1-f201.google.com ([209.85.215.201]:44958 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727590AbgAXWOI (ORCPT ); Fri, 24 Jan 2020 17:14:08 -0500 Received: by mail-pg1-f201.google.com with SMTP id o21so2184312pgm.11 for ; Fri, 24 Jan 2020 14:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=geC9hix2m9kGrQA1AgAiVyPdofDuegQV+sdp/6AkzSY=; b=iRRfETWsjhw5goUymtnni7SUDlPk6D3OkS7laA0F9rkl54bMDWiXkDJ7ERP1BIuaBB k6kbMx7VK4npLy4YL/S/gNA+fOiStTiTERkqqGsT1tGRgOEiIiILDVwFv/yZLXnlkfkl 5Y2MURsG+KtkoyhNxpcyV+CfIdagtezZOcSbUhuWpkiowJkTJgG0upIx34t57wnvQZtU eiKc9urpSafdnhhHqAumxMZR/YOZdeYnDvCGv9zjIFeu5jP4K5+jeb3M3zrcdTfNHjdo QrF0K6Bnh2WwqYbuHZ2OOe9xZzFknDtYnVZZqhaaHdJkC9fFLb7OZw6/cKVFQjd9/8Tt 42wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=geC9hix2m9kGrQA1AgAiVyPdofDuegQV+sdp/6AkzSY=; b=K2zdMm6Z7JHu2goGouWzi6wSdooLEKGOB5u6NbMJFlPhY9kRGW0G/iPa5l9t6EyLEX RbSjwdi3JlxLOdiTGIhFa/C2QaAJEaFlalsO3KRbT1PRUZMdmhgdlAvfjlTUeqxhHotd zduyis2lSd6raFYpkiSh6tbriXlfbmGGY+9vIYhiDtWUoUoolYF1P1wKxoCxNURIj5kO yduAJi7mQ0xXZ62+M624RsJG5SRFUAJYPE9YmaB6f6WWYkj7A5MKQdXlLWD9ZXVgNEnN 95TNACApaFSkydi/Grwc1HDDmYGHtyDZ88ydaEGJMY1RZWNIdzLIhBGCLY8rcl57VTMX b7NQ== X-Gm-Message-State: APjAAAVAMk5rEJ5Vq5umlzooNgze5vLeDVf4EB8JqWcTCXHNRq9M/ozI H2SOefTD56GZmwtp2/fV4cmGFKeYsiy2kSG7Kp+Yzw== X-Received: by 2002:a63:364f:: with SMTP id d76mr6652376pga.215.1579904047529; Fri, 24 Jan 2020 14:14:07 -0800 (PST) Date: Fri, 24 Jan 2020 14:14:01 -0800 Message-Id: <20200124221401.210449-1-brendanhiggins@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog Subject: [PATCH v3] uml: make CONFIG_STATIC_LINK actually static From: Brendan Higgins To: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, geert@linux-m68k.org, james_mcmechan@hotmail.com Cc: linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, davidgow@google.com, Brendan Higgins Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, CONFIG_STATIC_LINK can be enabled with options which cannot be statically linked, namely UML_NET_VECTOR, UML_NET_VDE, and UML_NET_PCAP; this is because glibc tries to load NSS which does not support being statically linked. So make CONFIG_STATIC_LINK depend on !UML_NET_VECTOR && !UML_NET_VDE && !UML_NET_PCAP. Link: https://lore.kernel.org/lkml/f658f317-be54-ed75-8296-c373c2dcc697@cambridgegreys.com/#t Signed-off-by: Brendan Higgins --- arch/um/Kconfig | 8 +++++++- arch/um/drivers/Kconfig | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 0917f8443c285..28d62151fb2ed 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig @@ -62,9 +62,12 @@ config NR_CPUS source "arch/$(HEADER_ARCH)/um/Kconfig" +config FORBID_STATIC_LINK + bool + config STATIC_LINK bool "Force a static link" - default n + depends on !FORBID_STATIC_LINK help This option gives you the ability to force a static link of UML. Normally, UML is linked as a shared binary. This is inconvenient for @@ -73,6 +76,9 @@ config STATIC_LINK Additionally, this option enables using higher memory spaces (up to 2.75G) for UML. + NOTE: This option is incompatible with some networking features which + depend on features that require being dynamically loaded (like NSS). + config LD_SCRIPT_STATIC bool default y diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig index 72d4170557820..9160ead56e33c 100644 --- a/arch/um/drivers/Kconfig +++ b/arch/um/drivers/Kconfig @@ -234,6 +234,7 @@ config UML_NET_DAEMON config UML_NET_VECTOR bool "Vector I/O high performance network devices" depends on UML_NET + select FORBID_STATIC_LINK help This User-Mode Linux network driver uses multi-message send and receive functions. The host running the UML guest must have @@ -245,6 +246,7 @@ config UML_NET_VECTOR config UML_NET_VDE bool "VDE transport (obsolete)" depends on UML_NET + select FORBID_STATIC_LINK help This User-Mode Linux network transport allows one or more running UMLs on a single host to communicate with each other and also @@ -292,6 +294,7 @@ config UML_NET_MCAST config UML_NET_PCAP bool "pcap transport (obsolete)" depends on UML_NET + select FORBID_STATIC_LINK help The pcap transport makes a pcap packet stream on the host look like an ethernet device inside UML. This is useful for making -- 2.25.0.341.g760bfbb309-goog