[PATCH] x86: fix UTS_MACHINE to be "i386" for 32-bit build and "x86_64" for 64-bit build

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Sam Ravnborg <sam@...>
Cc: H. Peter Anvin <hpa@...>, <linux-kbuild@...>, <linux-kernel@...>
Date: Saturday, November 17, 2007 - 6:16 am

On Sat, Nov 17, 2007 at 08:57:15AM +0100, Sam Ravnborg wrote:


IMHO we shouldn't add another config option.
Just correctly set UTS_MACHINE in arch/x86/Makefile will do it.

I wasn't aware where the machine name came from.
Now that I know that (and shamelessly copying ideas from s390;-)
it is easy to fix. See attached patch.

Testing a crosscompiled 32-bit-kernel I now get
    # uname -m
    i686
on my K7.

Other tests will follow. But patch looks sane and should go mainline asap, I think.


Regards,

Andreas

--
x86: fix UTS_MACHINE to be "i386" for 32-bit build and "x86_64" for 64-bit build.

Signed-off-by: Andreas Herrmann <aherrman@arcor.de>
---
 arch/x86/Makefile |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 116b03a..7aa1dc6 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -11,10 +11,9 @@ endif
 $(srctree)/arch/x86/Makefile%: ;
 
 ifeq ($(CONFIG_X86_32),y)
+        UTS_MACHINE := i386
         include $(srctree)/arch/x86/Makefile_32
 else
+        UTS_MACHINE := x86_64
         include $(srctree)/arch/x86/Makefile_64
 endif
-
-
-
-- 
1.5.3.4


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Kconfig: ARCH=x86, Andreas Herrmann, (Fri Nov 16, 7:14 am)
Re: Kconfig: ARCH=x86, Sam Ravnborg, (Fri Nov 16, 8:58 am)
Re: Kconfig: ARCH=x86, Andreas Herrmann, (Fri Nov 16, 8:43 am)
Kconfig: ARCH=x86 causes wrong utsname.machine, Andreas Herrmann, (Fri Nov 16, 8:37 am)
Re: Kconfig: ARCH=x86 causes wrong utsname.machine, H. Peter Anvin, (Fri Nov 16, 11:20 am)
Re: Kconfig: ARCH=x86 causes wrong utsname.machine, Sam Ravnborg, (Fri Nov 16, 6:15 pm)
Re: Kconfig: ARCH=x86 causes wrong utsname.machine, H. Peter Anvin, (Fri Nov 16, 6:58 pm)
Re: Kconfig: ARCH=x86 causes wrong utsname.machine, Sam Ravnborg, (Sat Nov 17, 3:57 am)
[PATCH] x86: fix UTS_MACHINE to be "i386" for 32-bit build a..., Andreas Herrmann, (Sat Nov 17, 6:16 am)
Re: Kconfig: ARCH=x86 causes wrong utsname.machine, H. Peter Anvin, (Fri Nov 16, 7:33 pm)