15

How was the transition to 64 bits handled on Linux/Unix? The Windows world still seems to have issues with it and I'm curious how it was handled in the *nix world.

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
Louis Salin
  • 1,433
  • 14
  • 18

4 Answers4

12

The work required to make the kernel 64-bit was done a looooong time ago using DEC Alpha systems. Programs, however, are a different matter.

The general consensus that I've seen so far seems to be:

  • Separate /lib and /lib64 directories for systems that have mixed binaries
  • Compile as 64-bit; if compilation fails, recompile as 32-bit until the source can be cleared for 64-bit.

Other than that, you're really not going to see a whole lot of "grief" from mixed 32/64 bit builds.

Anthon
  • 78,313
  • 42
  • 165
  • 222
Avery Payne
  • 996
  • 8
  • 8
  • Plus symlinks to keep the binary names constant and consistent. – geoffc Aug 11 '10 at 01:05
  • and we have what's called `multilib` http://alien.slackbook.org/dokuwiki/doku.php?id=slackware:multilib – phunehehe Aug 11 '10 at 06:41
  • Could you name any program on Linux that can be compiled but only on 32-bits? – Maciej Piechotka Aug 18 '10 at 14:47
  • @Maciej Piechotka: don't think there are a lot of those left. I think I remember OpenOffice.org being tricky, but that was way back when the conversion to 64-bit started. Other than that: apparently Flash Player is tricky :P – wzzrd Aug 18 '10 at 14:56
  • Since when Flash Player is compiled ;) gnash/lightspark works on 64-bits but Adobe Flash Player is propertary. – Maciej Piechotka Aug 19 '10 at 16:17
  • @Maciej: Some programs which use assembly language code (or generate assembly language code) or lower-level raw binary require knowledge about 64-bit systems. Such programs are usually compiled as 32-bit (certain system emulators, Adobe's Flash player, Adobe Reader); Linux runs these in IA-32 compatibility mode on x86-64 systems so long as the 32-bit libraries are installed and compatibility mode is enabled in the kernel configuration. – Michael Trausch Dec 16 '10 at 21:25
  • @Michael: Again - name them. Adobe programs are not compiled from source by user last time I've checked and "out there" there is small amount of widely used FLOSS projects in Assembly. Most popular emulators are ported to x86-64 as of 2010 so please name the program. – Maciej Piechotka Dec 17 '10 at 11:57
  • DEC Alphas? Try Cray XMP and Cray-2 timeframe, ten years earlier. By the time the Alphas were out, SPARC (and SunOS) had 64-bit support. – mpez0 Oct 30 '13 at 13:26
  • The question is specific about running 64 bit Linux. Cray XMP wasn't running Linux at the time. And if you check, you'll see that Alpha was indeed the first 64 bit support considered "stable" for the Linux kernel. – Avery Payne Jan 23 '14 at 00:22
8

Windows and *ix used different data models for the transition. This UNIX.org page is a bit old, but it still provides a good overview of the trade-offs (note that long long was later added to C99, and was required to be at least 64-bit). You can also see a Wikipedia article on the same topic. As advocated at the end of the UNIX.org article, most UNIX-like systems have gone with LP64, which means long, long long, and pointers are all 64-bit.

Windows went with what's called the LLP64 data model, which means that only long long and pointers are 64-bit. long remains 32-bit. Part of the reason was simply that they didn't want to go through and fix broken code that assumed long fit in an int.

Matthew Flaschen
  • 838
  • 1
  • 8
  • 15
  • 2
    There was a lot of debate in the Unix world, also. One of the arguments in favor of adding "long long" was that there was far too much code out there that assumed that "long" was 32 bits. (At least in the particular argument I got into on comp.std.c not too long before the C99 standard.) – David Thornley Aug 18 '10 at 15:14
2

As Linux distros is mostly OpenSource there is largly transition already done. Unless you use propertary software (such as skype) you can run pure 64-bit system without any disadvantages.

However the real difference IMHO is more propertary vs. open then unix vs. windows as it is usually the open source software that is ported first (some volonteer needs to recompile something - maybe fix some compilation issues) - or in most cases not ported at all but just recompiled ;) - and propertary that is ported last.

Possibly additionally on Linux you have repos so the installation is handled automagically - you don't need to choose 64-bit or 32-bit version (system chooses yours automatically). On Windows programs are downloaded and having separate 64-bit and 32-bit version:

  • Doubles the size of files on server
  • Requires of user to know his/her version. Or even that they differ by something

I guess that's the reason why Windows binaries are usually 32-bit - it is one-size-fits-all and not everyone have gone to 64-bit version.

Maciej Piechotka
  • 16,578
  • 11
  • 57
  • 93
2

Actually, try "The Long Road to 64-bits" at ACM Queue: http://queue.acm.org/detail.cfm?id=1165766 That was later picked up by Communications of the ACM. The first 64-bit micro was MIPS R4000, shipped in SGI Crimson 1Q1992, Dec Alphas shipped late that year.

R4000s were running at first in 32-bit mode, then later in 64/32 mode, i.e., 64-bit OS, 64 or 32-bit user codes. Alphas always ran UNIX in 64-bit-only (a reasonable choice, since there was no installed base of 32-bit apps.)

Later in the 1990s, SGI contributed effort to 64-bit-ize Linux (to run on Itaniums), about the time XFS was ported to Linux (it really wanted 64-bit).