From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net,
Gerd Knorr <kraxel@bytesex.org>
Subject: [uml-devel] Supporting building on x86-64 host as 32-bit UML
Date: Sat, 19 Mar 2005 19:04:02 +0100 [thread overview]
Message-ID: <200503191904.05870.blaisorblade@yahoo.it> (raw)
[-- Attachment #1: Type: text/plain, Size: 1839 bytes --]
It is really difficult for the end-user (and tricky for a developer) to build
a 32-bit UML on a 64-bit host box...
I would like to address this, but I've not definite ideas.
The problems are:
1) how the user must choose what he wants (SUBARCH=i386 can be useful, maybe a
Kconfig option would be nice - we need to choose the default depending on the
host arch).
2) using the proper options for the tools (addressed partially by the patch
below)
3) using the proper headers (asm-i386 instead of asm-x86_64)... Fedora (I
don't know about SuSE and my Gentoo is 32-bit still) uses some smart headers
that select the correct version, basing on some macros defined by GCC:
#ifndef __ASM_STUB_SYSTEM_H__
# define __ASM_STUB_SYSTEM_H__
# if defined __x86_64__
# include <asm-x86_64/system.h>
# endif
# if defined __i386__
# include <asm-i386/system.h>
# endif
#endif
The problem is that we explicitly refuse to define these macros, like this:
CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH)
(from arch/um/Makefile-i386) for which I don't find a valid reason... I first
thought this was
diff -puN arch/um/Makefile~uml-build-on-x86_64_as_i386 arch/um/Makefile
--- linux-2.6.9-current/arch/um/Makefile~uml-build-on-x86_64_as_i386
2004-09-26 19:51:43.000000000 +0200
+++ linux-2.6.9-current-paolo/arch/um/Makefile 2004-09-26 19:59:17.000000000
+0200
@@ -34,6 +34,13 @@ endif
ARCH_INCLUDE := -I$(ARCH_DIR)/include
SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
+AFLAGS += -m32
+CFLAGS += -m32
+LDFLAGS += -melf_i386
+HOSTCFLAGS += -m32
+HOSTLDFLAGS += -m32
+export HOSTLDFLAGS
+
include $(ARCH_DIR)/Makefile-$(SUBARCH)
include $(ARCH_DIR)/Makefile-os-$(OS)
--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade
[-- Attachment #2: uml-build-on-x86_64_as_i386.patch --]
[-- Type: text/x-diff, Size: 758 bytes --]
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---
linux-2.6.9-current-paolo/arch/um/Makefile | 7 +++++++
1 files changed, 7 insertions(+)
diff -puN arch/um/Makefile~uml-build-on-x86_64_as_i386 arch/um/Makefile
--- linux-2.6.9-current/arch/um/Makefile~uml-build-on-x86_64_as_i386 2004-09-26 19:51:43.000000000 +0200
+++ linux-2.6.9-current-paolo/arch/um/Makefile 2004-09-26 19:59:17.000000000 +0200
@@ -34,6 +34,13 @@ endif
ARCH_INCLUDE := -I$(ARCH_DIR)/include
SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
+AFLAGS += -m32
+CFLAGS += -m32
+LDFLAGS += -melf_i386
+HOSTCFLAGS += -m32
+HOSTLDFLAGS += -m32
+export HOSTLDFLAGS
+
include $(ARCH_DIR)/Makefile-$(SUBARCH)
include $(ARCH_DIR)/Makefile-os-$(OS)
_
next reply other threads:[~2005-03-20 10:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-19 18:04 Blaisorblade [this message]
2005-03-20 15:03 ` [uml-devel] Re: Supporting building on x86-64 host as 32-bit UML Gerd Knorr
2005-03-22 17:53 ` Blaisorblade
2005-03-22 19:07 ` Gerd Knorr
2005-03-22 20:02 ` Blaisorblade
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=200503191904.05870.blaisorblade@yahoo.it \
--to=blaisorblade@yahoo.it \
--cc=kraxel@bytesex.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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