Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1916263pxb; Wed, 10 Feb 2021 22:22:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWyCT3CBH7j1YYzB2Y1CWdHDe82Z2wTCyQryp58cCecoRryqQbj4D/zUr4l7NokZEP9K3b X-Received: by 2002:a17:906:8292:: with SMTP id h18mr6690548ejx.342.1613024544635; Wed, 10 Feb 2021 22:22:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613024544; cv=none; d=google.com; s=arc-20160816; b=SJiAKiZr/r1pJj3vvP9mA2ItsQu5R7t2V6oFcTYygzqb5YGPS/PD+uNsyK6YG3p7gG CfaSA500SMiUIRnaVOxHDWxyxQiGVIzEW4BVNJRUxlcZ+rdGHtqlPsf0x7vS67iwbNBu NRu5GlxPH3Bz4Ef6F9dD5dQ2jy5uRUHEq1orEpPePPxe70inq4GwYHQk+Nmt25Q9LfFw wnITTyP2jBIINaDzBcMZDo48NPb1kSk8JRwv96Gksp39mBMaWH8yERTKA7wHiuklT1Bq s8m4P1+QsPH+iDyepBuVFAcTRtH4+WFU6KGzfRl3+9YMveUZqp6LgUnV5Yrjd0gE9TD3 jQig== 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=18Ac+joCd35mcZvtzwWkqtE7ib4nBE3U+pSc4292Spg=; b=Qfstxq0Q/H9XnD5GfRu8Jcx7IZ1ujiy0lsDcOxw0s0t51u1eVuVpSN1QnzAgss6F7f GbwxymIomt6+2sqOGoIThEJhrOi+jYSsLOOX6hO01HGHCAIwBTn3biDRarSXRmhgeIqB VV0FBVSF3VG2QZY22/XGFAxc9dEWwA/txkI38I/eyT9Pr93vGSM/5n6qVSzh+gTtfLOL xakqyIJ9REXGkSXcOQly/8yWoGFiBslZ0yniONACB/gNBnaBrK0oi7b6PbIALQ8H995f If7ZFNk+Pp9tD57ECGxp+ZVdY4nUYkc75uJcD5KR3f3Q8PKlNliRIe1na6AEp0a4VVBr JCDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=lTp9Xxon; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si2909379eds.256.2021.02.10.22.21.59; Wed, 10 Feb 2021 22:22:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=lTp9Xxon; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S229523AbhBKGVQ (ORCPT + 99 others); Thu, 11 Feb 2021 01:21:16 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:52374 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhBKGVO (ORCPT ); Thu, 11 Feb 2021 01:21:14 -0500 X-Greylist: delayed 78087 seconds by postgrey-1.27 at vger.kernel.org; Thu, 11 Feb 2021 01:21:13 EST Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 11B6KGuG003048; Thu, 11 Feb 2021 15:20:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 11B6KGuG003048 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1613024417; bh=18Ac+joCd35mcZvtzwWkqtE7ib4nBE3U+pSc4292Spg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lTp9Xxong/96zw90ZdcFEqbTaJJIt7eh+0sOlzp/VODKqsUXDhuzPFycwYYjcCBCl i0vQiulFmnmPk2i4jVBoRnkpr1Jrjnd25GMduU01p/x2qRQkpb3hpwK55OWQF0ZCQC pGKLxK/8w8qxBufgmdi1cNMOu3M/UGoLB8EtUaeeGoShvcuEAt71n5lWNxbbeuQd9p dL8kPBSC/zFcRHwhVYFmkvIAWxFXwehbwX6bL9V5StEsCZpsSsuhHybYFMpbvmOlMi kHrnxByuZI/9CJgwUb5UI9b2on3hsawftBKBjhC+nUppWwcHijCiE46U63JUtJHThL mpNd8bumpMlGg== X-Nifty-SrcIP: [209.85.216.43] Received: by mail-pj1-f43.google.com with SMTP id cv23so2830566pjb.5; Wed, 10 Feb 2021 22:20:16 -0800 (PST) X-Gm-Message-State: AOAM530A7lGCNCbsNidFjP4TalrlHyAonf5u7Fpmso6T99u/Zcc98Ce8 aEDOCF+f16YAWNfvSI4RK3fKjh2Q3bVxlxFZc2g= X-Received: by 2002:a17:902:bb87:b029:e1:d1f:2736 with SMTP id m7-20020a170902bb87b02900e10d1f2736mr6332156pls.1.1613024415986; Wed, 10 Feb 2021 22:20:15 -0800 (PST) MIME-Version: 1.0 References: <20210209210843.3af66662@canb.auug.org.au> <20210210085051.7fb951d1@canb.auug.org.au> In-Reply-To: From: Masahiro Yamada Date: Thu, 11 Feb 2021 15:19:37 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: linux-next: build failure after merge of the modules tree To: Jessica Yu Cc: Stephen Rothwell , Christoph Hellwig , Linux Kernel Mailing List , Linux Next Mailing List , Michael Ellerman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 10, 2021 at 5:37 PM Masahiro Yamada wrote: > > On Wed, Feb 10, 2021 at 5:06 PM Jessica Yu wrote: > > > > +++ Stephen Rothwell [10/02/21 08:50 +1100]: > > >Hi Jessica, > > > > > >On Tue, 9 Feb 2021 16:16:20 +0100 Jessica Yu wrote: > > >> > > >> Hmm, these errors don't look like it's related to that particular commit. I was > > > > > >I found this commit by bisection and then tested by reverting it. > > > > > >Before this commit, CONFIG_TRIM_UNUSED_KSYMS would not be set in the > > >allyesconfig build because CONFIG_UNUSED_SYMBOLS was set. After this > > >commit, CONFIG_TRIM_UNUSED_KSYMS will be set in the allyesconfig build. > > > > Ah, that makes sense then. I would get the error on powerpc whenever > > CONFIG_TRIM_UNUSED_KSYMS was enabled. > > > > >> able to reproduce these weird autoksym errors even without any modules-next > > >> patches applied, and on a clean v5.11-rc7 tree. To reproduce it, > > >> CONFIG_TRIM_UNUSED_KSYMS needs to be enabled. I guess that's why we run into > > >> these errors with allyesconfig. I used a gcc-7 ppc64le cross compiler and got > > >> the same compiler warnings. It seems to not compile on powerpc properly because > > >> it looks like some symbols have an extra dot "." prefix, for example in > > >> kthread.o: > > >> > > >> 168: 0000000000000318 24 NOTYPE GLOBAL DEFAULT 6 kthread_create_worker > > >> 169: 0000000000001d90 104 FUNC GLOBAL DEFAULT 1 .kthread_create_worker > > >> 170: 0000000000000330 24 NOTYPE GLOBAL DEFAULT 6 kthread_create_worker_on_cpu > > >> 171: 0000000000001e00 88 FUNC GLOBAL DEFAULT 1 .kthread_create_worker_on_cpu > > >> 172: 0000000000000348 24 NOTYPE GLOBAL DEFAULT 6 kthread_queue_work > > >> 173: 0000000000001e60 228 FUNC GLOBAL DEFAULT 1 .kthread_queue_work > > >> > > >> So I suppose this dot prefix is specific to powerpc. From the ppc64 elf abi docs: > > >> > > >> Symbol names with a dot (.) prefix are reserved for holding entry point > > >> addresses. The value of a symbol named ".FN", if it exists, is the entry point > > >> of the function "FN". > > >> > > >> I guess the presence of the extra dot symbols is confusing > > >> scripts/gen_autoksyms.sh, so we get the dot symbols in autoksyms.h, which the > > >> preprocessor doesn't like. I am wondering how this was never caught until now > > >> and also now curious if this feature was ever functional on powerpc.. > > > > > >Which feature? > > > > Sorry, by "feature" I meant CONFIG_TRIM_UNUSED_KSYMS. This config > > option was introduced around v4.7. If simply enabling it produces > > these compilation errors I was wondering if it ever built properly on > > powerpc. > > > > Thanks, > > > > Jessica > > > Thanks for the report. > > I think the following will fix the issue, > but modpost needs fixing too. > > > diff --git a/scripts/gen_autoksyms.sh b/scripts/gen_autoksyms.sh > index 16c0b2ddaa4c..996a7109167b 100755 > --- a/scripts/gen_autoksyms.sh > +++ b/scripts/gen_autoksyms.sh > @@ -44,7 +44,7 @@ sed 's/ko$/mod/' $modlist | > xargs -n1 sed -n -e '2{s/ /\n/g;/^$/!p;}' -- | > cat - "$ksym_wl" | > sort -u | > -sed -e 's/\(.*\)/#define __KSYM_\1 1/' >> "$output_file" > +sed -e 's/^\.\{,1\}\(.*\)/#define __KSYM_\1 1/' >> "$output_file" > > # Special case for modversions (see modpost.c) > if [ -n "$CONFIG_MODVERSIONS" ]; then > m After some more tests, I noticed the code above was not correct. I still saw a lot of modpost errors. ERROR: modpost: "_mcount" [arch/powerpc/oprofile/oprofile.ko] undefined! ERROR: modpost: "._mcount" [arch/powerpc/oprofile/oprofile.ko] undefined! I just posted a patch, which fixes the error as far as I tested. https://patchwork.kernel.org/project/linux-kbuild/patch/20210211061416.3747231-1-masahiroy@kernel.org/ -- Best Regards Masahiro Yamada