[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMo8BfL3Zx2_uYD6yJQgju90JJj5=occjsDtcXZY0E2jmqUhow@mail.gmail.com>
Date: Sat, 13 Mar 2021 00:57:39 -0800
From: Max Filippov <jcmvbkbc@...il.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Chris Zankel <chris@...kel.net>,
"open list:TENSILICA XTENSA PORT (xtensa)"
<linux-xtensa@...ux-xtensa.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] xtensa: move CONFIG_CPU_*_ENDIAN defines to Kconfig
On Fri, Mar 12, 2021 at 7:14 AM Masahiro Yamada <masahiroy@...nel.org> 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 "<stdin>"
> # 1 "<built-in>"
> # 1 "<command-line>"
> # 1 "<stdin>"
> 1
>
> $ echo __XTENSA_EB__ | xtensa-linux-gcc -E -P -
> 1
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
> 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 <jcmvbkbc@...il.com>
Please let me know if I should take it into the xtensa tree or you will
carry it in the kbuild tree.
--
Thanks.
-- Max
Powered by blists - more mailing lists