https://issues.dlang.org/show_bug.cgi?id=6952
Tomoya Tanjo <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #14 from Tomoya Tanjo <[email protected]> --- I have the same issue on Alpine Linux (dmd installed via apk, and dmd 7f88bab). `dmd -v` shows the following link command: ``` cc sample.o -o sample -m64 -Xlinker --export-dynamic -L./generated/linux/release/64/../../../../../phobos/generated/linux/release/64 -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic -lpthread -lm -lrt -ldl ``` To make a static binary, we have to: - add `-static` option, and - remove `-Xlinker -Bdynamic` from the command line or add extra `-Xlinker -Bstatic` to cancel dynamic link options. dmd provides ways to solve the former case: `-Xcc` and `-L`. On the other hand, there are no ways to solve the latter case. It makes harder to build a static binary with dub. It would be nice if dmd provides a way to solve the latter case to cancel `-Xlinker -Bdynamic`. --
