Re: zlib and bipz2 not linking?

Steven Watanabe via Boost-build <[email protected]>
Newsgroups gmane.comp.lib.boost.build
Organization Providere Consulting, Inc.
Message-ID <[email protected]>
AMDG

On 09/06/2018 09:43 PM, Kuhl, Brian via Boost-build wrote:
> Hi Experts,
> When cross compiling for VxWorks on Linux  ...
> In previous versions of Boost the presence of libz.a and libbz2.a were detected and linked into iostreams tests.
> But with v1.68 the libraries are not being added to the link line.
> Please see below for an example error.
> 
> The config-cache and the build console indicate that libz and bzip are being found, it's just not being used when required.
> 
> I'm having trouble deciphering ac.jam, so I was hopping someone could help me understand  how a dependency on /zlib//zlib is supposed to add -lz to the link line?
> And why it might not work in my case?
> 

  What's supposed to happen is that ac-library.construct
returns a target representing -lz.  When boost_iostreams
is built as a static library, it propagates this target
to its dependencies as a <library> usage requirement.
I would recommend --debug-building and/or --debug-generators,
but that just shows the dependency as <library>object(file-target)@NNN
which is not really useful.

  Okay, try building just one test target with
`--debug-building --debug-generators -n -d0`.
There are two things that you should be looking
for in the output.  First of all, there should
be two lines like this:

         Usage requirements for boost_iostreams:  ...
         Build properties:  ... <install-dependencies>off
<library>object(file-target)@4855 ...

If the <library> is missing, then that means that zlib is
not being passed to the boost_iostreams target.

The second line to look for is:
         Usage requirements from boost_iostreams:  <include>.
<library>object(file-target)@4855 <relevant>address-model ...

If there is no library here, then that means the problem
is in the propagation of static libraries.

> Many thanks,
> 
> Brian Kuhl
> Wind River
> 
> 
> . ./vxworks_env.sh &&  cd status   &&  \
>                     BOOST_TELNET_ADDR="localhost 20023"  \
>                     LAYER_SRC_PATH="yow-build62-lx:VSB/3pp/BOOST/boost_1_68_0" \
>                     PKG_SRC_BUILD_DIR="/yow-build62-lx2/bkuhl/work/VSB/3pp/BOOST/boost_1_68_0"  \
>                     VSB_LD_LIBRARY_PATH="yow-build62-lx:VSB/usr/root/llvm/bin;yow-build62-lx:VSB/usr/lib/common" \
> ../b2 -j1 --prefix=/yow-build62-lx2/bkuhl/work/VSB/usr/root --libdir=/yow-build62-lx2/bkuhl/work/VSB/usr/lib/common --includedir=/yow-build62-lx2/bkuhl/work/VSB/usr/h/public    toolset=clang-vxworks cross-compile=vxworks --reconfigure target-os=vxworks "variant=debug" address-model=64  static-only=on  "testing.launcher=./vxworks_boost_test_run.exp" "--limit-tests=iostreams|system" "--exclude-tests=coroutine2|function_types|functional|logic|rational" -d2
> Performing configuration checks
>     - default address-model    : 64-bit
>     - default architecture     : x86
>     - default address-model    : 64-bit
>     - default architecture     : x86
>     - symlinks supported       : yes
>     - BOOST_COMP_GNUC >= 4.3.0 : no
>     - zlib                     : yes
>     - bzip2                    : yes
>     - lzma                     : no
> <snip>
> 
> 
> clang-vxworks.link ../bin.v2/libs/iostreams/test/bzip2_test.test/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/bzip2_test.vxe
>     /yow-build62-lx2/bkuhl/vx7/compilers/llvm-6.0.0.2/LINUX386/bin/ldpentium -m elf_x86_64  -L"/yow-build62-lx2/bkuhl/work/VSB/usr/lib/common" -o "../bin.v2/libs/iostreams/test/bzip2_test.test/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/bzip2_test.vxe" /yow-build62-lx2/bkuhl/work/VSB/usr/lib/common//crt0.o "../bin.v2/libs/iostreams/test/bzip2_test.test/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/bzip2_test.o" "../bin.v2/libs/iostreams/build/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/libboost_iostreams.a" "../bin.v2/libs/test/build/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/libboost_unit_test_framework.a" "../bin.v2/libs/filesystem/build/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/libboost_fil
 esystem.a" "../bin.v2/libs/timer/build/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/libboost_timer.a" "../bin.v2/libs/chrono/build/clang-vxworks-4.2.1/debug/cross-compile-v
 xworks/static-only-on/libboost_chrono.a" "../bin.v2/libs/system/build/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/libboost_system.a" --start-group -lunix -lnet  -lc  -lc_internal  -lllvm  -lcplusplus  -lllvmcplus  -ldl  -lsyscall      --end-group  --defsym __wrs_rtp_base=0x200000000 -u __tls__  -u __wr_need_frame_add -T/yow-build62-lx2/bkuhl/vx7/helix/guests/vxworks-7/build/tool/llvm_2016_04/usr/ldscript.vxe.x86-64   -L/yow-build62-lx2/bkuhl/work/VSB/usr/lib/common -z common-page-size=8192  -static
> ../bin.v2/libs/iostreams/build/clang-vxworks-4.2.1/debug/cross-compile-vxworks/static-only-on/libboost_iostreams.a(bzip2.o): In function `boost::iostreams::detail::bzip2_base::end(bool)':
> /yow-build62-lx2/bkuhl/work/VSB/3pp/BOOST/boost_1_68_0/status/../libs/iostreams/src/bzip2.cpp:121: undefined reference to `BZ2_bzCompressEnd'
> <snip>

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.