huge stack of __dmd_personality_v0 when static libraries are used.
Basile B. via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Sun Jun 5 20:46:59 PDT 2016
On Monday, 6 June 2016 at 00:18:57 UTC, David Nadlinger wrote:
> It would still be interesting to have a look what's going on
> there. The initialiser should definitely be emitted if all
> modules are linked in.
>
> — David
There's definitively something that's not linked correctly (or
not linked as DMD tells ld to do). Today I've tried again. This
time cairo was ok but I had to add the x11 sources to the "final"
static library otherwise an application couldn't be compiled.
An attempt to reproduce the scheme compiles fine:
============================script================================
if [ ! -d "X11" ]; then
git clone https://github.com/nomad-software/x11.git
fi
cd x11
dub build --build=release --compiler=ldc2
cd ..
# in the IRL case I have 3 other sub static libraries.
# used by the "final" static library.
# in the IRL case for this step I have to add all the X11 d
sources...
ldmd2 lib.d x11/libx11.a \
-Ix11/source -lib
# ...otherwise the final app doesn't compile during this last
step.
ldmd2 bug.d lib.a x11/libx11.a \
-Ix11/source -L-lX11
============================lib.d==================================
module lib;
import x11.Xlib;
void foo()
{
// in the IRL case, error begins when using these 3 X11
function
auto display = XOpenDisplay(null);
auto screen = DefaultScreen(display);
auto visual = DefaultVisual(display, screen);
}
============================bug.d==================================
module bug;
import lib;
void main()
{
foo();
}
===================================================================
I'd like to help with a good bug report but I cant manage to
reproduce the issue, sorry.
More information about the digitalmars-d-ldc
mailing list