Boost logo

Boost Users :

Subject: Re: [Boost-users] (was Re: 1.40.0 - 32_64 broken on OS X 10.6 Snow Leopard) (now ppc64 support removed with Xcode 3.2 on Snow Leopard.
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-09-08 01:34:00


Boris Dušek wrote:

> I think I got it with Snow Leopard and 32_64. First, looking at the lines
> with "arch-addr-flags", I realized what I really needed was architecture=x86
> address-model=32_64 instead of architecture=combined address-model=32_64 (I
> needed Intel-only binaries, but I tested this also works for
> architecture=combined if you remove the -arch ppc64 from
> tools/darwin.jam:307-317).

Just to clarify, you now have:

        arch-addr-flags darwin OPTIONS : combined : 32_64 : -arch i386 -arch ppc -arch x86_64 ;

and that builds "3-way" fat binary, and if you put back

        -arch ppc64

it makes the compiler unhappy? How can I check if a compile is affected by this problem/change?

> This removed the unfound bits/* headers error,
> but created a new one:
> darwin.compile.c++
>
bin.v2/libs/iostreams/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/threading-multi/file_descriptor.o
>
> "g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall
> -dynamic -no-cpp-precomp -gdwarf-2 -arch i386 -arch x86_64 -fPIC -m64
> -DBOOST_ALL_NO_LIB=1 -DBOOST_IOSTREAMS_DYN_LINK=1 -DNDEBUG -I"." -c -o
> "bin.v2/libs/iostreams/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/threading-multi/file_descriptor.o"
> "libs/iostreams/src/file_descriptor.cpp"
>
> lipo: /var/folders/hh/hh89RPWHGkKJgJC3Gy-ZZk+++TI/-Tmp-//ccXdF5pl.out and
> /var/folders/hh/hh89RPWHGkKJgJC3Gy-ZZk+++TI/-Tmp-//ccg03e1J.out have the
> same architectures (x86_64) and can't be in the same fat output file
> ...failed darwin.compile.c++
>
bin.v2/libs/iostreams/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/threading-multi/file_descriptor.o...
>
> I tried the same g++ command-line, but with "-m64" removed, and it worked
> and created the proper fat object file:
>
> $ lipo -info
>
bin.v2/libs/iostreams/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/threading-multi/file_descriptor.o
> Architectures in the fat file:
>
bin.v2/libs/iostreams/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/threading-multi/file_descriptor.o
> are: i386 x86_64
>
> I found that -m64 is being set in tools/gcc.jam based on the address-model
> at around line 377. So I added a check whether the model is 32_64, and add
> -m64 only if 32 is not set *and* 32_64 is not set:
>
> if $(model) = 32
> {
> option = -m32 ;
> }
> else
> {
> if $(model) = 32_64
> {
> }
> else
> {
> option = -m64 ;
> }
> }

Oh, bummer. I imagine that a simpler change would be to have:

            if $(model) = 32
            {
                option = -m32 ;
            }
            else if $(model) = 64
            {
                option = -m64 ;
            }

?

> On a side note, I hope boost.build will soon be in Python, which I know
> well, since then I am willing to learn Boost.Build and submit proper patches
> without hacks :-)

I'm working on that; expect more progress by next Monday.

Thanks for investigating the problems -- this was very helpful.

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net