[Boost-bugs] [Boost C++ Libraries] #12573: b2 ignores <archiver> <ranlib> and other flags selecting toolchain

Subject: [Boost-bugs] [Boost C++ Libraries] #12573: b2 ignores <archiver> <ranlib> and other flags selecting toolchain
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-11-01 14:51:20


#12573: b2 ignores <archiver> <ranlib> and other flags selecting toolchain
-------------------------+-------------------------------------------------
 Reporter: hbadger@… | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.61.0
 Severity: Showstopper | Keywords: mac osx crossbuild toolchain ar
                         | ranlib
-------------------------+-------------------------------------------------
 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12573>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC