Opened 6 years ago

Last modified 6 years ago

#12573 new Bugs

b2 ignores <archiver> <ranlib> and other flags selecting toolchain

Reported by: hbadger@… Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.61.0 Severity: Showstopper
Keywords: mac osx crossbuild toolchain ar ranlib Cc:

Description

Building boost from sources git tag 1.62.0 (4f2bdeb93a4be13ba0dc5e9f44920a2bf67191fc) I want to crossbuild it, on linux (ubuntu) host, for Mac OS X target.

Goal: crossbuild the lib boost, with boost-locale

Result: boost calls my crossbuilder clang++, but calls incorrect (native system) ar, ranlib, etc. As result the produced .a files contain .o objects for Mach-O, but are packed it seems in some incorrect way, they fail when trying to actually use them in crossbuild of a hello world that uses them.

Expected result: b2 build should call provided -ar and -ranlib tools, e.g. /home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-ar

Reproduce:

I write the configuration file:

$ cat ~/user-config.jam

using clang : : /home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-clang++ : <archiver>"/home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-ar-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" <striper>"/home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-strip" <ranlib>"/home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-ranlib" :  ;

Mac OSX SDK is provided in e.g. /home/ubuntu/build/macsdk/MacOSX10.11.sdk

Then I call boost build as:

export WITH_ICONV="/home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/" &&  git clean -xdf ; git submodule foreach git clean -xdf; ./bootstrap.sh --without-icu &&   ./b2 headers  && export OSX_CPU_ARCH="core2" && export OSX_VERSION_MIN="10.8" &&  time  strace  -fffff -s 2000  -e trace=process    ./b2  --toolset=clang     --build-type=complete    "--with-filesystem" "--with-system" "--with-program_options" "--with-thread" "--with-locale"     cxxflags=-mmacosx-version-min=${OSX_VERSION_MIN} cxxflags=-march=${OSX_CPU_ARCH} target-os=darwin architecture=x86 address-model=64  --layout=tagged  link=static runtime-link=static  -sNO_BZIP2=1 --sNO_ZLIB=1       --prefix=/home/ubuntu/build/boost/build-osx/   threading=multi    -sICONV_PATH="$WITH_ICONV"  --prefix="/home/ubuntu/build/boost/build-osx/"  --user-config=/home/ubuntu/user-config.jam  install  &> ~/strace

You can also remove the strace part "strace -fffff -s 2000 -e trace=process" and the end redirection.

Then I see in ~/strace that normal systems ar and ranlib are used. Also, providing not-existing ar program "-AAAAAAAAAAAAA" should cause build error, but it does not.

Change History (6)

comment:1 by edaskel@…, 6 years ago

Component: NoneBuilding Boost

comment:2 by anonymous, 6 years ago

This is a big problem for building boost for Android, on Mac OS. We need to specify the ar/ranlib from the Android toolchain - the system default one does not work.

comment:2 by anonymous, 6 years ago

This is a big problem for building boost for Android, on Mac OS. We need to specify the ar/ranlib from the Android toolchain - the system default one does not work.

comment:2 by anonymous, 6 years ago

This is a big problem for building boost for Android, on Mac OS. We need to specify the ar/ranlib from the Android toolchain - the system default one does not work.

comment:2 by anonymous, 6 years ago

This is a big problem for building boost for Android, on Mac OS. We need to specify the ar/ranlib from the Android toolchain - the system default one does not work.

comment:2 by anonymous, 6 years ago

This is a big problem for building boost for Android, on Mac OS. We need to specify the ar/ranlib from the Android toolchain - the system default one does not work.

Note: See TracTickets for help on using tickets.