Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5686577iob; Tue, 10 May 2022 00:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdjSIc0iuPkwuTNByeC71R90hSge6EKKeVkYTjmFTHBvBdemdja0f1mxVebFTr40WzD11i X-Received: by 2002:a17:907:1b25:b0:6da:8206:fc56 with SMTP id mp37-20020a1709071b2500b006da8206fc56mr18265483ejc.81.1652169458859; Tue, 10 May 2022 00:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652169458; cv=none; d=google.com; s=arc-20160816; b=fwD/vR6RIOOe2dSB2+O66Pli2W3RXMbqRd365mZw5FfL0FrQEc9J637TICZZXZ6Ykg zI0pfgNvplZo82Q/D/wle2EHRQp+GawcIEaMm3AUjH70aE17PxYjrzPjFPEhIx0ThuzL 1FpuJk+4uRTVof/Cj/buUii+VUFkV9GSxwRwoZmyPWgRT9NV9TYIAUyqOIBhvVb5KzFt nCQ2UXztaqd5xlbvPdYgJgBLQLgv1yIo5CGhjd4pJDqdkWpOthtA9763CSzgsXgUMHTu mYeV2W+EKnHvS45muDos8cgoefpk5BNgsOxEvDZD7tDNmbZKwri0o7fMbk66l4s4LzBx ex1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=fEURvXR77OoRUwAby4ssOCC2y+9cYzZS2BTBBdHY5s4=; b=d8kmsu9tPt1o7gCbKKTnzds8hWpbeNC8Ta0KxwzO9qE+DtaJYeo70AZibr7eYYEtak 0LIqI+PL2FFzVMrxbvFcJ8kU1dfEmzFLQtRcNZRnetUlX2KydaxyA1OHD3Tb/Vg5KnYZ EoVswM5/5tD2LyFRgGxjDfWRMpu3Xt7zSNU1Po3dvyp+7JHymv8fGoEspJM3xlYSnMg/ WxWkKv+ATf6m8g+kz4sPRvVC6hw/OO9waNUYVbgNsORzzL02jWOZEMbmHcJUjFbL0icq GPNd6/AR9TzZEZanRBP5R9P7tYIIa2HwrP43fV5SlSUcSIVSMsuLY+DshsvjkPXXBEFk ymEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wCwaSRXE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jr2-20020a170906a98200b006e7e84d111fsi15039192ejb.641.2022.05.10.00.57.14; Tue, 10 May 2022 00:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wCwaSRXE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237451AbiEJHA6 (ORCPT + 99 others); Tue, 10 May 2022 03:00:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbiEJHAr (ORCPT ); Tue, 10 May 2022 03:00:47 -0400 Received: from conssluserg-03.nifty.com (conssluserg-03.nifty.com [210.131.2.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532787485B; Mon, 9 May 2022 23:56:48 -0700 (PDT) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 24A6uWPt006909; Tue, 10 May 2022 15:56:33 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 24A6uWPt006909 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1652165793; bh=fEURvXR77OoRUwAby4ssOCC2y+9cYzZS2BTBBdHY5s4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=wCwaSRXELTeXaq2guIuReTuZg7U66E7IGNEBvRfkfezGlyZXsSMCiDdUr9QEJxarS XrfMKl2ilUNX5U21uZSXL6zLwnIp0vZsPMbwwzeaW+huMjJN0lDJ6x9fPRe4b3ioLX d1CWYofvXhCGeTNOH4b2zCthanuoTTMVhHVGhU/G+RblgSvtBBoQY1q8W0F5FwtyK8 pFbA+pcE2bpadKfX8PQAdO+AHk9AEs+Qvcqfz+EpBxXnZR+DExiobCnjj/rrTS0tnx CZPaFmdEMVXzwdp/7Jw3Kyv3btpFQ7MhJ18jWwmea1L+fCMHlCb2QwIfpTWtpSAEz9 0NOjUjI1wdR0w== X-Nifty-SrcIP: [209.85.216.46] Received: by mail-pj1-f46.google.com with SMTP id iq10so15115325pjb.0; Mon, 09 May 2022 23:56:33 -0700 (PDT) X-Gm-Message-State: AOAM530Yx4NqOCrZWxlmZ6whAaURMPWAefNzWF9V/GNdyNORuj3wUXlF /LFU6ldwJ4z2CmT+9xRoarpYmzRcrA+ynNgI9jQ= X-Received: by 2002:a17:90a:e7cd:b0:1dc:74eb:7526 with SMTP id kb13-20020a17090ae7cd00b001dc74eb7526mr21753943pjb.144.1652165792292; Mon, 09 May 2022 23:56:32 -0700 (PDT) MIME-Version: 1.0 References: <20220508190631.2386038-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Tue, 10 May 2022 15:55:21 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 00/14] kbuild: yet another series of cleanups (modpost, LTO, MODULE_REL_CRCS, export.h) To: Nathan Chancellor Cc: Linux Kbuild mailing list , Linux Kernel Mailing List , Nick Desaulniers , Nicolas Schier , Peter Zijlstra , linux-modules , linux-s390 , linuxppc-dev , clang-built-linux , Ard Biesheuvel , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 10, 2022 at 7:13 AM Nathan Chancellor wrote: > > On Mon, May 09, 2022 at 01:24:33PM +0900, Masahiro Yamada wrote: > > On Mon, May 9, 2022 at 4:09 AM Masahiro Yamada wrote: > > > > > > This is the third batch of cleanups in this development cycle. > > > > > > Major changes in v4: > > > - Move static EXPORT_SYMBOL check to a script > > > - Some refactoring > > > > > > Major changes in v3: > > > > > > - Generate symbol CRCs as C code, and remove CONFIG_MODULE_REL_CRCS. > > > > > > Major changes in v2: > > > > > > - V1 did not work with CONFIG_MODULE_REL_CRCS. > > > I fixed this for v2. > > > > > > - Reflect some review comments in v1 > > > > > > - Refactor the code more > > > > > > - Avoid too long argument error > > > > This series is available at > > git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git > > lto-cleanup-v4 > > Hi Masahiro, > > I checked this out and went to run it through my QEMU tests but I see > two new errors. > > Failure #1: > > In file included from scripts/mod/section-check.c:3: > scripts/mod/modpost.h:15:10: fatal error: 'elfconfig.h' file not found > #include "elfconfig.h" > ^~~~~~~~~~~~~ > 1 error generated. > > I was able to get past that with > > diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile > index ca739c6c68a1..c33b83bfbcad 100644 > --- a/scripts/mod/Makefile > +++ b/scripts/mod/Makefile > @@ -16,7 +16,7 @@ targets += $(devicetable-offsets-file) devicetable-offsets.s > > # dependencies on generated files need to be listed explicitly > > -$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h > +$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o $(obj)/section-check.o: $(obj)/elfconfig.h > $(obj)/file2alias.o: $(obj)/$(devicetable-offsets-file) > Thanks for testing. I will slightly refactor the code as follows. @@ -16,7 +16,7 @@ targets += $(devicetable-offsets-file) devicetable-offsets.s # dependencies on generated files need to be listed explicitly -$(obj)/modpost.o $(obj)/file2alias.o $(obj)/sumversion.o: $(obj)/elfconfig.h +$(addprefix $(obj)/, $(modpost-objs)): $(obj)/elfconfig.h $(obj)/file2alias.o: $(obj)/$(devicetable-offsets-file) quiet_cmd_elfconfig = MKELF $@ > quiet_cmd_elfconfig = MKELF $@ > > Failure #2: > > GEN .version > CHK include/generated/compile.h > GEN .tmp_initcalls.lds > LTO vmlinux.o > OBJTOOL vmlinux.o > MODPOST vmlinux.symvers > MODINFO modules.builtin.modinfo > GEN modules.builtin > LD .tmp_vmlinux.btf > ld.lld: error: cannot open .vmlinux.export.o: No such file or directory > BTF .btf.vmlinux.bin.o > pahole: .tmp_vmlinux.btf: No such file or directory > CC .vmlinux.export.c > LD .tmp_vmlinux.kallsyms1 > ld.lld: error: .btf.vmlinux.bin.o: unknown file type > make[1]: *** [Makefile:1159: vmlinux] Error 1 > > I was not really able to see what is going wrong here. Attached is the > configuration that I ran into this with. If you need any other > information, please let me know! Ah, OK. This is because .vmlinux.export.o is compiled after gen_btf. I will swap the order in v5. > Cheers, > Nathan -- Best Regards Masahiro Yamada