configure.build_arch

Anders F Björklund afb at macports.org
Wed Sep 16 07:45:09 PDT 2009


Jack Howarth wrote:

> Anders,
...
>    I still think that anytime port (on at least darwin10) is
> passing -m64 or -arch x86_64 to configure, via build_arch, that
> we should at least pass --target=x86_64. Currently to configure,
> darwin10 acts effectively like a cross-compiler in that the  
> detected triplet
> for --host is i386-apple-darwin10 but the actual code generation
> is x86_64-apple-darwin10. Simply making sure that the --target
> is set by build_arch, so that configure properly understands that  
> actual
> code generation being used, should help a lot.
...

Passing a --target to configure is reasonable, and different from
patching "config.guess" to return something not from uname(1)...
(Maybe it changed in Snow Leopard, but it used to detect something
like "i386-apple-darwin10.0.1" with a lot of decimals like that ?)

RPM* is using CFLAGS="${CFLAGS:--O2 -m64}" (and ditto for CXXFLAGS)
along with a --target=x86_64-apple-darwin as it doesn't bother with
the release number at the moment. If OS release becomes important,
then it could probably be changed to include that in %{_target_os}

* http://rpm5.org/ as in the RPM5-20090707.dmg (RPM 5.2.0)
   rpmbuild sets the target with "--target=i686" or x86_64

Not sure what MacPorts should do though, not using Snow Leopard.
I'm not sure too many "configure" even look at the ${target_cpu} ?


I believe that when you are trying a GNU-style cross-compile
by setting --target and friends, you also need to set up the
matching compiler symlinks for this newly invented "platform".
Normally the system gcc would expect you to use -arch instead ?

I've used it myself earlier to build Universal Binaries for Tiger,
by building for "i686-apple-darwin8" and "powerpc-apple-darwin8"
with configure, and then merging the results together with lipo(1).
But it's a LOT easier when you can just do "-arch i386 -arch ppc" ?

--anders



More information about the macports-dev mailing list