[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: document how to create universal binaries

From: Bruno Haible
Subject: Re: document how to create universal binaries
Date: Sun, 17 Aug 2008 17:59:44 +0200
User-agent: KMail/1.5.4

Peter O'Gorman wrote:
> > +On MacOS X systems, you can create libraries and executables that work
> For 10.4.x ppc you had to install an SDK and add -isysroot flags.

ok, please change to doc patch to say "On MacOS X systems, version 10.5
or newer".

> For automake using projects --disable-dependency-tracking is also
> necessary.

What happens if it is not specified? I just compiled texinfo-4.12 without
this flag. All compilation commands included
  DEPDIR=.deps depmode=gcc /bin/sh ../build-aux/depcomp ...
and there were no errors.

> Also, I am not sure if putting the -arch flags in CC/CXX and
> having to specify the preprocessor, or putting them in CFLAGS/CXXFLAGS
> and not specifying the preprocessor is "better".

The latter does not work, because then the preprocessor cannot be run:

  $ gcc -arch i386 -arch ppc -E foo.c
  gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple 
-arch flags

> Because ppc and x86 are differently endian, and because 64bit and 32bit
> have different sizeof(long) etc, it may be best to mention that just
> because it builds does not mean that it will work.

That's an issue that should be mentioned in autoconf.texi, not in install.texi,
because it's the developer, not the installer, who will have to deal with it.

> Also, I believe that
> there are cases autoconf will discover different symbols/libraries when
> building on i386 than when building on ppc, that can result in link
> errors for one architecture.


One could also mention that a method to detect these configuration problems
is to build in two different directories, in one with
  CPP="gcc -arch i386 -E"
and in the other with
  CPP="gcc -arch ppc -E"
and then look for differences between the config.h and config.status files.

> Apple recommends building once per architecture (on a machine that can
> do so natively) and using lipo to create a universal binary. That way
> most of the problems are avoided.

But this way is a lot of hand work. It's certainly necessary for programs
like 'emacs' (due to the unexec), but can be avoided in many cases.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]