Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1645211ybi; Wed, 17 Jul 2019 19:21:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPy0Whpng63JwFEtQOvUcGzEsf2NHTU3JRvLVNYq377PY32R+ecoeNc0q5ef35I4P3YpCZ X-Received: by 2002:a17:902:d81:: with SMTP id 1mr49029560plv.323.1563416511084; Wed, 17 Jul 2019 19:21:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563416511; cv=none; d=google.com; s=arc-20160816; b=uoF/KgWEQ+tGHUsXhZ1yU/VkAvTMWqV9OLMB7/e7cxoemY064FLOHjeegqLsOBX+0w e/fZA5LGj0H+/Ri8YjL5oZ4VykNAc5cTE0jEofAbLPjSpbAPPnlMnQcySw+eLi3jqtLE 0T0UMnZ84Q5j0Qhu/FlgW8lohpstwN8PqWPFCg2ZXSPpqfWjY6XkNSCoZiq3OqakzFui 9sxKwVZXLc+cNVTPXimBDIKjA4EXmkmG6sot5cci0ycnsKWrDK9vUnIzr2UL6dF+3rmw B6Escj1OM3LLYQQmVHwC58CuRzdJ9WZvd2r6yfbojCOuyfUonA1lVDySRuLT5ReKClfW 8PJg== 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 :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=tkHvMLjjjDHqsY1NCUmploWB82ITvFQnTe0kWRfY618=; b=WPft1uhLHXj3HnQ/ftF7owx4HYoIBYqr8NzDCuZjjDGNis2LaHUqhxSS+IvgZAg+0B v3TwzQO5oIYFFOUP9byJB7tbo+ch9MnGurc4lFTETq7j+/4mbLp7qu3eBtvyiL/5EgVV JxTON07rmpPuzMOLzmK0MkUqobMxTi9g6+pcanDmLhZ65+1DpEypBJCpIopvvT6cBxIG Fkcj5BW1j/DFobAKULu2eArKRzLebUu8KHZzm4u6yg0Nchfnj1UZsj2CQyuo9b0/A7+i HbGMnlJEdteyJ0j43Tvl0az1B+TZSl2dn5Isub7Vd6Z5QG6cB5rnZEPJxdXUlyLIneGb L1gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="s/VtYSLz"; 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 n21si3556819pgf.339.2019.07.17.19.21.35; Wed, 17 Jul 2019 19:21:51 -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="s/VtYSLz"; 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 S1728590AbfGRCUw (ORCPT + 99 others); Wed, 17 Jul 2019 22:20:52 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:51549 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727787AbfGRCUw (ORCPT ); Wed, 17 Jul 2019 22:20:52 -0400 Received: from mail-ua1-f52.google.com (mail-ua1-f52.google.com [209.85.222.52]) (authenticated) by conssluserg-03.nifty.com with ESMTP id x6I2KY5k014174 for ; Thu, 18 Jul 2019 11:20:35 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com x6I2KY5k014174 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563416435; bh=tkHvMLjjjDHqsY1NCUmploWB82ITvFQnTe0kWRfY618=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=s/VtYSLzYI8pZl0VRgeXLT4YVj2lKkT54FPRnAHyYMnb1IwjXkrAEGQk51yYDcvZR ci6S670X0uREaPAWNYuRz9/dT1w0annFJIRdupnNJsZLbh/0Mz7QeDK2N9T3fpuiYN guzzZpu3sE/X+h5RwPN87hupPUkbKq/k2mYy+9UWJDga/JCfqv6gBfMrPPOAcy5jqg qBUKhs908QTECo00p7NTF4XCndSgyyr5B16nwH0nTlygEM78CNm7otDQxf95/M1pNp 3Gc6D8tv66TbRR/waBE3GassIOWVZV++ihnyQPtYkXU0NefbrQdwcvQJ0xYSp+NieV sEdkVEVS6Koig== X-Nifty-SrcIP: [209.85.222.52] Received: by mail-ua1-f52.google.com with SMTP id c4so10508716uad.1 for ; Wed, 17 Jul 2019 19:20:35 -0700 (PDT) X-Gm-Message-State: APjAAAUNaK8IcQFhUyzB35qjG06Q6SSM64ENlhaTKdPGm4BwHEQh5+Ab /NIfSVjQbYeW64YzgYzAE96CVlTka9RJYTmO0eM= X-Received: by 2002:ab0:70d9:: with SMTP id r25mr3602900ual.109.1563416434430; Wed, 17 Jul 2019 19:20:34 -0700 (PDT) MIME-Version: 1.0 References: <20190713032106.8509-1-yamada.masahiro@socionext.com> <20190713124744.GS14074@gate.crashing.org> <20190713131642.GU14074@gate.crashing.org> <20190713235430.GZ14074@gate.crashing.org> <87v9w393r5.fsf@concordia.ellerman.id.au> <20190715072959.GB20882@gate.crashing.org> <87pnma89ak.fsf@concordia.ellerman.id.au> <20190717143811.GL20882@gate.crashing.org> <20190717164628.GN20882@gate.crashing.org> In-Reply-To: <20190717164628.GN20882@gate.crashing.org> From: Masahiro Yamada Date: Thu, 18 Jul 2019 11:19:58 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] powerpc: remove meaningless KBUILD_ARFLAGS addition To: Segher Boessenkool Cc: Michael Ellerman , Stephen Rothwell , Linux Kernel Mailing List , Nicholas Piggin , Paul Mackerras , linuxppc-dev 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 On Thu, Jul 18, 2019 at 1:46 AM Segher Boessenkool wrote: > > On Thu, Jul 18, 2019 at 12:19:36AM +0900, Masahiro Yamada wrote: > > On Wed, Jul 17, 2019 at 11:38 PM Segher Boessenkool > > wrote: > > > > > > On Tue, Jul 16, 2019 at 10:15:47PM +1000, Michael Ellerman wrote: > > > > Segher Boessenkool writes: > > > > And it's definitely calling ar with no flags, eg: > > > > > > > > rm -f init/built-in.a; powerpc-linux-ar rcSTPD init/built-in.a init/main.o init/version.o init/do_mounts.o init/do_mounts_rd.o init/do_mounts_initrd.o init/do_mounts_md.o init/initramfs.o init/init_task.o > > > > > > This uses thin archives. Those will work fine. > > > > > > The failing case was empty files IIRC, stuff created from no inputs. > > > > Actually, empty files are created everywhere. > > > cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ > > $(real-prereqs) > > You use thin archives. > > Does every config use thin archives always nowadays? Kbuild always uses thin archives as far as vmlinux is concerned. But, there are some other call-sites. masahiro@pug:~/ref/linux$ git grep '$(AR)' -- :^Documentation :^tools arch/powerpc/boot/Makefile: BOOTAR := $(AR) arch/unicore32/lib/Makefile: $(Q)$(AR) p $(GNU_LIBC_A) $(notdir $@) > $@ arch/unicore32/lib/Makefile: $(Q)$(AR) p $(GNU_LIBGCC_A) $(notdir $@) > $@ lib/raid6/test/Makefile: $(AR) cq $@ $^ scripts/Kbuild.include:ar-option = $(call try-run, $(AR) rc$(1) "$$TMP",$(1),$(2)) scripts/Makefile.build: cmd_ar_builtin = rm -f $@; $(AR) rcSTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) scripts/Makefile.lib: cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(real-prereqs) Probably, you are interested in arch/powerpc/boot/Makefile. This does not seem a thin archive. > > BTW, your commit 8995ac8702737147115e1c75879a1a2d75627b9e > > dates back to 2008. > > > > At that time, thin archive was not used. > > Yes, I know. This isn't about built-in.[oa], it is about *other* > archives we at least *used to* create. If we *know* we do not anymore, > then this workaround can of course be removed (and good riddance). If it is not about built-in.[oa], which archive are you talking about? Can you pin-point the one? masahiro@pug:~/ref/linux$ git log --oneline -1 8995ac870273 (HEAD) [POWERPC] Specify GNUTARGET on $(AR) invocations masahiro@pug:~/ref/linux$ git grep '(AR)' Documentation/kbuild/makefiles.txt: per-directory options to $(LD) and $(AR). arch/powerpc/Makefile:CROSS32AR := GNUTARGET=elf32-powerpc $(AR) arch/powerpc/Makefile:override AR := GNUTARGET=elf$(SZ)-powerpc $(AR) drivers/md/raid6test/Makefile: $(AR) cq $@ $^ scripts/Makefile.build: rm -f $@; $(AR) rcs $@) scripts/Makefile.build:cmd_link_l_target = rm -f $@; $(AR) $(EXTRA_ARFLAGS) rcs $@ $(lib-y) masahiro@pug:~/ref/linux$ git grep '(CROSS32AR)' arch/powerpc/boot/Makefile: cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@ > If ar creates an archive file (a real one, not a thin archive), and it > has no input files, it uses its default object format as destination > format, if it isn't told to use something else. And that doesn't work, > it needs to use some format compatible with what that archive later is > linked with. I compile-tested v4.10, which was before the thin-archive migration, but I did not see any problem for building ppc32/64. Whether or not it is a thin archive, an empty archive is always 8-byte file. masahiro@pug:~/ref/linux$ cat kernel/livepatch/built-in.o ! Is there a room for caring about the under-lying architecture? -- Best Regards Masahiro Yamada