From patchwork Sun Jun 25 03:28:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 9807939 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 C950560329 for ; Sun, 25 Jun 2017 03:28:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A99A828358 for ; Sun, 25 Jun 2017 03:28:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A96A28415; Sun, 25 Jun 2017 03:28:48 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 F0ADA28358 for ; Sun, 25 Jun 2017 03:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751094AbdFYD2r (ORCPT ); Sat, 24 Jun 2017 23:28:47 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:34575 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbdFYD2r (ORCPT ); Sat, 24 Jun 2017 23:28:47 -0400 Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com [209.85.161.175]) (authenticated) by conssluserg-03.nifty.com with ESMTP id v5P3Sif3025616 for ; Sun, 25 Jun 2017 12:28:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com v5P3Sif3025616 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1498361324; bh=yM28fIyks54RY9/JrLfkyJdTrzltQ3fmOnEKjgLiY7s=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=kp52wU6H0HRAb1HAnLU478HRGuElcmlU52bgvR8sS6cssXbUZqM+nOlaXquzpg/Ew bhXas3fxyoLVAplbZR7DRIN/RZ7vOyPnTRRJqfEUYDCpeq0IcS+mOCJHGtvZdGvmxN a4FyvKvidm/uwd7uy5LMjTtEfP64F3VxQWMYQoBkVuBg3gymIgMISwYmsPNyx2HfyC s+QL/uBrg6HR3MkMIn+zfLPFT9ewZO8dl/qG2fsEU0FViVmpykOPhvTYaDz69zRv74 9f2uXOf/tkzqu95Ap+oENiDBE7iF9PT5+zKue9BBhUTk2fNGQ6s2WtE/zDpzjTllb3 XfZ/Ji2vjT9dg== X-Nifty-SrcIP: [209.85.161.175] Received: by mail-yw0-f175.google.com with SMTP id t127so17020386ywc.3 for ; Sat, 24 Jun 2017 20:28:44 -0700 (PDT) X-Gm-Message-State: AKS2vOzMux2OXpFcNKZnmSWrHzFtsg69nrFuwXVJeMMjHUkjsDbraV/y kRGk14ZRLgbnuUDoMyUBHUoVohpH0A== X-Received: by 10.129.72.78 with SMTP id v75mr11336420ywa.324.1498361323573; Sat, 24 Jun 2017 20:28:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.49.9 with HTTP; Sat, 24 Jun 2017 20:28:43 -0700 (PDT) In-Reply-To: <20170622123929.15054-4-npiggin@gmail.com> References: <20170622123929.15054-1-npiggin@gmail.com> <20170622123929.15054-4-npiggin@gmail.com> From: Masahiro Yamada Date: Sun, 25 Jun 2017 12:28:43 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/3] tile: thin archives fix linking To: Nicholas Piggin Cc: Linux Kbuild mailing list , Chris Metcalf 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 2017-06-22 21:39 GMT+09:00 Nicholas Piggin : > The VDSO symbols can't be linked into built-in.o when building with > thin archives, so change this to linking a new object file that is > included into the built-in.o. > > Cc: Chris Metcalf > Signed-off-by: Nicholas Piggin > --- > arch/tile/kernel/vdso/Makefile | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile > index c54fff37b5ff..e140472d5be6 100644 > --- a/arch/tile/kernel/vdso/Makefile > +++ b/arch/tile/kernel/vdso/Makefile > @@ -11,7 +11,7 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) > # vdso32 is only for tilegx -m32 compat task. > VDSO32-$(CONFIG_COMPAT) := y > > -obj-y += vdso.o > +obj-y += vdso.o vdso-syms.o > obj-$(VDSO32-y) += vdso32.o > extra-y += vdso.lds > CPPFLAGS_vdso.lds += -P -C -U$(ARCH) > @@ -49,16 +49,18 @@ $(obj)/vdso.so.dbg: $(src)/vdso.lds $(obj-vdso) > # We also create a special relocatable object that should mirror the symbol > # table and layout of the linked DSO. With ld -R we can then refer to > # these symbols in the kernel code rather than hand-coded addresses. > -extra-y += vdso-syms.o > -$(obj)/built-in.o: $(obj)/vdso-syms.o > -$(obj)/built-in.o: ld_flags += -R $(obj)/vdso-syms.o > > SYSCFLAGS_vdso.so.dbg = -shared -s -Wl,-soname=linux-vdso.so.1 \ > $(call cc-ldoption, -Wl$(comma)--hash-style=both) > -SYSCFLAGS_vdso_syms.o = -r > -$(obj)/vdso-syms.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE > +SYSCFLAGS_vdso_dummy.o = -r > +$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE > $(call if_changed,vdsold) > > +quiet_cmd_vdso_sym = VDSOSYM $@ > + cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@ > + > +$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o > + $(call if_changed,vdso_sym) > > # strip rule for the .so file > $(obj)/%.so: OBJCOPYFLAGS := -S > -- > 2.11.0 > > -- I updated thin-ar branch. Just in case, the following is my local fix-up: - Fix incremental build - Do not repeat "$(obj)/vsyscall-dummy.o" in the build command # strip rule for the .so file diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile index edb7809..c615ec0 100644 --- a/arch/tile/kernel/vdso/Makefile +++ b/arch/tile/kernel/vdso/Makefile @@ -5,7 +5,7 @@ vdso-syms = rt_sigreturn gettimeofday obj-vdso = $(patsubst %, v%.o, $(vdso-syms)) # Build rules -targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds +targets := $(obj-vdso) vdso.so vdso.so.dbg vdso.lds vdso-dummy.o obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) # vdso32 is only for tilegx -m32 compat task. @@ -56,9 +56,9 @@ $(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE $(call if_changed,vdsold) quiet_cmd_vdso_sym = VDSOSYM $@ - cmd_vdso_sym = $(LD) -r -R $(obj)/vdso-dummy.o -o $@ + cmd_vdso_sym = $(LD) -r -o $@ -R $< -$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o +$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE $(call if_changed,vdso_sym)