From patchwork Thu Jun 22 05:42:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9803481 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 8D99B60386 for ; Thu, 22 Jun 2017 05:42:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7028C285C5 for ; Thu, 22 Jun 2017 05:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 643E5285C9; Thu, 22 Jun 2017 05:42:46 +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 B7957285C5 for ; Thu, 22 Jun 2017 05:42:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248AbdFVFmp (ORCPT ); Thu, 22 Jun 2017 01:42:45 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33490 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751064AbdFVFmo (ORCPT ); Thu, 22 Jun 2017 01:42:44 -0400 Received: by mail-pf0-f195.google.com with SMTP id w12so1374274pfk.0 for ; Wed, 21 Jun 2017 22:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=vN+uh2RV4A7sy6cr4gZOnS6rBCfOzBo2LGjPKkoA2C4=; b=fGPIKCuqXkfwNt1to8yZ+hjuPQ744tc7zmiNT4dpORhCGM2YE1aghmSU+mTLGnk0mm sROereg/jF8UwQLtzX+xgeGV59/ByYNT5r0uWLjN+gcOULkpUtjPzNU7bWhwAqxtwaRC d1x6lOmF3we9yyE0eSSIANCXDpVtJ/CnJEwpSJagO2WoP9a0DC0LGJ/fJX4KtCfFGOtl sSZWNh0c/bJYSBQ2dhiARg74Sd7dpkby1DBVx+zFIapMvv9wjLkCownooPMgeYLdhcGA lGxGdMtQsYQBazRCWgNg41NPEj9f48HoPOj76LjHvnY13qRFlY2o68EPaSeG2ibzccGT fsFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=vN+uh2RV4A7sy6cr4gZOnS6rBCfOzBo2LGjPKkoA2C4=; b=UAbBi+ao9X5YPJroO7IMzUxZHy9+uE1WWFIaSE+n9h8MgAgxZdtbAvKS3FEGctQbnG oyGMDk65ggA48PfK5v9MpmEn4y2fyTcylvfgR6sbKoZdZIuID9igioBwAi8WwCKSsjlw ToM5rbmhGSL8wQUKywxKFs/lxTHodgbbH8dr20X806Px7EO7H04w08tEij0Vp7GRbhn8 JJuRmuF4Mp6wmqNHfowag2QOHt8hXBzof0Z7MQUX56xbfXtkuYBFdK5omwaOguAc/OrW gFmHM7ApJSHO0qlLwncDqaHDGIw9mrY5p/xGX0RrEHXppqU91J2miqFN/vvXv7GdKTvs dizw== X-Gm-Message-State: AKS2vOx2L4ry3ZvAO59XOSzuVhorRrVHJ7tj47BKUzJPb52UpsDoat88 ovdq4xff85SP0g== X-Received: by 10.101.69.142 with SMTP id o14mr935620pgq.0.1498110163831; Wed, 21 Jun 2017 22:42:43 -0700 (PDT) Received: from roar.ozlabs.ibm.com ([210.185.119.63]) by smtp.gmail.com with ESMTPSA id y12sm1076074pgr.61.2017.06.21.22.42.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Jun 2017 22:42:42 -0700 (PDT) Date: Thu, 22 Jun 2017 15:42:24 +1000 From: Nicholas Piggin To: kbuild test robot Cc: kbuild-all@01.org, linux-kbuild@vger.kernel.org, Masahiro Yamada , Alan Modra Subject: Re: [kbuild:thin-ar 5/8] ia64-linux-ld: warning: .note.gnu.build-id section discarded, --build-id ignored. Message-ID: <20170622154224.0322b356@roar.ozlabs.ibm.com> In-Reply-To: <20170622143327.32177b0a@roar.ozlabs.ibm.com> References: <201706221136.76FjJsv8%fengguang.wu@intel.com> <20170622143327.32177b0a@roar.ozlabs.ibm.com> Organization: IBM X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 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 On Thu, 22 Jun 2017 14:33:27 +1000 Nicholas Piggin wrote: > On Thu, 22 Jun 2017 11:48:38 +0800 > kbuild test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git thin-ar > > head: f9aac183deb53716ea92f528595758e3c9ef3539 > > commit: c5784ad98b773d08562a34b700e9c5e84763c0d8 [5/8] ia64: thin archives fix linking > > config: ia64-allnoconfig (attached as .config) > > compiler: ia64-linux-gcc (GCC) 6.2.0 > > reproduce: > > wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > git checkout c5784ad98b773d08562a34b700e9c5e84763c0d8 > > # save the attached .config to linux build tree > > make.cross ARCH=ia64 > > > > All warnings (new ones prefixed by >>): > > > > >> ia64-linux-ld: warning: .note.gnu.build-id section discarded, --build-id ignored. > > > Sigh. > > What's happening here is that when performing the final link with the > -R option, the linker forgets to emit the --build-id section it was > asked to. > > This is the final link command line that causes the error: > > $ ia64-linux-ld -static -R arch/ia64/kernel/gate-syms.o --build-id -o vmlinux -T ./arch/ia64/kernel/vmlinux.lds --whole-archive built-in.o --no-whole-archive --start-group lib/lib.a arch/ia64/lib/lib.a --end-group > > However it links successfully if I do this: > > $ ia64-linux/bin/ia64-linux-ld -r -R arch/ia64/kernel/gate-syms.o -o syms.o > $ ia64-linux/bin/ia64-linux-ld -static syms.o --build-id -o vmlinux -T ./arch/ia64/kernel/vmlinux.lds --whole-archive built-in.o --no-whole-archive --start-group lib/lib.a arch/ia64/lib/lib.a --end-group > > I.e., create an intermediate object file with the symbols first using > symbols from gate-syms.o, and use that in the final link rather than -R > > Alan do you have any idea what the problem might be here? > > If it turns out to be a toolchain bug or limitation, I can do the same > workaround in the kernel. Here is the fix for the kernel for ia64 (tile and sh would have to follow). This creates a .o file with the gate symbols and then that is used for the final link input (rather than -R symbol file). I think this is actually the right way to go about it. I'll resend new patches for the 3 archs unless there is another suggestion. Thanks, Nick --- arch/ia64/kernel/Makefile.gate | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate index a32903ada016..f89219e20b25 100644 --- a/arch/ia64/kernel/Makefile.gate +++ b/arch/ia64/kernel/Makefile.gate @@ -2,7 +2,9 @@ targets += gate.so gate-syms.o -extra-y += gate.so gate-syms.o gate.lds gate.o +obj-y += gate-syms.o + +extra-y += gate.so gate.lds gate.o CPPFLAGS_gate.lds := -P -C -U$(ARCH) @@ -14,14 +16,15 @@ GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 \ $(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE $(call if_changed,gate) -$(obj)/built-in.o: $(obj)/gate-syms.o -$(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o +# create an object file to resolve gate symbols +quiet_cmd_gate_syms = GATE $@ + cmd_gate_syms = $(LD) -r -T $(obj)/gate.lds -R $(obj)/gate.o -o$(obj)/gate-syms.o -GATECFLAGS_gate-syms.o = -r $(obj)/gate-syms.o: $(obj)/gate.lds $(obj)/gate.o FORCE - $(call if_changed,gate) + $(call if_changed,gate_syms) # gate-data.o contains the gate DSO image as data in section .data..gate. # We must build gate.so before we can assemble it. # Note: kbuild does not track this dependency due to usage of .incbin $(obj)/gate-data.o: $(obj)/gate.so +