Dynamically calling shared objects from statically build executable allowed

Andre Pany andre at s-e-a-p.de
Mon Feb 10 04:41:31 UTC 2020


Hi,

while dynamically calling a shared object from a statically
build executable on linux, both LDC and DMD fails with a
non-zero code 139.

In my productive system the SO is written in C++,
for reproduction I wrote a sample SO in D.

You can find the example here
https://github.com/ldc-developers/ldc/issues/3310


Is this a bug with LDC and DMD, or is it not allowed
to dynamically call a SO from a statically build executable on 
linux?

Background: The SO file I get from third party, while the 
executable
I develop. I need to run the executable on a distroless docker 
image (SCRATCH),
therefore I try to reduce system dependencies on my side by 
building a static executable.

PS. DMD even fails without the static switch with:
Aborting from src/rt/sections_elf_shared.d(480) DSO being 
unregistered isn't current last one.

Kind regards
André




More information about the Digitalmars-d-learn mailing list