Re: [PATCH RFC] MIPS: Make UTS_MACHINE reflect big-endian/little-endian

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Huacai,

On Wed, Jul 11, 2018 at 04:28:17PM +0800, Huacai Chen wrote:
> It seems like some application use "uname" command's output to do
> something different between big-endian and little-endian, so we make
> UTS_MACHINE reflect both 32bit/64bit and big-endian/little-endian.

Since UTS_MACHINE is exposed to userland (which is of course the point
of your patch) I'm not comfortable changing it. If some piece of code
checks whether uname -m gives "mips" then we'd break it by suddenly
giving "mipsel". This is too risky.

Which applications are you talking about that look for endianness in
uname output? Since Linux on MIPS doesn't expose endianness information
in this way these applications will always have been broken on MIPS
systems, and it would make more sense to fix the applications than to
change the kernel & probably break others.

Thanks,
    Paul

> diff --git a/arch/mips/Makefile b/arch/mips/Makefile
> index e2122cc..a21c3a1 100644
> --- a/arch/mips/Makefile
> +++ b/arch/mips/Makefile
> @@ -38,11 +38,11 @@ endif
>  
>  ifdef CONFIG_32BIT
>  tool-archpref		= $(32bit-tool-archpref)
> -UTS_MACHINE		:= mips
> +UTS_MACHINE		:= $(32bit-tool-archpref)
>  endif
>  ifdef CONFIG_64BIT
>  tool-archpref		= $(64bit-tool-archpref)
> -UTS_MACHINE		:= mips64
> +UTS_MACHINE		:= $(64bit-tool-archpref)
>  endif




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux