[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Confused about 64bit



Graham Smith wrote:

Hi, I'm confused and I hope that you can help me out.

I'm running the pure64 port of Debian on an AMD64.

My understanding about the AMD64 was that is could run in three modes:

1)32 bit emulation mode where you are using a 32bit kernel and 32 bit libraries (eg WinXP). 2)mixed mode with a 64 bit kernel and 32 bit libraries (eg "Normal" Debian with 64 bit kernel)
3)full 64 bit mode (64bit Debian port)

Note that 2) and 3) is exactly the same, from the processor point of view. Case 3) simply have more 64-bit programs and libraries installed - it will run 32-bit software just fine.

32-bit sw in case 3) often run into a practical problem though, most programs don't
stand alone, they use libraries. 32-bit programs want 32-bit libraries (or
some compatibility layer) and 64-bit programs want 64-bit libraries. Unfortunately, libraries have the same name no matter if they're 32- or 64-bit, so you can only
have one kind at a time.  Unless you set up a chroot or use other tricks.

I now run 64-bit debian.  I have my entire old 32-bit installation available
on disk though, I occationally chroots into it in order to use 32-bit only
programs like opera and wine. (Also a nice option for those who like openoffice.)


I thought that in full 64 bit mode it was impossible to run 32 bit applications unless the 32 bit libraries had been tweaked to allow it. But, and here's the strange bit, I am running the 32 bit Sun Java VM under the 64 bit environment quite happily without the ia32-libs package installed. How come this works? Surely the VM is compiled against 32 bit libraries and therefore shouldn't work when running against the 64 bit ones? That of course then raises the question why don't other 32 bit applications like OO work under 64 bit?

I suspect there is a hole in my knowledge but I don't know where. A quick lesson would be appreciated. Many thanks,

Now this seems strange. A standalone 32-bit program will work of course, but then it can't use libraries at all. Not even the C library. Few such programs exist. You are sure this _is_ 32-bit software? And you are sure you don't have ia32-libs in any way or form? Not even some old unofficial package or a source install under /user/local? And you are sure it is this 32-bit java that gets used? You don't have a 64-bit one also?
Anyway, nice that it works. :-)

If you want to know what libraries a program uses, use ldd.  Example:
ldd /bin/ls
       librt.so.1 => /lib/librt.so.1 (0x0000002a9566c000)
       libacl.so.1 => /lib/libacl.so.1 (0x0000002a95774000)
       libc.so.6 => /lib/libc.so.6 (0x0000002a9587b000)
       libpthread.so.0 => /lib/libpthread.so.0 (0x0000002a95aba000)
/lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x0000002a95556000)
       libattr.so.1 => /lib/libattr.so.1 (0x0000002a95bcf000)

Here we see what libs "ls" needs to run. You can do something similiar for your java. To check wether executables and libraries are 32- or 64-bit, use the "file" command:

file /bin/ls
/bin/ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), stripped

file /lib/librt.so.1
/lib/librt.so.1: symbolic link to `librt-2.3.2.so'

file /lib/librt-2.3.2.so
/lib/librt-2.3.2.so: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), stripped

Here we see that "ls" and one of its libraries indeed are 64-bit on my machine.

Helge Hafting

Helge Hafting



Reply to: