[oi-dev] how to determine link directory order for clang
Carsten Grzemba
grzemba at contac-dt.de
Thu Aug 2 09:29:14 UTC 2018
<signaturebeforequotedtext></signaturebeforequotedtext>
On 25.07.18 11:01, "Carsten Grzemba" <grzemba at contac-dt.de> wrote:
>
> I try to build a package with clang toolchain, but there I have some link troubles:
>
> cmake constructs a link.txt:
>
> /usr/bin/clang++ -m64 -O3 -std=c++11 -O3 -DNDEBUG -stdlib=libc++ -m64 CMakeFiles/iqstat.dir/src/iqstat.cpp.o -o iqstat -L/usr/gcc/6/lib/amd64 -lc++abi -lirods_client -lirods_plugin_dependencies -lirods_common /usr/lib/amd64/libavrocpp.so /usr/lib/amd64/libboost_filesystem.so /usr/lib/amd64/libboost_program_options.so /usr/lib/amd64/libboost_system.so /usr/lib/amd64/libjansson.so /usr/zeromq-4.2/lib/amd64/libzmq.so
>
> which in turn raises:
>
> /usr/bin/clang++ -v -m64 -O3 -std=c++11 -O3 -DNDEBUG -stdlib=libc++ -m64 -stdlib=libc++ CMakeFiles/iqstat.dir/src/iqstat.cpp.o -o iqstat -L/usr/gcc/6/lib/amd64 -lc++abi -lirods_client -lirods_plugin_dependencies -lirods_common /usr/lib/amd64/libavrocpp.so /usr/lib/amd64/libboost_filesystem.so /usr/lib/amd64/libboost_program_options.so /usr/lib/amd64/libboost_system.so /usr/lib/amd64/libjansson.so /usr/zeromq-4.2/lib/amd64/libzmq.so
> clang version 4.0.1 (tags/RELEASE_401/final)
> Target: x86_64-pc-solaris2.11
> Thread model: posix
> InstalledDir: /usr/bin
> "/usr/bin/ld" -C -e _start -Bdynamic --dynamic-linker /usr/lib/amd64/ld.so.1 -o iqstat /usr/lib/amd64/crt1.o /usr/lib/amd64/crti.o /usr/lib/amd64/values-Xa.o /usr/gcc/6/lib/gcc/i386-pc-solaris2.11/6.4.0/amd64/crtbegin.o -L/usr/bin -L/usr/clang/4.0/bin -L/usr/clang/4.0/bin/../lib -L/usr/gcc/6/lib/gcc/i386-pc-solaris2.11/6.4.0/amd64 -L/usr/lib/amd64/ -L/usr/gcc/6/lib/amd64 CMakeFiles/iqstat.dir/src/iqstat.cpp.o -lc++abi -lirods_client -lirods_plugin_dependencies -lirods_common /usr/lib/amd64/libavrocpp.so /usr/lib/amd64/libboost_filesystem.so /usr/lib/amd64/libboost_program_options.so /usr/lib/amd64/libboost_system.so /usr/lib/amd64/libjansson.so /usr/zeromq-4.2/lib/amd64/libzmq.so -lc++ -lgcc_s -lc -lgcc -lm /usr/gcc/6/lib/gcc/i386-pc-solaris2.11/6.4.0/amd64/crtend.o /usr/lib/amd64/crtn.o
> ld: fatal: file /usr/lib/amd64//libstdc++.so.6: version 'GLIBCXX_3.4.21' does not exist:
> required by file /usr/lib/amd64//libirods_client.so
> ld: fatal: file /usr/lib/amd64//libstdc++.so.6: version 'GLIBCXX_3.4.21' does not exist:
> required by file /usr/lib/amd64/libavrocpp.so
> ld: fatal: file /usr/lib/amd64//libstdc++.so.6: version 'CXXABI_1.3.9' does not exist:
> required by file /usr/lib/amd64/libavrocpp.so
> ld: fatal: file /usr/lib/amd64//libstdc++.so.6: version 'GLIBCXX_3.4.21' does not exist:
> required by file /usr/zeromq-4.2/lib/amd64/libzmq.so
> ld: fatal: file /usr/lib/amd64//libstdc++.so.6: version 'GLIBCXX_3.4.21' does not exist:
> required by file /usr/lib/amd64//libboost_iostreams.so.1.64.0
> ld: fatal: file processing errors. No output written to iqstat
>
> The fix is simple: in the argument list have to removed -L/usr/lib/amd64 or it has to put on the end of the -L's list.
> But how can I tell it this clang++/cmake
> --
> Carsten
>
the reason was missing -shared option, which results in:
-Bdynamic --dynamic-linker
intead of
-Bdynamic -shared
which makes the linking trouble
see also: clang-40/llvm-4.0.1.src/tools/clang/lib/Driver/tools.cpp: solaris::Linker::ConstructJob
<signatureafterquotedtext>--
Carsten
</signatureafterquotedtext>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20180802/badf8c12/attachment-0004.html>
More information about the oi-dev
mailing list