From patchwork Fri Jun 9 05:24:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9777183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E9A06034B for ; Fri, 9 Jun 2017 05:24:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3186128423 for ; Fri, 9 Jun 2017 05:24:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2611528564; Fri, 9 Jun 2017 05:24:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD15928423 for ; Fri, 9 Jun 2017 05:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751510AbdFIFYq (ORCPT ); Fri, 9 Jun 2017 01:24:46 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34430 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbdFIFYp (ORCPT ); Fri, 9 Jun 2017 01:24:45 -0400 Received: by mail-pf0-f194.google.com with SMTP id u1so7445619pfg.1; Thu, 08 Jun 2017 22:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Sl7aDTIi+6+DwVnipGEAeasVuMix832dhWkEXukQx2k=; b=ff07yo6Y9v+XQ+wV4p5I6B5WEcAowFyAk44Ehs5icRias5zMudHf8HHNLPQ3aCWSE2 FFLKk3Jm0Yus1b52uGvQNnNxhNzNzd58YuCYD2arMa0rhmWiDeuWo1lQB4NBWr0NVjTO nLPiOA84diG3ZYM1ms8fHjvLCEXlvGsfiyoLSAzcwH4EKmvE/EoJqDz2yKgDrYzyUQpa IQyLWOY2WcS8e7Dqst+3EXUQz7IcXifdkeCwJWJrc62JtV3dFlguosnnVSm800Cpyb5e gAeYQOA6s+y2VJ5a5R/7wO4+kc/dbnXVdE/avMD++4S4UysNKQvj4bZDsXphRLk1NqH5 bzUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Sl7aDTIi+6+DwVnipGEAeasVuMix832dhWkEXukQx2k=; b=FWpBuHPbYabQAxP9f2SgCAwR7tpqAfQ5EvLMOb84XQ0ghw9wyU0+ZLSuQ3rqddiOCQ UPnEY72e0sPAAGjIxAbON55QYB9iWouP0njvj9sdlvJLNKociJf07L6EeJ2Wu74ZIZtt jFFW8X/QGBEMAiVG5VIT0NYrq2Dw0ntFemc3Y6TeqP7COwWE5PfL4qXqgw1NcAMg2C9V Y2KvcI4RCoo29ylwkRi+n1H4zBaRSj+mZgfQhOPE3v9IMOQ4TbJt6wRxRpHkCF0v3y89 zKARFQpnB6rnBwzm4/VuuQZW36gzXCJLmt8wnJXaUUi16BVH6WmjRbxmUO7EDNOGLuGV 7DNA== X-Gm-Message-State: AODbwcDK3kZkopRDFmFp6DPbl+e+e71wlKtY0R4uBZvNKpZhzsnN78F1 b/0876R6VVhmY/ql X-Received: by 10.84.194.34 with SMTP id g31mr37305143pld.89.1496985884639; Thu, 08 Jun 2017 22:24:44 -0700 (PDT) Received: from roar.au.ibm.com (14-202-185-133.tpgi.com.au. [14.202.185.133]) by smtp.gmail.com with ESMTPSA id h15sm135375pfk.120.2017.06.08.22.24.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 22:24:43 -0700 (PDT) From: Nicholas Piggin To: linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org Cc: Nicholas Piggin , Masahiro Yamada , Michal Marek , Linus Torvalds , Stephen Rothwell Subject: [PATCH 1/5] kbuild: thin archives final link close --whole-archives option Date: Fri, 9 Jun 2017 15:24:13 +1000 Message-Id: <20170609052417.561-2-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170609052417.561-1-npiggin@gmail.com> References: <20170609052417.561-1-npiggin@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Close the --whole-archives option with --no-whole-archive. Some architectures end up including additional .o and files multiple times after this, and they get duplicate symbols when they are brought under the --whole-archives option. This matches more closely with the incremental final link. Signed-off-by: Nicholas Piggin --- scripts/link-vmlinux.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index c80291319cb2..2a062ea130b5 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -63,7 +63,7 @@ modpost_link() local objects if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then - objects="--whole-archive built-in.o" + objects="--whole-archive built-in.o --no-whole-archive" else objects="${KBUILD_VMLINUX_INIT} \ --start-group \ @@ -83,7 +83,7 @@ vmlinux_link() if [ "${SRCARCH}" != "um" ]; then if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then - objects="--whole-archive built-in.o ${1}" + objects="--whole-archive built-in.o ${1} --no-whole-archive" else objects="${KBUILD_VMLINUX_INIT} \ --start-group \ @@ -96,7 +96,7 @@ vmlinux_link() -T ${lds} ${objects} else if [ -n "${CONFIG_THIN_ARCHIVES}" ]; then - objects="-Wl,--whole-archive built-in.o ${1}" + objects="-Wl,--whole-archive built-in.o ${1} -Wl,--no-whole-archive" else objects="${KBUILD_VMLINUX_INIT} \ -Wl,--start-group \