Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3575652ybb; Mon, 6 Apr 2020 11:18:51 -0700 (PDT) X-Google-Smtp-Source: APiQypKW01U1kNnKsyjVWbCsCLzMie9PRbuWTXXBBJCUDunTJ2wD7I4xMunMbEz2U/ehYO/kFrtN X-Received: by 2002:a05:6830:104c:: with SMTP id b12mr17113924otp.121.1586197131459; Mon, 06 Apr 2020 11:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586197131; cv=none; d=google.com; s=arc-20160816; b=KCzBMTVja0aIcfZ29hOPl5RMqEKotir+NrfUr+tsj6gGeR7sm9n8nxc2J6RVoQkrxf SOUJ4LtypiYj5d+NAoCg0kMS+Sy8EzBDFgaQxBJ/M6kFJZVKBnbJ5+GEtsIxT9WAMJ/P GEQdYT9b/nuYn6TUKwxyijCOpVnJnL5pyKD3dlVvR0TI4aEkZ+fiF1DifycJvxcUku75 +m/1q8VsGDr2u1iSfKDUckcBOeycoEwJVMVzgIqkWSrdX4t1mFLhbdeWmcNuCF9KF3jk ENeajY3szA7HKNHxB3EQW8b2umJwoUhpNZIokH2hIS5LVKYQ02WQKdg4NrQhpA7MkDCS gsZg== 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; bh=QajOetIheYc6yFfn5cGXMzoheGBlCxA/mL7SE7Ps7+Y=; b=HCSNcITLlVNGLT4kEJxjgtutiA1pozqSDZ55oAAWWZPE9IeQSu7jtRJys+KCD9Pkzm uosjjfgb0xBNFgZSXvCVUfmgHrqufFPHqmQVvOUd+6tPJDkC/U9pBIEjZ2bt+TjwSjRx cg028R/TPA5vWOSlZYh3+E6qCr8WZMh7q9hdsO5ks/9gzmg6W/SYLWT+t8tjIOUHr+z4 cpDWDez+AdWDovcggxdkvgl0FowA+alz4PmkCqgn1Hy/JGjDdwSd9KNKQakFbvNOlXv3 UyQVyrpvToGD1L4nPo6OBDAGPi5anlRzb7b8zq+iqo/Pyu8FtrnnHOqFdysjbjvGZmTO GbuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=i1GU0TXc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t125si7459307oib.103.2020.04.06.11.18.39; Mon, 06 Apr 2020 11:18: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=@google.com header.s=20161025 header.b=i1GU0TXc; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727641AbgDFSRL (ORCPT + 99 others); Mon, 6 Apr 2020 14:17:11 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:53222 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbgDFSRI (ORCPT ); Mon, 6 Apr 2020 14:17:08 -0400 Received: by mail-pj1-f65.google.com with SMTP id ng8so194537pjb.2 for ; Mon, 06 Apr 2020 11:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QajOetIheYc6yFfn5cGXMzoheGBlCxA/mL7SE7Ps7+Y=; b=i1GU0TXcRTrIK6ml6JtkYY0yUET+I0aZOROJzKxs15NqJj4ooP/Khnpk5SlXzB0pKz lYQvJlybxyZgU5l+H5YtrUX/lSfvM6dUy2Ji53n/c3GKaKhpNHoCzrksnmsCt0jQ6jNu Ema3D+STgHzRn7jQlZY/u8ckaR9CGnnE8fwBJjh/I618ZupFF675g+w3N9PGFt/I8WO6 V0dHWeHrH69undlHyIemld5sXtywcREzJ5tvP9cD1LZgdtFthxnjyVoYU9QN/id363tp aL55rh4VSl9uDAaFUlV8VDQMd74Ya0Nx2EZQK5nuxqXHmy7S/nXn7+tt7GXO89JSNwaW zrbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QajOetIheYc6yFfn5cGXMzoheGBlCxA/mL7SE7Ps7+Y=; b=aCD6o9AhoOrT5gnSDoaFRzYcbYeJs4mAL6q1Kk2D+gduxjjzASTfaiGpenNx0GiaG+ m9GNHgr/2W8qsYmP6XEOOAY4Le9vz3JgMpds8vZkrpklM/BZGxhVhswSNPs0U/jQX2Qv iaVYLPiTlOHjOvOVdyxPQ8f8gL+8NG8QQC7bMp/AVbaPs7IUxIGYMSRSLpgOmOXbwqm3 EYTMGrp7RRRn/XMPmKupPby3Zr9tHkwg8RUrnYralUnCSikqZaMCnhpFmTPHVcpY60fB zBDrf1WjvqL511aq6LZITsjMeLSk9ijEOswM5qI59k3bklEv3+h7OslgvRV6s9uNAsjm 6y4g== X-Gm-Message-State: AGi0PuYBAO40Wy4VbQdxiLW5fnWonXCBGZtXlHIzmyNiGaNh4Nz6EU7+ Xds741uy3U5EXa20RUhBahRAhsp6IjDav4R+5ysOAA== X-Received: by 2002:a17:902:bb91:: with SMTP id m17mr21132416pls.223.1586197027464; Mon, 06 Apr 2020 11:17:07 -0700 (PDT) MIME-Version: 1.0 References: <20200405163052.18942-1-masahiroy@kernel.org> In-Reply-To: <20200405163052.18942-1-masahiroy@kernel.org> From: Nick Desaulniers Date: Mon, 6 Apr 2020 11:16:57 -0700 Message-ID: Subject: Re: [PATCH] MIPS: fw: arc: add __weak to prom_meminit and prom_free_prom_memory To: Masahiro Yamada Cc: Linux Kbuild mailing list , Linux-MIPS , clang-built-linux , LKML , Jiaxun Yang , Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org 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 Sun, Apr 5, 2020 at 9:31 AM Masahiro Yamada wrote: > > As far as I understood, prom_meminit() in arch/mips/fw/arc/memory.c > is overridden by the one in arch/mips/sgi-ip32/ip32-memory.c if > CONFIG_SGI_IP32 is enabled. I'm curious if this issue is affected by other combinations of files that each define prom_meminit with external linkage and symbol visibility. I would expect __weak to be used when there's a base implementation that we expect to be overridden, but I don't think that's what's happening in this case. It's not clear to me which definition would be the default, let alone the one in arch/mips/fw/arc/memory.c. Looks like CONFIG_SGI_IP32 selects CONFIG_FW_ARC, so it's not clear why arch/mips/sgi-ip32/ip32-memory.c and arch/mips/fw/arc/memory.c define different implementations of prom_meminit, and which one was expected to be used. Hopefully the maintainers can clarify. > > The use of EXPORT_SYMBOL in static libraries potentially causes a > problem for the llvm linker [1]. So, I want to forcibly link lib-y > objects to vmlinux when CONFIG_MODULES=y. > > As a groundwork, we must fix multiple definitions that have previously > been hidden by lib-y. > > The prom_cleanup() in this file is already marked as __weak (because > it is overridden by the one in arch/mips/sgi-ip22/ip22-mc.c). > I think it should be OK to do the same for these two. > > [1]: https://github.com/ClangBuiltLinux/linux/issues/515 > > Reported-by: kbuild test robot > Signed-off-by: Masahiro Yamada > --- > > If MIPS maintainers ack this patch, > I want to inser it before the following patch: > > https://patchwork.kernel.org/patch/11432969/ > > arch/mips/fw/arc/memory.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/fw/arc/memory.c b/arch/mips/fw/arc/memory.c > index dbbcddc82823..89fa6e62a3b3 100644 > --- a/arch/mips/fw/arc/memory.c > +++ b/arch/mips/fw/arc/memory.c > @@ -117,7 +117,7 @@ static int __init prom_memtype_classify(union linux_memtypes type) > return memtype_classify_arc(type); > } > > -void __init prom_meminit(void) > +void __weak __init prom_meminit(void) > { > struct linux_mdesc *p; > > @@ -162,7 +162,7 @@ void __weak __init prom_cleanup(void) > { > } > > -void __init prom_free_prom_memory(void) > +void __weak __init prom_free_prom_memory(void) > { > int i; > > -- -- Thanks, ~Nick Desaulniers