From patchwork Thu May 26 18:54:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gow X-Patchwork-Id: 1635966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=N+Efl0FG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20210112 header.b=X5QPBT3r; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L8HD83PxRz9s2R for ; Fri, 27 May 2022 04:54:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=IodXkYjItSFwj1fl3xQbRH7O5njkpkAVSa20D06keF8=; b=N+E fl0FGxD4No4Y5ToVwJuTAPQCjH+8MTr/jQnyz1ZhmYTLvFRnrR3rzENL8ZsmCS8gaSc6O5KHWBXWv vETaz2rN0ljMMHsVUfqF6UhkzABk7RoT3h5vVqC8UdBKFzjwf/5eOw37SWsEyn+wkQDuq/ITfLs3h 3ov72xaz5i99tBIY0FmjIHeAyFt55q6GvY2i6wFcf96r6NQeK6X7Ofti09ahqFMxrkL7RuRU0tA17 3t/EPDdqiARZ+0RW+xp4BJTHqvgi0HVazTVrbyAcuI5Aytg7apvwf1m2Eh1AtOKGrqQLABzRm87Id BUPtG4tcejaUa3H1jqaDVnivKZ624lw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuIci-00FeWY-0N; Thu, 26 May 2022 18:54:16 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuIce-00FeVJ-7E for linux-um@lists.infradead.org; Thu, 26 May 2022 18:54:14 +0000 Received: by mail-pl1-x649.google.com with SMTP id j13-20020a170902da8d00b00161d78a9e3eso1505557plx.17 for ; Thu, 26 May 2022 11:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=JMJVGg1qZnHH7C8ATRhIwxxHuj2y9HrWKG9Y6P+CVa4=; b=X5QPBT3rcKnwfVEC/ZgYYSC6s8s4hl/iM07SHcdQvxHX45jXMkjkR98a8tHk1s7i5i hljpwk+zr49ln6Bl0myvnXkNbU6M4CQRGem0QlWNioGpY50exkY88Nc0Apae4xthVSQR 6MPnaB64Oh1y40FPM2rQ67fKHreHbBRsrQpolC3b5t0SUpG8psfDw5rL6EuTo6QvFEsk pqJWwDC5nMfeXGHP7Yp9zVScxEy42RXSy8T8hend0JQlo9eTB/K55klwydC8EfiAT8Ow Gt+e7E1RE2ynwxJhN+IiRfttkfXCOj2DTeFCcOdejadGU7QPWJ2uPrIKTEdIbNY5XfGa Nnpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=JMJVGg1qZnHH7C8ATRhIwxxHuj2y9HrWKG9Y6P+CVa4=; b=1wwefeH8mm5ty0OxJDA1aVPYY/pDDNx/e/PtwJGB51MdxgVAHfhiBdJnTT1O6N5hUh YiaJSRSK2ACL3Kcu3ri58YdPbQYlSIx1EoCZwFrJIKOvN9HNXIfVLo7GWpQmVHi5VslU 5yz4QiUbrYYCjve1XsNxzUsXrmbnsiByVitwdm8ymtzDUoaNqptlFdxbX3ELQ1HIHvQK Zzhsl7aD8CTl3iXm9x3X1SGPmBjeR9nrGekSUGfPFXqMIOZ1/z1jjLiDsznNWwjJOWB8 22CT3AuBJ7q9W9HPo3F+DGzv6enRcZ3GrZ0gc0Stu7t7SEhiX01IoFRSr2uYeGE1b2QL XSBg== X-Gm-Message-State: AOAM533Kc67z/O5QWRjeYiQlfagzcPm7hkmN1VK/fgiIXapPsvu8Dvve mJcJ0o1syhpTngL/4PWPMBiTAqDoW3h3MA== X-Google-Smtp-Source: ABdhPJwkL12I0XRvEV0PkVlYwPoUUg3RtRs/pjbKCaMCuJjBBTvAJP2uFoE18EfQYR8oMmERKPOp9uUFvMN9/w== X-Received: from spirogrip.svl.corp.google.com ([2620:15c:2cb:201:e2f9:ca60:7aad:75cb]) (user=davidgow job=sendgmr) by 2002:a05:6a00:996:b0:505:b6d2:abc8 with SMTP id u22-20020a056a00099600b00505b6d2abc8mr40111331pfg.11.1653591249518; Thu, 26 May 2022 11:54:09 -0700 (PDT) Date: Thu, 26 May 2022 11:54:02 -0700 Message-Id: <20220526185402.955870-1-davidgow@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog Subject: [PATCH] arch: um: Fix build for statically linked UML w/ constructors From: David Gow To: Richard Weinberger , Anton Ivanov , Johannes Berg Cc: David Gow , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220526_115412_335566_E0BB0CC4 X-CRM114-Status: UNSURE ( 9.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.7 (-------) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: If CONFIG_CONSTUCTORS is enabled on a statically linked (CONFIG_STATIC_LINK=y) build of UML, the build fails due to the .eh_frame section being both used and discarded: ERROR:root:`.eh_frame' referenced in section `.text' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: defined in discarded section `.eh_frame' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o `.eh_fram [...] Content analysis details: (-7.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:649 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_MED DKIMwl.org - Medium trust sender X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If CONFIG_CONSTUCTORS is enabled on a statically linked (CONFIG_STATIC_LINK=y) build of UML, the build fails due to the .eh_frame section being both used and discarded: ERROR:root:`.eh_frame' referenced in section `.text' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: defined in discarded section `.eh_frame' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o `.eh_frame' referenced in section `.text' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: defined in discarded section `.eh_frame' of /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o Instead, keep the .eh_frame section, as we do in dyn.lds.S for dynamically linked UML. This can be reproduced with: ./tools/testing/kunit/kunit.py run --kconfig_add CONFIG_STATIC_LINK=y --kconfig_add CONFIG_GCOV_KERNEL=y --kconfig_add CONFIG_DEBUG_FS=y Signed-off-by: David Gow --- arch/um/kernel/uml.lds.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S index 7a8e2b123e29..71a59b8adbdc 100644 --- a/arch/um/kernel/uml.lds.S +++ b/arch/um/kernel/uml.lds.S @@ -95,6 +95,7 @@ SECTIONS } .got : { *(.got.plt) *(.got) } + .eh_frame : { KEEP (*(.eh_frame)) } .dynamic : { *(.dynamic) } .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }