← Back to team overview

context team mailing list archive

Re: One more arch (OS X, snow leopard)

 

>> - ("uname" says the system is "i386", but generates "x86_64" binaries,
>> but let's just ignore that fact for a moment ...)
>
> That is just a bit odd.
>

This is not odd at all. uname says i386 means you are running snow
leopard *kernel* in 32bit mode.
but 32bit mode *kernel* can run 64 bit userland.
(In tiger, 32 bits kernel can run 64bits unix tools, In Leopard, apple
provide 32bits kernel which can execute 64bit user land executables,
and 64bits Cocoa. In Snow Leopard, apple ships the kernel in universal
binary format with 32bit intel and 64bit intel)
You can boot into 64bits kernel, and uname will give you x86_64. Apple
does not enable 64bits kernel by default since some 3rd party old
kernel extensions might still need 32bits kernel.

>> I should probably be able to run the ppc binaries by installing
>> additional software (I didn't try that yet).
>
> Probably. After all, both Tiger and (old) Leopard could run ppc files
> on intel (just slowly). But the problem is not with the actual
> compilation (as there was a succesful report already). Instead,
> it is about the build process.
>

Yes, by Rosetta.


>> By crosscompilation I mean:
>> - if I use "gcc hello.c -o hello -arch ppc" this works perfectly well
>> (it compiles, works on old ppc-s, but I'm not able to execute it)

You should be able to execute ppc binaries on intel platform using rosetta.

>> - metapost, luatex, pdftex, ... use some intermediate commands (like
>> tangle maybe) that cannot be executed if they are built for ppc
>
> Autoconf is supposed to fix that for you, but that does not work if you
> do only -arch=ppc. You'll need to have a CONFHOST in build.sh, like I do
> for windows. That tells 'configure' that it is cross-compiling, so it
> will set up the build process to fetch pre-installed executables for
> these commands instead of the ones it is currently building. It is quite
> straightforward, really, but you need to know the correct string to
> feed it (something like --host=powerpc-apple-darwin9 is likely)
>
> Generally, --host=<whatever> results in execution of <whatever>-gcc,
> <whatever>-ld, <whatever>-strip etc.
>
> Apple's gcc does that --arch thing, but probably the dev tools have also
> installed small stub scripts with the names configure expects. So,
> first action is to look for those. There is a tar.gz of those stubs
> at the bottom of this page, which explains basically what I wrote above
> (and possibly better):
>
>  http://r.research.att.com/tools/
>
> Best wishes,
> Taco
>
> _______________________________________________
> Mailing list: https://launchpad.net/~context
> Post to     : context@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~context
> More help   : https://help.launchpad.net/ListHelp
>



References