From mboxrd@z Thu Jan 1 00:00:00 1970 From: mharris at redhat.com (Mike A. Harris) Date: Wed, 7 Jul 2004 22:11:29 -0400 (EDT) Subject: 32-bit gcc help In-Reply-To: <40EC2331.3040105@icarus.com> References: <1089168067.2392.TMDA@mail.js1.bogus> <40EC2331.3040105@icarus.com> Message-ID: On Wed, 7 Jul 2004, Stephen Williams wrote: >Date: Wed, 07 Jul 2004 09:22:09 -0700 >From: Stephen Williams >To: Linux and Red Hat on Alpha processors >Content-Type: text/plain; charset=us-ascii; format=flowed >Reply-To: Linux and Red Hat on Alpha processors >X-BeenThere: axp-list at redhat.com >Subject: Re: 32-bit gcc help > >Mike A. Harris wrote: > >> If you were using AMD64 architecture, you could use -m32 to >> compile 32bit x86 binaries, as the CPU can run both native 32bit >> and 64bit code. ia64 can do similar with emulation, and ppc64 >> can run 32bit ppc binaries also. There never was a 32bit Alpha, >> so it has no such capability. > >Actually, Windows NT/alpha and Microsoft C/RISC edition was >definitely *32* bit. It was not compatible with any 32bit alpha >which never existed) but int/long/void* were 32bit as the >compiler generated them, so 32bit applications didn't need to >be ported, per se. (M$ never made a 64bit system/compiler for >alpha, so far as I know.) This information is very inaccurate and misleading. >Also, the DEC compiler for alpha had a "32bit" mode that limited >the sizes of things in the same way. It needed operating system >support to keep the application address space within a 32bit >pointer. This isn't entirely accurate either. The big problem with Windows, is that it was never designed to be portable in the first place, so it has a lot of 32bit assumptions everywhere which wont go away likely ever. Most Win32 developers also write non-portably and their apps are doomed to remain 32bit without major effort to port to be 64bit clean. On the Win64 ABI on AMD64 architecture, Microsoft decided to nail long at 4 bytes instead of the usual 8 bytes. It is this type of trickery which will allow developers to recompile 32bit apps on Win64 without a lot of problems related to invalid type size assumptions. Windows on Alpha has it's own quirks in a similar vein, but not really something I care to delve into. The Alpha is a 64bit CPU, which runs 64bit operating systems. Not all 64bit operating systems or ABI's were created equal, and Windows on Alpha shows that. -- Mike A. Harris ftp://people.redhat.com/mharris OS Systems Engineer - X11 Developer - Red Hat