Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1986476pxf; Sat, 13 Mar 2021 04:14:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwf6/tQ8FxXCOMp1yaj+XDvN4Cdlrjp68nLUuQEVYaaA97X+1kHrUvsl1eQ0VywUNug15Db X-Received: by 2002:aa7:c3cd:: with SMTP id l13mr19392900edr.52.1615637669716; Sat, 13 Mar 2021 04:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615637669; cv=none; d=google.com; s=arc-20160816; b=S4RazMUOFAmfA4JFjZAZYJCyu8LtpYKweRRSd2PLmFvvOXx6coMfx+5ra6rshuShI4 QtC+i6R+5qcz1kYuEwh6uXdh66uoe2O18bZO6jilecxfU57Pzk+Nca5G8gsvwxF0RSEz GuysvH59WTb6k2gM1TQxVnoPr7rSYGx5PeyhrSoOznaAWSulF1bl1w8Q/Bh83ZtzC0+B KQTVeSrZVZr+qaI26vwrgPZHLNLAVN+pMOqDXsKdAdnP1i74p1xARdl0ncw1PEAPfkWp EbZkMyRlMM6Mtrpne8nSoLUnZTwXCvaXRxksjtIv8jUouBwXflzYpbP1bSARctyCmuhf uHyA== 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=JF14MXVjNJP1v4CgLXuDskri7mZ0masa0jozJ64DhYE=; b=igJOuLzP0rY3qOcTd1wrIHi+kTn/PrXGDidzMxAbYM/i9CU/QzErvWTrMKmnDh92g4 cudhwYl8s3Yoc7/I2rmbQdrKwHtL0tRK037Xl23txklbgWzqxq6J50CAzfUKPA4VzmyV uThp4LsfCFnDLofJiDMZQNqfWv4LG81MolGA58Ec2zDDRybC9OCEgTY9GMI6VLARdFjz 5BzI9i5FbAQzu4rNTx9+FRPtOY8bclS48KCS6d9P87OZO4Ku09WWxXH9YzevaErCordA of0PDgWgFiCo7rEwLnZ9TP1WGIQW+3xCH+jY97Kzs1OUy80x5uDbN3SWbNK6EpO1YFI0 QVqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=MyEUGxvw; 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 f25si6403422eja.117.2021.03.13.04.14.06; Sat, 13 Mar 2021 04:14:29 -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=MyEUGxvw; 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 S233507AbhCMMLx (ORCPT + 99 others); Sat, 13 Mar 2021 07:11:53 -0500 Received: from conssluserg-02.nifty.com ([210.131.2.81]:28314 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbhCMMLi (ORCPT ); Sat, 13 Mar 2021 07:11:38 -0500 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 12DCBFCX006416 for ; Sat, 13 Mar 2021 21:11:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 12DCBFCX006416 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1615637476; bh=JF14MXVjNJP1v4CgLXuDskri7mZ0masa0jozJ64DhYE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MyEUGxvwnE/3xRA/aj3QnVhmp/cy8llGwTVsS/QGJOGirTlwFVpHcXXWlcEpD7q7B jPd/ORnJmsKb5vahxrqdAfKkYPsm6YEH+E51/08wpfLSTHQd3J5vXIBAdHKdQHPF3S Oqb0A2kJc7FWXfFA5zLA1xs06Et1pQ0Jh0joyWzg2CpYIi7Elnav8T3J/GvCdUXlYd 1g/uZ3yscLY8whvwzkvr98CVWBiQIIH6Inmy4nE+Fy8sNfyKFMzI3GBKD5uShIf+8M WQme7ud0dKUFh9kzr6+EKmHZs6ANDkOuTBRCSaY22ev6dby2hKdhn7NvH66WI+BHeo kGE25UbFmLgYw== X-Nifty-SrcIP: [209.85.214.180] Received: by mail-pl1-f180.google.com with SMTP id d23so9941716plq.2 for ; Sat, 13 Mar 2021 04:11:16 -0800 (PST) X-Gm-Message-State: AOAM5322znkUgsEFLMtWS/Ass+wZ5vMQCyBks38qs4mX160i8wV1y20w xugjlaLYFtha0JBHd7BF7dqCU7u+4P8ctTUb0v4= X-Received: by 2002:a17:902:b589:b029:e6:2875:aa4c with SMTP id a9-20020a170902b589b02900e62875aa4cmr3070985pls.71.1615637475398; Sat, 13 Mar 2021 04:11:15 -0800 (PST) MIME-Version: 1.0 References: <20210312151411.101942-1-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Sat, 13 Mar 2021 21:10:37 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] xtensa: move CONFIG_CPU_*_ENDIAN defines to Kconfig To: Max Filippov Cc: Chris Zankel , "open list:TENSILICA XTENSA PORT (xtensa)" , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 13, 2021 at 9:03 PM Masahiro Yamada wrote: > > On Sat, Mar 13, 2021 at 5:57 PM Max Filippov wrote: > > > > On Fri, Mar 12, 2021 at 7:14 AM Masahiro Yamada wrote: > > > > > > Move the definition of CONFIG_CPU_*_ENDIAN to Kconfig, the best place > > > for CONFIG options. > > > > > > I slightly simplified the test code. You can use the -P option to suppress > > > linemarker generation. The grep command is unneeded. > > > > > > $ echo __XTENSA_EB__ | xtensa-linux-gcc -E - > > > # 1 "" > > > # 1 "" > > > # 1 "" > > > # 1 "" > > > 1 > > > > > > $ echo __XTENSA_EB__ | xtensa-linux-gcc -E -P - > > > 1 > > > > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > If I understood correctly, xtensa compilers can support either > > > big-endian or little-endian. We cannot change it via a command option. > > > Actually, it does not understand -mbig-endian or -mlittle-endian. > > > (Is this correct?) > > > > This is correct. The idea is that specific xtensa core has fixed endianness, > > but it can be either little or big. The toolchain is configured for the specific > > xtensa core at build time, so there's no need for a runtime endian switch. > > > > > $ xtensa-linux-gcc -mbig-endian /dev/null -c -o /dev/null > > > xtensa-linux-gcc: error: unrecognized command-line option '-mbig-endian' > > > > > > I see -mbig-endian / -mlittle-endian in old GCC manual. > > > https://gcc.gnu.org/onlinedocs/gcc-3.3.5/gcc/Xtensa-Options.html > > > But, I cannot see them in recent gcc manuals. > > > So, I have no idea better than checking __XTENSA_EB__ or __XTENSA_EL__. > > > I just moved the logic to Kconfig from Makefile. > > > > > > > > > arch/xtensa/Kconfig | 6 ++++++ > > > arch/xtensa/Makefile | 9 +-------- > > > 2 files changed, 7 insertions(+), 8 deletions(-) > > > > Acked-by: Max Filippov > > Please let me know if I should take it into the xtensa tree or you will > > carry it in the kbuild tree. > > > Please apply it to the xtensa tree. > Ah, wait. I think I can do a little more cleanups. arch/xtensa/boot/Makefile:BIG_ENDIAN := $(shell echo __XTENSA_EB__ | $(CC) -E - | grep -v "\#") Will send v2. -- Best Regards Masahiro Yamada