blhc (0.07)


blhc (build log hardening check) is a small tool which checks build logs for missing hardening flags.

Hardening flags enable additional security features in the compiler to prevent e.g. stack overflows, format string vulnerabilities, GOT overwrites, etc.

Because most build systems are quite complicated there are many places where compiler flags from the environment might be ignored. The parser verifies that all compiler commands use the correct hardening flags and thus all hardening features are correctly used.

It’s designed to check build logs generated by Debian’s dpkg-buildpackage (or tools using dpkg-buildpackage like pbuilder or sbuild (which is used for the official buildd build logs)) to help maintainers detect missing hardening flags in their packages.

At the moment it works only on Debian and derivatives but it should be easily extendable to other systems as well. Patches are welcome, see README for details.

Only gcc is detected as compiler at the moment. If other compilers support hardening flags as well, please report them.

blhc can be run directly from the source tree (bin/blhc) or copied anywhere on the system. It doesn’t have to be explicitly installed. To read the man page use perldoc bin/blhc.

blhc is licensed under GPL 3 (or later).

If you have suggestions please tell me at, for bugs please use the Debian bug tracker.



blhc path/to/log/file ...

If there’s no output, no flags are missing and the build log is fine.

Also see README and man page in tarball.


Current development happens in the git repository (also browsable as Gitweb):

git clone

blhc is also packaged in Debian.


The following links provide additional information about Debian’s hardening process and general information about available hardening options.

Last updated 2017-07-23 21:03:24 CEST