In general Debian Policy allows static linking but it has various downsides.

This page aims to document the downsides and mitigations we have in place for those downsides as well as improving the situation in Debian around static linking.




Various technology in Debian uses or is affected by static linking.

C libraries

C libraries support static linking and files are named *.a and can be unpacked with the ar tool from binutils.

Packages can declare they were built using code from other packages by using the Built-Using header and the Debian archive keeps around old sources, marking them with the Extra-Source-Only header.

Lintian detects binaries that have been statically linked.


All Haskell libraries are statically linked into the final binary.

The release team have a transition that tracks Haskell rebuilds.


All OCaml libraries are statically linked into the final binary.

The release team have a transition that tracks OCaml rebuilds.


The go tool from golang currently requires all libraries be available in source form and then builds everything into one binary. These source files in the -dev packages are the equivalent of the .a file.

When using gccgo-5 (go -gccgo), the Go runtime library is dynamically linked against an executable, however everything else is again linked "statically".

There is currently work ongoing by Michael Hudson-Doyle to support building shared go libraries. Support for dynamic linking (for amd64 only) will be in Go 1.5 which is due out in August 2015. Changes will be required to the Go packaging and dh-golang to support packaging Go packages as shared libraries.

The golang tooling generates Built-Using headers for direct dependencies, but not indirect ones.


Lisp libraries are cl-* packages shipping the source code in /usr/share/common-lisp/, similar to Go libraries. The compiler (e.g. sbcl) builds a static binary from all used cl-* packages.


The ?FreePascal Compiler (fpc) packages in Debian don't seem to use dynamic linking. See also here.


The default for Rust is static linking but dynamic linking is available with rustc -C prefer-dynamic.


browserify and other tools merge together multiple JS files for shipping to browsers.


Java has "uberjars" which bundle dependencies into the pre-built jar files.


The Debian archive keeps around old sources referenced by the Built-Using header, marking them with the Extra-Source-Only header.

Manual binNMUs can be done for packages that declare a Built-Using header.

For safety reasons, binaries should be linked dynamically to include hardening features e.g. ASLR. A user should be able to presume that binaries shipped by Debian are safe to use in front-facing (e.g. web services) scripts, etc.

More automatic detection of static linking? #698398

Make it easier to add Built-Using?

Change debian-policy & lintian to discourage static linking?