Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3227117ybb; Mon, 6 Apr 2020 04:54:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKVBdn1XzuGI7Hsv0oT7iTGS6aIMalRS6kTpLzRfo6b9eXLVT1+Jd10Hpo3sy6an6iPU5ft X-Received: by 2002:a9d:7402:: with SMTP id n2mr17623941otk.262.1586174083976; Mon, 06 Apr 2020 04:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586174083; cv=none; d=google.com; s=arc-20160816; b=vktAjxCmDpLED/9rJjza28/MiCLSIvNbRh3mY8zv4Qw3sspahr3p4MuaU6swKbs1jg MCgL2SNAuA9nHFoVlrnS7xtSZzqhdqUsFP2mncehODQFExS3fU2ni5mbA14p5EN+/u4n oXn6V2/bIwEbjOn/HwJH4P6sl4zkIMiD0fNnhvaj9yRlVZTcraWzPpo8RG9er8Go4wLw Tt+Gnx5x/Odiy1dMkbPxBvnyJu9hGJAAV+rbTk9wBDFLKeimQ8jJAHqss7h0GS7XdLTU K5bcOtDbvwr3tPbKDjB66OS5oOf2qYyClQuHP0Yh65RZ8RY2vQgJ2lHuW3xAIQF+Xioy NXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date; bh=90zdxiGkkjEo6hzoYlc+N5NSRTOvQBmG1caBQp/eR3o=; b=s8zbyW66UihQ0DnaTipjjah4mEACXqrtCSFJbQ6roGO2krxMySWa+FLBxngl+dvqZs DxGTajyJp6xlnH8phppEulUejEjYg+BXJgZrjJOjbHYniy+xYwPaIeP2YIKX/BSmR1Os Y6usny3aHnWGFj/53K4ylTmGfic4581AyWgNzWKfirDv9OtmtPasAy4om4yha3SkkvP6 BBTx2/tMRjModTCln5lDhkkP0txEnp4643sZdW97ILfryLJQWXdN/wlA6XEECXixihNX NmTH8mpOfiPkR+aUfLZwOIKK/78/YZknjAVrO3zibBhDw9sYzRtjbL16MKcMlRjChNfT Cetw== ARC-Authentication-Results: i=1; mx.google.com; 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 x14si7278013ooq.78.2020.04.06.04.54.31; Mon, 06 Apr 2020 04:54:43 -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; 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 S1727582AbgDFLyS (ORCPT + 99 others); Mon, 6 Apr 2020 07:54:18 -0400 Received: from eddie.linux-mips.org ([148.251.95.138]:34734 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727192AbgDFLyR (ORCPT ); Mon, 6 Apr 2020 07:54:17 -0400 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23992976AbgDFLyOZ7Nfb (ORCPT + 2 others); Mon, 6 Apr 2020 13:54:14 +0200 Date: Mon, 6 Apr 2020 12:54:14 +0100 (BST) From: "Maciej W. Rozycki" To: Masahiro Yamada cc: Linux Kbuild mailing list , Linux-MIPS , clang-built-linux , Linux Kernel Mailing List , Jiaxun Yang , Paul Burton , Thomas Bogendoerfer , linux-mips@vger.kernel.org, =?UTF-8?Q?F=C4=81ng-ru=C3=AC_S=C3=B2ng?= Subject: Re: [PATCH] MIPS: fw: arc: add __weak to prom_meminit and prom_free_prom_memory In-Reply-To: Message-ID: References: <20200405163052.18942-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 6 Apr 2020, 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. > > > > > > 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. > > > > It looks to me like a bug in the linker in the handling of the EXTERN > > command. Why not fix the linker instead? [...] > I am not sure if this is a bug. > Anyway, they decided to not change ld.lld Well, maybe that was a conscious decision, however it's a linker feature that has been there since forever and projects like Linux can legitimately rely on it. In this case perhaps sticking to other linkers, which have the right features, is the right solution rather than trying to turn a complex and mature project like Linux upside down (and quite possibly introducing bugs and pessimisations on the way) just to match an inferior tool. Adapt your tool to the task, not the task to your tool. > MIPS code is so confusing. > There are multiple definitions, > and lib.a is (ab)used to hide them. It's a standard feature of libraries that a symbol reference is satisfied by the first symbol definition encountered. Any extra ones provided later in the link order are ignored. And we have control over the link order. > I fixed another one for MIPS before, and > 0-day bot reported this recently. > > > There are lots of prom_meminit() definitions > in arch/mips/. Naturally, many platforms will have its own, in addition to some generic (possibly dummy) one. > Making the intention clearer is a good thing, IMHO. Hmm, what intention? Can you please be more specific? Maciej