June 13, 2016Linking bug?
Hello, I created mylib.so where I linked libdruntime.a and libphobos.a with -L--whole-archive param but mylib.so doesn't contains some phobos functions. And program cannot be linked with mylib.so (without phobos and druntime). there are some unresolved symbols. mylib.so doesn't contains some symbols from phobos too. (nm mylib.so) When I added e.g. import std.parallelism; to any file in the mylib.so everything works fine. (druntime is compiled with -d-version=Shared) Can someone tell me if this is a bug or must I add .a libs to the .so in other way? Im using 1.0.0 LDC for compiling/linking on arch linux with custom compiled druntime and phobos. thanks
June 13, 2016Re: Linking bug?
Posted in reply to Satoshi
Hi there, On 13 Jun 2016, at 11:57, Satoshi via digitalmars-d-ldc wrote: > Can someone tell me if this is a bug or must I add .a libs to the .so in other way? > > Im using 1.0.0 LDC for compiling/linking on arch linux with custom compiled druntime and phobos. In general, shared library support is only meant to work with druntime itself being built as a .so instead of linked in as a static library. The symptoms you describe seem a bit bizarre, though. I'd suggest to try building against a proper shared library as intended first to see if they persist. — David
Copyright © 1999-2017 by the D Language Foundation