Boost C++ Libraries: Ticket #12217: boost.iostreams on Android can't find ZLIB https://svn.boost.org/trac10/ticket/12217 <p> boost.iostreams on Android can't find ZLIB if host is Linux. Works fine for OSX host. </p> <p> Build options: </p> <pre class="wiki">-a link=static threading=multi variant=debug,release --layout=tagged toolset=gcc-ndk --user-config=/home/travis/.hunter/_Base/1e7fc8f/3bce312/7416caa/Build/Boost/__iostreams/Build/boost.user.jam --with-iostreams -s NO_COMPRESSION=0 -s NO_ZLIB=0 -s NO_BZIP2=1 -s ZLIB_INCLUDE=/home/travis/.hunter/_Base/1e7fc8f/3bce312/7416caa/Install/include -s ZLIB_LIBPATH=/home/travis/.hunter/_Base/1e7fc8f/3bce312/7416caa/Install/lib -s ZLIB_BINARY=zd linkflags= -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc -fPIE -pie -j 2 </pre><p> boost.user.jam content: </p> <pre class="wiki">using gcc : ndk : "/home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++" -fexceptions -frtti -Wno-psabi --sysroot=/home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/platforms/android-19/arch-arm -funwind-tables -finline-limit=64 -fsigned-char -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=neon -fdata-sections -ffunction-sections -Wa,--noexecstack -std=c++11 -DANDROID -isystem /home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/platforms/android-19/arch-arm/usr/include -isystem /home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem /home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include -isystem /home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/backward : &lt;archiver&gt; "/home/travis/build/ruslo/hunter_sandbox/_ci/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc-ar" ; </pre><p> On Linux '-lrt' library added and it breaks ZLIB linking test: </p> <pre class="wiki">"/.../android-ndk/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++" "-fexceptions" "-frtti" "-Wno-psabi" "--sysroot=/.../android-ndk/android-ndk-r10e/platforms/android-19/arch-arm" "-funwind-tables" "-finline-limit=64" "-fsigned-char" "-no-canonical-prefixes" "-march=armv7-a" "-mfloat-abi=softfp" "-mfpu=neon" "-fdata-sections" "-ffunction-sections" "-Wa,--noexecstack" "-std=c++11" "-DANDROID" "-isystem" "/.../android-ndk/android-ndk-r10e/platforms/android-19/arch-arm/usr/include" "-isystem" "/.../android-ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include" "-isystem" "/.../android-ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include" "-isystem" "/.../android-ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/backward" -L"/.../hunter/_Base/xxxxxxx/3bce312/7416caa/Install/lib" -Wl,-R -Wl,"/.../hunter/_Base/xxxxxxx/3bce312/7416caa/Install/lib" -Wl,-rpath-link -Wl,"/.../hunter/_Base/xxxxxxx/3bce312/7416caa/Install/lib" -o "bin.v2/standalone/ac/gcc-ndk/debug/link-static/threading-multi/zd" -Wl,--start-group "bin.v2/standalone/ac/gcc-ndk/debug/link-static/threading-multi/main.o" -Wl,-Bstatic -lzd -Wl,-Bdynamic -lrt &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; -Wl,--end-group -g -pthread -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc -fPIE -pie /.../android-ndk/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lrt </pre><p> There is no '-lrt' on OSX and same configuration works fine: </p> <pre class="wiki">"/.../android-ndk/android-ndk-r10e/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-g++" "-fexceptions" "-frtti" "-Wno-psabi" "--sysroot=/.../android-ndk/android-ndk-r10e/platforms/android-19/arch-arm" "-funwind-tables" "-finline-limit=64" "-fsigned-char" "-no-canonical-prefixes" "-march=armv7-a" "-mfloat-abi=softfp" "-mfpu=neon" "-fdata-sections" "-ffunction-sections" "-Wa,--noexecstack" "-std=c++11" "-DANDROID" "-isystem" "/.../android-ndk/android-ndk-r10e/platforms/android-19/arch-arm/usr/include" "-isystem" "/.../android-ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include" "-isystem" "/.../android-ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include" "-isystem" "/.../android-ndk/android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/include/backward" -L"/.../hunter/_Base/xxxxxxx/3bce312/7416caa/Install/lib" -Wl,-R -Wl,"/.../hunter/_Base/xxxxxxx/3bce312/7416caa/Install/lib" -Wl,-rpath-link -Wl,"/.../hunter/_Base/xxxxxxx/3bce312/7416caa/Install/lib" -o "bin.v2/standalone/ac/gcc-ndk/debug/link-static/threading-multi/zd" -Wl,--start-group "bin.v2/standalone/ac/gcc-ndk/debug/link-static/threading-multi/main.o" -Wl,-Bstatic -lzd -Wl,-Bdynamic -Wl,--end-group -g -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,--gc-sections -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc -fPIE -pie </pre><p> There should be no difference because same Android toolchain used on both hosts. OS of host should not affect Android build. </p> <ul><li>Linux log: <a class="ext-link" href="https://s3.amazonaws.com/archive.travis-ci.org/jobs/131643137/log.txt"><span class="icon">​</span>https://s3.amazonaws.com/archive.travis-ci.org/jobs/131643137/log.txt</a> </li><li>OSX log: <a class="ext-link" href="https://s3.amazonaws.com/archive.travis-ci.org/jobs/131643139/log.txt"><span class="icon">​</span>https://s3.amazonaws.com/archive.travis-ci.org/jobs/131643139/log.txt</a> </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12217 Trac 1.4.3 ruslan_baratov@… Fri, 20 May 2016 10:10:36 GMT <link>https://svn.boost.org/trac10/ticket/12217#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12217#comment:1</guid> <description> <p> Originally from: <a class="ext-link" href="https://github.com/ruslo/hunter/issues/417"><span class="icon">​</span>https://github.com/ruslo/hunter/issues/417</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>