On Thu, 23 Mar 2006, Blaisorblade wrote:
> On Thursday 23 March 2006 00:55, David Lang wrote:
>> is there a way to build a i386 uml kernal on amd64?
>> I have a 64 bit debian build on my main box, but I need to run a uml
>> instance useing a 32 bit debian system image. I've attempted to use the
>> same uml kernel that I have been useing for my earlier attempts, but it
>> dies with an oops complaining about a missing init.
>> I'm currently trying to see if recompiling my host kernel to support ia32
>> binaries makes a difference, but I suspect that it won't (it may allow me
>> to compile a uml kernel on a 32 bit machine and use it for this, that will
>> be my next test)
> That's _required_ but not enough; to run a 32-bit UML binary you _need_ that
> support on the host.
yep, I didn't realize it was missing before this test.
shouldn't there be a way to turn on this ability on a UML kernel? (so that
it can run a mixed 32/64 userspace)
> Btw, you can also download pre-built UML binaries from my homepage (see
> signature), and this is useful even to determine what's going on (e.g. say
> that binary work, your one doesn't, let's compare configurations! Or a couple
> of months ago the answer was "let's blame this GCC", but this story is now
sorry, I've been building cusom kernels too long. it never occured to me
to download a kernel from anywhere else (even distro kernels are only on
my machines long enough to install, download the latest kernel.org source,
and recompile. and that's assuming I don't have a kernel sitting ready
from another box :-)
> It's ages I don't build a 32-bit binary on a 32-bit system. Simply replace
> "ARCH=um" with "ARCH=um SUBARCH=i386" in all the configuration commands.
> However, this presumes that libs to link/run 32-bit programs are installed.
thanks, I hadn't known about SUBARCH before this.
unfortunantly it doesn't seem to work for me
make ARCH=um SUBARCH=i386 mrproper
copy ../config.uml-64 .config
make ARCH=um SUBARCH=i386 oldconfig
make ARCH=um SUBARCH=i386
secdev:/usr/src/linux-2.6.16# make ARCH=um SUBARCH=i386
gcc -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer -D__arch_um__ -DSUBARCH=\"i386\" -Dvmap=kernel_vmap -Din6addr_loopback=kernel_in6addr_loopback -Iarch/um/include -I/usr/src/linux-2.6.16/arch/um/include/skas -D_FILE_OFFSET_BITS=64 -m32 -march=athlon -mpreferred-stack-boundary=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -S -o arch/um/user-offsets.s
arch/um/sys-i386/user-offsets.c: In function `foo':
arch/um/sys-i386/user-offsets.c:51: error: invalid application of `sizeof' to an incomplete type
arch/um/sys-i386/user-offsets.c:53: error: `EIP' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:53: error: (Each undeclared identifier is reported only once
arch/um/sys-i386/user-offsets.c:53: error: for each function it appears in.)
arch/um/sys-i386/user-offsets.c:54: error: `UESP' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:55: error: `EFL' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:56: error: `EAX' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:57: error: `EBX' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:58: error: `ECX' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:59: error: `EDX' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:60: error: `ESI' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:61: error: `EDI' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:62: error: `EBP' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:63: error: `CS' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:64: error: `SS' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:65: error: `DS' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:66: error: `FS' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:67: error: `ES' undeclared (first use in this function)
arch/um/sys-i386/user-offsets.c:68: error: `GS' undeclared (first use in this function)
make: *** [arch/um/user-offsets.s] Error 1
> At least glibc, but I guess this is not the case for you since your kernel
> didn't support 32-bit binaries.
> You say:
>> "compiling a uml kernel on a i386 and trying to run in resulted in 'file
>> not found' (shared libraries not there for the 32 bit software on the 64
>> bit system)"
> this can mostly or totally be solved by enabling "Static linking" near where
> you disable TT mode (which has also other unrelated advantages).
compiling the new 64 bit kernel as I type
> For the last error you get, try adding stderr=1 and see if something more is
> reported. That error is likely caused by some yet-to-be-determined simple
> misconfiguration (say, in the image something is missing). But I'd test first
> with static linking.
I get the exact same error with a static UML kernel (compiled from the 32
bit system) as with the dynamic one, and adding stderr=1 makes no change.
when I get into the office tomorrow I'll download some 32 bit kernels from
your site and give them a try.