Received: by 10.213.65.68 with SMTP id h4csp1753446imn; Thu, 5 Apr 2018 03:15:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx48/0ofs9ZDMD1DiQfzAwl8GKHFUvhrmEfpmRuNE9eeYRIVmNBg1X3tuG3KzlBffJsgIfaac X-Received: by 10.98.58.129 with SMTP id v1mr16668349pfj.231.1522923303901; Thu, 05 Apr 2018 03:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522923303; cv=none; d=google.com; s=arc-20160816; b=rccAl/Z0BFYSRCQzbFZtoj/rIqc50kexKIOSrLgnGnGzaJMU5zeypzLLTvQwLb/J01 Fq8ZEWyNvW9qQj9B87PWT9gDnIGlq+JheYV1ofVZgXr1BvIQiUwej8l7WLFNk/ycupeF dSmCMTSkmT4Sl0HZLf0FeUQiMHjtCYT4NDn42NBQE4COi9BNCL2E51lYw/pB4wsU+Kpk UtbiDAUOSxBA4HxaKFxqPfuLE9ODMVHAqSkJ78sACvgkYiVDHYzGpIBv+TTztUo9ZUEj cfYbuivldyqUIbQvEhsgZc7vh16d/15cWWNmR/mQNASH2fh8M4b+QInIfE9LbiQphdxY HKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=6A4QilMQlR1WB6gn7tFnxylqwLMY7P9x+KViVGwMwsg=; b=bMGQ1ffJCkFWNyvLn7zmQbXdK598oqodiYvg9+jwuNiMQV5vrBGjhOoE4dnT+BIhRG zrKRqPT61qicJJdGEyvysg+eHPjzB6sU9aXkVw/Afz+dXupM+0QSFyNICizeJpe4Ht5b kkEj5VzgKeySDQl+Zy39u3v0lJO/KMFrBklSqByVEDSGe0L7pVQvkl422zSED2D+VOuH jnufrc6+cP0vGQdwvIChV6cTaxmb/P58HSnvzkK2ZqPHpSjJKfkFaKTZOuDmVJprJ/Kx 0NcSNcUqG/svhy/B57tX9yMnYdblImsancbrEJM3mFFasu7vYqMatI2eED4S9RHb5aT2 EzAg== 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 31-v6si5424404plz.261.2018.04.05.03.14.49; Thu, 05 Apr 2018 03:15:03 -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 S1751602AbeDEKNQ (ORCPT + 99 others); Thu, 5 Apr 2018 06:13:16 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.154.211]:42628 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbeDEKNO (ORCPT ); Thu, 5 Apr 2018 06:13:14 -0400 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1411.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Thu, 05 Apr 2018 10:13:04 +0000 Received: from [192.168.155.41] (192.168.155.41) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 5 Apr 2018 03:13:15 -0700 Subject: Re: [PATCH] MIPS: vmlinuz: Fix compiler intrinsics location and build directly To: James Hogan , Ralf Baechle CC: , Alban Bedel , Antony Pavlov , Palmer Dabbelt , Bartosz Golaszewski , References: <20180403160728.GB3275@saruman> <1522833502-28007-1-git-send-email-matt.redfearn@mips.com> From: Matt Redfearn Message-ID: Date: Thu, 5 Apr 2018 11:13:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1522833502-28007-1-git-send-email-matt.redfearn@mips.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.155.41] X-ClientProxiedBy: mipsdag02.mipstec.com (10.20.40.47) To mipsdag02.mipstec.com (10.20.40.47) X-BESS-ID: 1522923184-452059-5278-50327-1 X-BESS-VER: 2018.4.1-r1804041913 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191706 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, Actually, this patch would be better inserted as patch 3 in the series since it can pull in the generic ashldi3 before the MIPS one is removed in the final patch. Here's an updated commit message: MIPS: vmlinuz: Use generic ashldi3 and build directly In preparation for removing some of the MIPS compiler intrinsics from arch/mips/lib, first update the build of vmlinuz to use the generic ashldi3 from lib. Both ashldi3 and bswapsi objects need to be built with different CFLAGS for inclusion to vmlinuz rather than simply including the object built for the main kernel image. But the current copy of the source C file to arch/mips/boot/compressed can be avoided by simply calling cmd,cc_o_c to build the object from the source directly. This also removes the need for the .gitignore file to ignore the copied files, and the extra-y rule to clean them. Signed-off-by: Matt Redfearn Thanks, Matt On 04/04/18 10:18, Matt Redfearn wrote: > Since commit "MIPS: use generic GCC library routines from lib/", MIPS > now uses the generic lib/ashldi3.c, but bswapsi.c still comes from > arch/mips/lib. The rules for including these into vmlinuz need updating > to reflect these locations. > Both objects need to be built with different CFLAGS for inclusion to > vmlinuz rather than simply including the object built for the main > kernel image. But the copy of the source C file can be avoided by simply > calling cmd,cc_o_c to build the object from the source directly. This > also removes the need for the .gitignore file to ignore the copied > files, and the extra-y rule to clean them. > > Signed-off-by: Matt Redfearn > --- > > arch/mips/boot/compressed/.gitignore | 2 -- > arch/mips/boot/compressed/Makefile | 8 ++++---- > 2 files changed, 4 insertions(+), 6 deletions(-) > delete mode 100644 arch/mips/boot/compressed/.gitignore > > diff --git a/arch/mips/boot/compressed/.gitignore b/arch/mips/boot/compressed/.gitignore > deleted file mode 100644 > index ebae133f1d00..000000000000 > --- a/arch/mips/boot/compressed/.gitignore > +++ /dev/null > @@ -1,2 +0,0 @@ > -ashldi3.c > -bswapsi.c > diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile > index adce180f3ee4..8f04d659a915 100644 > --- a/arch/mips/boot/compressed/Makefile > +++ b/arch/mips/boot/compressed/Makefile > @@ -46,10 +46,10 @@ $(obj)/uart-ath79.c: $(srctree)/arch/mips/ath79/early_printk.c > > vmlinuzobjs-$(CONFIG_KERNEL_XZ) += $(obj)/ashldi3.o $(obj)/bswapsi.o > > -extra-y += ashldi3.c bswapsi.c > -$(obj)/ashldi3.o $(obj)/bswapsi.o: KBUILD_CFLAGS += -I$(srctree)/arch/mips/lib > -$(obj)/ashldi3.c $(obj)/bswapsi.c: $(obj)/%.c: $(srctree)/arch/mips/lib/%.c > - $(call cmd,shipped) > +$(obj)/ashldi3.o: $(srctree)/lib/ashldi3.c > + $(call cmd,cc_o_c) > +$(obj)/bswapsi.o: $(srctree)/arch/mips/lib/bswapsi.c > + $(call cmd,cc_o_c) > > targets := $(notdir $(vmlinuzobjs-y)) > >