Received: by 10.192.165.156 with SMTP id m28csp710760imm; Tue, 17 Apr 2018 18:55:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx48PC/OB9Cf/NWRxNFNb2/0hD+8R7Imy9HiPzPxQs/TCEWLCI2+3HFpysloNuR+wE75VVivy X-Received: by 10.101.92.2 with SMTP id u2mr130355pgr.317.1524016530792; Tue, 17 Apr 2018 18:55:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524016530; cv=none; d=google.com; s=arc-20160816; b=FghewChTumqt/sImhb8Zg4DuS+50sKmM6oCnhuh+83xy6A4AAlRnGCrEpt2mPrzofm 7f5nIJlU7WBVwCkDYVYiG/EiQHw7SY69EQRrnjBgqoMmls919elnA3lKjwBYuDY0xOS+ UtS2Ij2f533PsHcKwYkDFg/3T2fxloMrPUXyisqIHWw4ISkqOj53Z+TAUq8SMDD1tDci aOBnLivc36yWaNeKyo+lYGHD8xBifukub7XZUqyeCgWKU6n6NC7xoETVWC4JpiJU/Jwc SzvanCJz3L4Gw/0pgUOpFe1NDr37nDfogRcImIZa1/9LagfXDKo8qLkroPY4gthLBWPk UOTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=tcGxFhVMGn4vUz1YfYsKeQJe1pGxVU7jPw4aM19uL4I=; b=C06FODlyfGbtPrXAASVyUZFxE+aQCbOWKN3fxw1sCYK1t3oAduJpz6pCbvYN15e5BL WFy5aPRiuXbC13us1HwKLRBM3DTKHmbyDxaR/qT3sr57kNCBhi0plXeDYyx1bMHChWDR vMX0y1AaS8yqEf9kG3uV/STynCNGJ8BCb3Ak+CA3xTjQSXDCeGfsqfof2QH3FHl5jYxu y9V0yeAx3+ti0Sg7rxUlbZypnfnID+ynpu8Q0IgqoIxqmzRAz9xZotzkEZgjGcU9IJSZ IyH4DjlzMQjWcwWkD4t5gApWVf9cSCFjvjwpUbY/ItilnAbuxb+RtV3oQ8BJ207UvLk+ tKjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gCcW4auC; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si138136plj.510.2018.04.17.18.55.17; Tue, 17 Apr 2018 18:55:30 -0700 (PDT) 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=@nifty.com header.s=dec2015msa header.b=gCcW4auC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753358AbeDRBxS (ORCPT + 99 others); Tue, 17 Apr 2018 21:53:18 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:28220 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbeDRBxQ (ORCPT ); Tue, 17 Apr 2018 21:53:16 -0400 Received: from mail-vk0-f49.google.com (mail-vk0-f49.google.com [209.85.213.49]) (authenticated) by conssluserg-02.nifty.com with ESMTP id w3I1r4ew019073; Wed, 18 Apr 2018 10:53:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com w3I1r4ew019073 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1524016385; bh=tcGxFhVMGn4vUz1YfYsKeQJe1pGxVU7jPw4aM19uL4I=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=gCcW4auCMhBgaOwuIqefHPNdQX8c8G+NYulB32pID8/7m4omXBb7m+U2DaKezDmAt rF4/P+T6nON/29xTRDOek76tl2ueweOhZUmP5h5ZrmbSCfkMRDDqN8ygq+BrSJ4qjm Lg7L31qHruA63xZ3rIwFt0T62tlec34ThFN49FIFpoh9us870OtSQUsQexmjUVQecf saU/PGkHGvCCl96j0umCjeWUF6NUcYGU5d5mkJJKR/fxFliVwtPtm4U+xH9/jN+aZG PWZFmDCAPVr4T6tA1lUthfxYEeSCIUKs3COe9mNc26IByvXTaPePaFSwrf/wdx5KKw /aConlsSWUqJA== X-Nifty-SrcIP: [209.85.213.49] Received: by mail-vk0-f49.google.com with SMTP id i75so96407vke.8; Tue, 17 Apr 2018 18:53:05 -0700 (PDT) X-Gm-Message-State: ALQs6tB5H5dP6eGEe9kf3hBaDIPE5xwanO0pIEi8DYX6nK34W9JpNQ6W /ncwkD+QWgfLQvQHQOp4heT3FOI8NJooSkDkzis= X-Received: by 10.31.157.194 with SMTP id g185mr99737vke.11.1524016384200; Tue, 17 Apr 2018 18:53:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.85.216 with HTTP; Tue, 17 Apr 2018 18:52:23 -0700 (PDT) In-Reply-To: <20180417230921.GA29046@saruman> References: <1523433019-17419-1-git-send-email-matt.redfearn@mips.com> <1523433019-17419-3-git-send-email-matt.redfearn@mips.com> <20180417230921.GA29046@saruman> From: Masahiro Yamada Date: Wed, 18 Apr 2018 10:52:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 3/4] MIPS: vmlinuz: Use generic ashldi3 To: James Hogan Cc: Matt Redfearn , Palmer Dabbelt , Antony Pavlov , Ralf Baechle , Linux-MIPS , Linux Kernel Mailing List , Michal Marek , Linux Kbuild mailing list 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 2018-04-18 8:09 GMT+09:00 James Hogan : > On Wed, Apr 11, 2018 at 08:50:18AM +0100, Matt Redfearn wrote: >> diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile >> index adce180f3ee4..e03f522c33ac 100644 >> --- a/arch/mips/boot/compressed/Makefile >> +++ b/arch/mips/boot/compressed/Makefile >> @@ -46,9 +46,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c >> >> vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o >> >> -extra-y += ashldi3.c bswapsi.c >> -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib >> -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c >> +extra-y += ashldi3.c >> +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c >> + $(call cmd,shipped) >> + >> +extra-y += bswapsi.c >> +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c >> $(call cmd,shipped) > > ci20_defconfig: > > arch/mips/boot/compressed/ashldi3.c:4:10: fatal error: libgcc.h: No such file or directory > #include "libgcc.h" > ^~~~~~~~~~ > > It looks like it had already copied ashldi3.c from arch/mips/lib/ when > building an older commit, and it hasn't been regenerated from lib/ since > the Makefile changed, so its still using the old version. > > I think it should be using FORCE and if_changed like this: > > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile > index e03f522c33ac..abe77add8789 100644 > --- a/arch/mips/boot/compressed/Makefile > +++ b/arch/mips/boot/compressed/Makefile > @@ -47,12 +47,12 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c > vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o > > extra-y += ashldi3.c > -$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c > - $(call cmd,shipped) > +$(obj)/ashldi3.c: $(obj)/%.c: $(srctree)/lib/%.c FORCE > + $(call if_changed,shipped) > > extra-y += bswapsi.c > -$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > - $(call cmd,shipped) > +$(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c FORCE > + $(call if_changed,shipped) > > targets := $(notdir $(vmlinuzobjs-y)) > > That resolves the build failures when checking out old -> new without > cleaning, since the .ashldi3.c.cmd is missing so it gets rebuilt. > > It should also resolve issues if the path it copies from is updated in > future since the .ashldi3.c.cmd will get updated. > > If you checkout new -> old without cleaning, the now removed > arch/mips/lib/ashldi3.c will get added which will trigger regeneration, > so it won't error. > > However if you do new -> old -> new then the .ashldi3.cmd file isn't > updated while at old, so you get the same error as above. I'm not sure > there's much we can practically do about that, aside perhaps avoiding > the issue in future by somehow auto-deleting stale .*.cmd files. > > Cc'ing kbuild folk in case they have any bright ideas. I do not have any idea better than if_changed. > At least the straightforward old->new upgrade will work with the above > fixup though. If you're okay with it I'm happy to apply as a fixup. > -- Best Regards Masahiro Yamada