Boost C++ Libraries: Ticket #12570: b2 ignores Iconv and disabled boost-locale lib, even though has_iconv.cpp passed https://svn.boost.org/trac10/ticket/12570 <p> Building boost from sources git tag 1.62.0 (4f2bdeb93a4be13ba0dc5e9f44920a2bf67191fc) I want to crossbuild it, on linux (ubuntu) host, for Mac OS X target. </p> <p> Goal: crossbuild the lib boost, with boost-locale </p> <p> Result: boost says that locale needs either ICU or iconv, and it does not build library for locale. </p> <p> Expected result: it would build the library for boost locale. </p> <p> Error messages: </p> <p> ... </p> <ul><li>iconv (libc) : no </li><li>iconv (separate) : no </li></ul><p> ... </p> <ul><li>Boost.Locale needs either iconv or ICU library to be built. </li></ul><p> ... ls stage/lib/ libboost_atomic-mt-s.a libboost_filesystem-mt-s.a libboost_program_options-mt-s.a libboost_system-mt-s.a libboost_thread-mt-s.a libboost_atomic-mt-sd.a libboost_filesystem-mt-sd.a libboost_program_options-mt-sd.a libboost_system-mt-sd.a libboost_thread-mt-sd.a </p> <p> Environment: </p> <p> Crosscompiler and it's toolchain is built in /home/ubuntu/build/osxcross/target/bin/ and is proven to work (builds Mach-O executables, they work when copied ontop real Mac OS X). </p> <p> Mac SDK is available in /home/ubuntu/build/macsdk/MacOSX10.11.sdk/ And it provides the iconv.h file (<strong>though I do not see any .a</strong> or other file for it - is that ok?) </p> <p> find /home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/include | grep iconv /home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/include/iconv.h </p> <p> Executed command (in place where I downloaded boost, with needed submodules) </p> <p> export WITH_ICONV="/home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/" &amp;&amp; git clean -xdf ; git submodule foreach git clean -xdf; ./bootstrap.sh --with-icu &amp;&amp; ./b2 headers &amp;&amp; export OSX_CPU_ARCH="core2" &amp;&amp; export OSX_VERSION_MIN="10.8" &amp;&amp; time ./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 boost.locale.icu=off boost.locale.std=off boost.locale.iconv=on -sICONV_PATH="$WITH_ICONV" </p> <p> Running strace debug (strace b2), I can confirm that Boost does try to build the has_ionv.cpp program, and it seems to work fine. All invocations I seen return with 0 exit code. </p> <p> E.g: </p> <p> [pid 22980] execve("/home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-clang++", ["/home/ubuntu/build/osxcross/target/bin/x86_64-apple-darwin15-clang++", "-c", "-x", "c++", "-march=core2", "-mmacosx-version-min=10.8", "-O0", "-g", "-fno-inline", "-Wall", "-g", "-fPIC", "-m64", "-march=core2", "-mmacosx-version-min=10.8", "-DBOOST_ALL_NO_LIB=1", "-I.", "-I/home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/include", "-o", "bin.v2/libs/locale/build/clang-linux-3.8.0/debug/target-os-darwin/has_iconv_libc_ext.o", "libs/locale/src/../build/has_iconv.cpp"], <a href="https://svn.boost.org/trac10/*">22 vars */</a>) = 0 </p> <p> Repeating this test manually also works, creates the .o file, and it is indeed in Mach-O format. </p> <p> No idea why then it still tells me that iconv was not enabled, and as result does not build locale. </p> <p> This bug disallows me from at all using Boost until fixed. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12570 Trac 1.4.3 hbadger@… Mon, 31 Oct 2016 15:36:31 GMT <link>https://svn.boost.org/trac10/ticket/12570#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12570#comment:1</guid> <description> <p> Actually, the .tbd library files are there too, in addition to iconv.h </p> <p> usr/lib/ | grep iconv /home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/lib/libiconv.2.4.0.tbd /home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/lib/libiconv.tbd /home/ubuntu/build/macsdk/MacOSX10.11.sdk/usr/lib/libiconv.2.tbd </p> </description> <category>Ticket</category> </item> <item> <author>hbadger@…</author> <pubDate>Mon, 31 Oct 2016 15:37:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12570#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12570#comment:2</guid> <description> <p> When forcing build of locale (by editing libs/locale/build/Jamfile.v2 and disabling result += &lt;build&gt;no ; in line 274) I get following errors: </p> <pre class="wiki"> clang-linux.compile.c++.without-pth bin.v2/libs/locale/build/clang-linux-3.8.0/release/boost.locale.iconv-on/boost.locale.icu-off/boost.locale.std-off/link-static/runtime-link-static/target-os-darwin/threading-multi/encoding/codepage.o libs/locale/src/encoding/codepage.cpp:42:35: error: use of undeclared identifier 'converter_between'; did you mean 'convert_between'? std::auto_ptr&lt;converter_between&gt; cvt; ^~~~~~~~~~~~~~~~~ convert_between libs/locale/src/encoding/codepage.cpp:36:29: note: 'convert_between' declared here std::string convert_between(char const *begin, ^ libs/locale/src/encoding/codepage.cpp:42:35: error: template argument for template type parameter must be a type std::auto_ptr&lt;converter_between&gt; cvt; ^~~~~~~~~~~~~~~~~ /home/ubuntu/build/osxcross/target/bin/../SDK/MacOSX10.11.sdk/usr/include/c++/4.2.1/memory:173:21: note: template parameter is declared here template&lt;typename _Tp&gt; ^ libs/locale/src/encoding/codepage.cpp:68:35: error: use of undeclared identifier 'converter_to_utf' std::auto_ptr&lt;converter_to_utf&lt;CharType&gt; &gt; cvt; ^ libs/locale/src/encoding/codepage.cpp:68:52: error: 'CharType' does not refer to a value std::auto_ptr&lt;converter_to_utf&lt;CharType&gt; &gt; cvt; ^ libs/locale/src/encoding/codepage.cpp:61:35: note: declared here template&lt;typename CharType&gt; ^ libs/locale/src/encoding/codepage.cpp:68:62: error: expected unqualified-id std::auto_ptr&lt;converter_to_utf&lt;CharType&gt; &gt; cvt; ^ libs/locale/src/encoding/codepage.cpp:94:35: error: no template named 'converter_from_utf'; did you mean 'convert_from'? std::auto_ptr&lt;converter_from_utf&lt;CharType&gt; &gt; cvt; ^~~~~~~~~~~~~~~~~~ convert_from libs/locale/src/encoding/codepage.cpp:88:29: note: 'convert_from' declared here std::string convert_from( ^ libs/locale/src/encoding/codepage.cpp:94:35: error: template argument for template type parameter must be a type std::auto_ptr&lt;converter_from_utf&lt;CharType&gt; &gt; cvt; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/ubuntu/build/osxcross/target/bin/../SDK/MacOSX10.11.sdk/usr/include/c++/4.2.1/memory:173:21: note: template parameter is declared here template&lt;typename _Tp&gt; ^ 7 errors generated. </pre> </description> <category>Ticket</category> </item> <item> <author>hbadger@…</author> <pubDate>Mon, 31 Oct 2016 15:56:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12570#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12570#comment:3</guid> <description> <p> If any more information is required, please contact the email, or on IRC chat (freenode server) poke user "rafalcpp" (we can debug it together on a configured box that shows the problem). </p> </description> <category>Ticket</category> </item> <item> <author>hbadger@…</author> <pubDate>Mon, 31 Oct 2016 16:39:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12570#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12570#comment:4</guid> <description> <p> Following work-around <strong>resolves this problem for me</strong> - by advice from <strong>jhunold1</strong>: </p> <p> Copy the lines 225 &amp; 226 between 228 and 229. </p> <p> After this change, the library files are created, and appear correct: </p> <p> stage/lib/libboost_locale-mt-s.a: current ar archive stage/lib/libboost_locale-mt-sd.a: current ar archive </p> <p> and unpacked (ar x) : </p> <p> codecvt.o: Mach-O 64-bit x86_64 object </p> </description> <category>Ticket</category> </item> <item> <author>hbadger@…</author> <pubDate>Mon, 31 Oct 2016 16:40:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12570#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12570#comment:5</guid> <description> <p> This above change is to be applied in file libs/locale/build/Jamfile.v2 </p> </description> <category>Ticket</category> </item> <item> <author>hbadger@…</author> <pubDate>Mon, 31 Oct 2016 19:01:01 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/12570 https://svn.boost.org/trac10/ticket/12570 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">workaround-boost-12570.patch</span> </li> </ul> <p> patch to work around this bug </p> Ticket Kohei Takahashi Fri, 18 Nov 2016 10:44:56 GMT component changed; owner set https://svn.boost.org/trac10/ticket/12570#comment:6 https://svn.boost.org/trac10/ticket/12570#comment:6 <ul> <li><strong>owner</strong> set to <span class="trac-author">Artyom Beilis</span> </li> <li><strong>component</strong> <span class="trac-field-old">Building Boost</span> → <span class="trac-field-new">locale</span> </li> </ul> Ticket hbadger@… Wed, 07 Dec 2016 17:18:45 GMT <link>https://svn.boost.org/trac10/ticket/12570#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12570#comment:7</guid> <description> <p> Hi, I will buy a beer (send 20$ in Bitcoin) to who ever solves this issue if this leads to boost locale working on Mac OS X in crossbuild (so that of course a cross-builded progra using cross-builded libboost can work using boost::locale). </p> <p> Please notify me on email, thanks. hbadger /at\ protonmail \dot/ com </p> </description> <category>Ticket</category> </item> </channel> </rss>