Hello,

I've run into a problem trying to upgrade some pre-2010 Mac OS X computers to a 
newer version of Ksh (anything after 2009-05-05). All the Ksh releases on the 
website list a binary for "darwin.i386", however, each of these are compiled 
for 64-bit architectures, not i386, and should probably be labelled 
"darwin.x86-64".

I am guessing this mistake is due to running "uname -p" to get the processor 
type. The result of "uname -p" on OS X returns the processor the kernel was 
compiled for, not the one it's running on. Surprisingly, BOTH the 32-bit and 
64-bit kernels can run 64-bit applications (the wordsize only matters for 
drivers) so long as the hardware supports it.

This means that by default Lion (10.7) and some versions of Snow Leopard (10.6) 
compile 64-bit applications that can run on their 32-bit kernels but any 
pre-2010 computer running that same kernel can't run them.

To illustrate this run the "file" command on the executables:

  $ file ksh.2009-05-05.darwin.i386
  ksh.2009-05-05.darwin.i386: Mach-O executable i386
  $ file ksh.2010-03-09.darwin.i386
  ksh.2010-03-09.darwin.i386: Mach-O 64-bit executable x86_64
  $ file 
ast-ksh.2011-02-08.darwin.i386/arch/darwin.i386/bin/ksh.2011-02-08.darwin.i386
  
ast-ksh.2011-02-08.darwin.i386/arch/darwin.i386/bin/ksh.2011-02-08.darwin.i386: 
Mach-O 64-bit executable x86_64

To get the compiler to create a 32-bit executable all you need to do is pass 
-m32 to GCC.

This also illustrates a problem with using nmake as a build tool. If anyone 
wants to try and download the source and compile for 32-bits they need to first 
download and run nmake, but in this case nmake has the same binary 
incompatibility that prevents the original release to not run.

Thanks,

- Derek Newhall
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to