← Back to team overview

context team mailing list archive

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

 


Mojca Miklavec wrote:
> - I'm able to compile binaries for ppc

That *is* cross compilation, in a way.

> - I'm not able to run them

Sure. I can't run win32 exes either, but I can build them easily enough.

> - ("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.

> 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.

> 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)
> - 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



Follow ups

References