[PATCH] x86: fix UTS_MACHINE to be "i386" for 32-bit build and "x86_64" for 64-bit build
On Sat, Nov 17, 2007 at 08:57:15AM +0100, Sam Ravnborg wrote: > > > > > >Any good suggestions here??? > > >UTS_MACHINE is set in top-level Makefile and if we specify > > >make ARCH=x86 > > >we do not know if i386 or x86_&4 is correct until the configuration > > >has been read. > > > > > >Should we report a "make ARCH=x86" as uname -m == x86?? > > > > > > > That would break 5 years of a stable ABI. I don't think that is even > > remotely feasible. > > I will try to cook up a patch that sets CONFIG_UTS_MACHINE > and then we will use that value unless it is undefined in which > case we fall back to UTS_MACHINE (as today). 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 <[EMAIL PROTECTED]> --- 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] x86: fix UTS_MACHINE to be i386 for 32-bit build and x86_64 for 64-bit build
On Sat, Nov 17, 2007 at 03:37:31PM +0100, Sam Ravnborg wrote: > > Note: This patch does not fix the uname -m issue - to do so > Andreas' patch is needed. > > Sam Linus, The issue Sam refers to is that UTS_MACHINE is set to "x86" instead of "i386" or "x86_64" when building with ARCH=x86. Thus the new kernel when booted will give either "x86" on x86_64 and many i386 systems or even "x66" on other i386 systems for 'uname -m'. Many tools rely on the usual values of "x86_64", "i366" and "i686" here. So we shouldn't change this. Attached patch fixes that issue. Please apply. Regards, Andreas -- x86: fix UTS_MACHINE to be i386 for 32-bit build and x86_64 for 64-bit build Cc: Thomas Gleixner <[EMAIL PROTECTED]> Cc: Ingo Molnar <[EMAIL PROTECTED]> Cc: "H. Peter Anvin" <[EMAIL PROTECTED]> Cc: Sam Ravnborg <[EMAIL PROTECTED]> Cc: Roman Zippel <[EMAIL PROTECTED]> Signed-off-by: Andreas Herrmann <[EMAIL PROTECTED]> --- 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] x86: fix UTS_MACHINE to be i386 for 32-bit build and x86_64 for 64-bit build
On Mon, Nov 19, 2007 at 10:34:37AM +0100, Andreas Herrmann wrote: > On Sat, Nov 17, 2007 at 03:37:31PM +0100, Sam Ravnborg wrote: > > > > Note: This patch does not fix the uname -m issue - to do so > > Andreas' patch is needed. > > > > Sam > > Linus, > > The issue Sam refers to is that UTS_MACHINE is set to "x86" instead of > "i386" or "x86_64" when building with ARCH=x86. Thus the new kernel > when booted will give either "x86" on x86_64 and many i386 systems or > even "x66" on other i386 systems for 'uname -m'. > > Many tools rely on the usual values of "x86_64", "i366" and "i686" > here. So we shouldn't change this. Andreas - I will suggest you to submit a new patch with a better changelog where you jsut describe what you fix. The above explanations looks a bit weird if read stand alone. You can always add additional comments after the line containing: --- In this way it is not included in the changelog but Linus can read it. Anyway - your patch has my ack. Sam > > Attached patch fixes that issue. Please apply. > > > Regards, > > Andreas > > -- > x86: fix UTS_MACHINE to be i386 for 32-bit build and x86_64 for 64-bit build > > Cc: Thomas Gleixner <[EMAIL PROTECTED]> > Cc: Ingo Molnar <[EMAIL PROTECTED]> > Cc: "H. Peter Anvin" <[EMAIL PROTECTED]> > Cc: Sam Ravnborg <[EMAIL PROTECTED]> > Cc: Roman Zippel <[EMAIL PROTECTED]> > Signed-off-by: Andreas Herrmann <[EMAIL PROTECTED]> Acked-by: Sam Ravnborg <[EMAIL PROTECTED]> > --- > 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 > > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] x86: fix UTS_MACHINE to be i386 for 32-bit build and x86_64 for 64-bit build
On Mon, Nov 19, 2007 at 11:41:29AM +0100, Sam Ravnborg wrote: > On Mon, Nov 19, 2007 at 10:34:37AM +0100, Andreas Herrmann wrote: > > On Sat, Nov 17, 2007 at 03:37:31PM +0100, Sam Ravnborg wrote: > > > > > > Note: This patch does not fix the uname -m issue - to do so > > > Andreas' patch is needed. > > > > > > Sam > > > > Linus, > > > > The issue Sam refers to is that UTS_MACHINE is set to "x86" instead of > > "i386" or "x86_64" when building with ARCH=x86. Thus the new kernel > > when booted will give either "x86" on x86_64 and many i386 systems or > > even "x66" on other i386 systems for 'uname -m'. > > > > Many tools rely on the usual values of "x86_64", "i366" and "i686" > > here. So we shouldn't change this. > > Andreas - I will suggest you to submit a new patch with > a better changelog where you jsut describe what you fix. > The above explanations looks a bit weird if read stand alone. Ok, I'll resend the patch with an updated changelog asap. > You can always add additional comments after the line containing: > --- > > In this way it is not included in the changelog but Linus can read it. > > Anyway - your patch has my ack. Thanks, Andreas - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/