Compile Mac OS X 10.2

Michael Engelhart mengelhart at
Thu May 8 11:07:22 CEST 2003

Thanks Steve for pointing me in the right direction!

This -arch flag has been driving me crazy on various software compiles. 
  Why on earth the "default" is to build fat binaries is beyond me since 
the amount of people running darwin on i386 is probably in the tens of 
people :-)

Anyway, I did the patch to /usr/lib/python2.2/distutils/util.pyt 
mentioned in the "still probs to compile python-ldap on macosx" which 
didn't fix the problem at all.  Same errors.   I think the poster was 
incorrect in his belief that the linker didn't like the "space" in the 
build directory names but I'm not sure.

Anyway I removed the patch to that was suggested because it 
didn't do anything towards fixing the problem and I think was based on 
an incorrect assumption about the linker.

What did help was getting rid of the -R flag for ld.
since ld -R gives an unknown flag error I figured it couldn't hurt to 
edit my
/usr/lib/python2.2/distutils/ file and change the

     def runtime_library_dir_option (self, dir):

function to read

         if compiler == "gcc" or compiler == "g++":
             return "-Wl,-L" + dir
             return "-L" + dir

instead of the default Apple install which is

         if compiler == "gcc" or compiler == "g++":
             return "-Wl,-R" + dir
             return "-R" + dir

I also filed a bug report with Apple.

This still gave me warnings about the -arch i1386 not being found but 
it built successfully as I believe all the -arch messages were 
just warnings.


On Thursday, May 8, 2003, at 12:44  AM, Steven Graham wrote:

> Apple has modifed gcc (and ld) to allow what they call "fat" binaries,
> essentially binaries/libraries that have the ability to run in both
> architectures. So the '-arch i386' isn't necessarily wrong, but it 
> shouldn't
> hurt to take it out.
> Looking at the ld(1) man page, it shows -L is used instead of -R. The
> configure script might be a little confused about the system (OS X can 
> do
> that).
> -Steve

More information about the python-ldap mailing list