From patchwork Tue May 15 05:24:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 10399895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 01418601F7 for ; Tue, 15 May 2018 05:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9259E28632 for ; Tue, 15 May 2018 05:24:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84C9428630; Tue, 15 May 2018 05:24:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D42BF28630 for ; Tue, 15 May 2018 05:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752284AbeEOFYX (ORCPT ); Tue, 15 May 2018 01:24:23 -0400 Received: from ozlabs.org ([203.11.71.1]:54071 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbeEOFYX (ORCPT ); Tue, 15 May 2018 01:24:23 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 40lQwj3c72z9s08; Tue, 15 May 2018 15:24:21 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Steven Rostedt , Nicholas Piggin Cc: Masahiro Yamada , linuxppc-dev@lists.ozlabs.org, linux-kbuild@vger.kernel.org Subject: Re: [PATCH v3 3/4] powerpc/kbuild: Use flags variables rather than overriding LD/CC/AS In-Reply-To: <20180514112826.1b820335@gandalf.local.home> References: <20180514035228.21316-1-npiggin@gmail.com> <20180514035228.21316-4-npiggin@gmail.com> <20180514112826.1b820335@gandalf.local.home> Date: Tue, 15 May 2018 15:24:21 +1000 Message-ID: <87tvr9o5iy.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Steven Rostedt writes: > On Mon, 14 May 2018 13:52:27 +1000 > Nicholas Piggin wrote: >> The powerpc toolchain can compile combinations of 32/64 bit and >> big/little endian, so it's convenient to consider, e.g., >> >> `CC -m64 -mbig-endian` >> >> To be the C compiler for the purpose of invoking it to build target >> artifacts. So overriding the the CC variable to include thse flags ... >> diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl >> index 191eb949d52c..3c67304a7425 100755 >> --- a/scripts/recordmcount.pl >> +++ b/scripts/recordmcount.pl >> @@ -274,6 +274,13 @@ if ($arch eq "x86_64") { >> if ($bits == 64) { >> $type = ".quad"; >> } >> + if ($endian eq "big") { >> + $cc .= " -mbig-endian "; >> + $ld .= " -EB "; >> + } else { >> + $cc .= " -mlittle-endian "; >> + $ld .= " -EL "; >> + } > > Have you tried building all current archs with function tracing enabled > to make sure this doesn't break any of them? I can do it if you want. We shouldn't need to should we? This is only touching powerpc specific code (if I understand perl that is). eg: $ git diff -U9 scripts/recordmcount.pl cheers Acked-by: Steven Rostedt (VMware) --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 191eb949d52c..3c67304a7425 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -268,18 +268,25 @@ if ($arch eq "x86_64") { } elsif ($arch eq "powerpc") { $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; # See comment in the sparc64 section for why we use '\w'. $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:"; $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$"; if ($bits == 64) { $type = ".quad"; } + if ($endian eq "big") { + $cc .= " -mbig-endian "; + $ld .= " -EB "; + } else { + $cc .= " -mlittle-endian "; + $ld .= " -EL "; + } } elsif ($arch eq "arm") { $alignment = 2; $section_type = '%progbits'; $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" . "\\s+(__gnu_mcount_nc|mcount)\$"; } elsif ($arch eq "arm64") { $alignment = 3;