public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Linus Torvalds <torvalds@Osdl.ORG>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Allow compiling i386 with an x86-64 compiler
Date: Wed, 24 Nov 2004 08:22:05 -0800	[thread overview]
Message-ID: <41A4B52D.2030402@zytor.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

This patch adds -m32 if gcc supports it, thus making it easier to 
compile the i386 architecture with an x86-64 compiler.

Note that it adds the option to CC, since it also affects assembly code 
and linking.  The extra level of indirection is because $(call 
cc-option) itself uses $(CC), so just doing CC += ... would cause $(CC) 
to be recursively defined.

	-hpa


Signed-Off-By: H. Peter Anvin <hpa@zytor.com>

[-- Attachment #2: build_on_x86_64.diff --]
[-- Type: text/x-patch, Size: 602 bytes --]

Index: linux-2.5/arch/i386/Makefile
===================================================================
RCS file: /home/hpa/kernel/bkcvs/linux-2.5/arch/i386/Makefile,v
retrieving revision 1.72
diff -u -r1.72 Makefile
--- linux-2.5/arch/i386/Makefile	27 Oct 2004 17:27:13 -0000	1.72
+++ linux-2.5/arch/i386/Makefile	23 Nov 2004 02:04:09 -0000
@@ -20,6 +20,10 @@
 LDFLAGS_vmlinux :=
 CHECKFLAGS	+= -D__i386__
 
+# This allows compilation with an x86-64 compiler
+CC_M32		:= $(call cc-option,-m32)
+CC 		+= $(CC_M32)
+
 CFLAGS += -pipe -msoft-float
 
 # prevent gcc from keeping the stack 16 byte aligned

             reply	other threads:[~2004-11-24 22:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-24 16:22 H. Peter Anvin [this message]
2004-11-29 18:50 ` [PATCH] Allow compiling i386 with an x86-64 compiler Tom Rini
2004-11-29 19:25   ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41A4B52D.2030402@zytor.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@Osdl.ORG \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox