logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/
commit: 56b901203468bdc7a5d2228f447ed439a224cfa7
parent 1237f46a41c8344ec7b8fac35acb590402647f6c
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  5 Feb 2026 00:19:25 +0100

notes/buildsystems-conventions: AS, CPP, LD, STRIP, STRINGS, NM, READELF, OBJCOPY, OBJDUMP

Diffstat:

Mnotes/buildsystems-conventions.shtml40+++++++++++++++++++++++++++++++---------
1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/notes/buildsystems-conventions.shtml b/notes/buildsystems-conventions.shtml @@ -16,14 +16,14 @@ <h3>POSIX</h3> <dl> <dt><var>CC</var></dt> - <dd>Command/path to target C Compiler</dd> + <dd>Command/path to target platform C Compiler</dd> <dt><var>CFLAGS</var></dt> <dd> - Flags passed to target C Compiler.<br /> + Flags passed to target platform C Compiler.<br /> Should not be expected to contain values such as <code>-std=c99</code>. </dd> <dt><var>LDFLAGS</var></dt> - <dd>Linking flags passed to target Compiler</dd> + <dd>Linking flags passed to target platform Compiler</dd> <dt><var>YACC</var></dt> <dd>Command/path to <code>yacc(1)</code></dd> @@ -44,9 +44,9 @@ </dd> <dt><var>FC</var></dt> - <dd>Command/path to target Fortran Compiler</dd> + <dd>Command/path to target platform Fortran Compiler</dd> <dt><var>FFLAGS</var></dt> - <dd>Flags passed to target Fortran Compiler</dd> + <dd>Flags passed to target platform Fortran Compiler</dd> </dl> <h3>Common across autotools, CMake, meson</h3> @@ -67,13 +67,35 @@ <dt><var>PKG_CONFIG</var></dt> <dd> - Command/path to target <code>pkg-config(1)</code> implementation.<br /> + Command/path to target platform <code>pkg-config(1)</code> implementation.<br /> Present in freedesktop.org pkg-config and pkgconf <code>pkg.m4</code>, as well as supported by CMake and meson. </dd> </dl> <h3>Widespread but nor formally specified</h3> <dl> + <dt><var>AS</var></dt> + <dd>Command/path to target platform assembler</dd> + <dt><var>CPP</var></dt> + <dd>Command/path to target platform C preprocessor (ie. <code>${CC} -E</code>)</dd> + <dt><var>LD</var></dt> + <dd>Command/path to target platform linker</dd> + <dt><var>STRIP</var></dt> + <dd>Command/path to target platform executable sections stripper (such as debug symbols)</dd> + <dt><var>STRINGS</var></dt> + <dd> + Command/path to target platform strings extractor.<br /> + Note: Rather questionable whether it should treat sections differently, and doing such filtering has been source of parser vulnerabilities. + </dd> + <dt><var>NM</var></dt> + <dd>Command/path to target platform executable symbols extractor</dd> + <dt><var>READELF</var></dt> + <dd>Command/path to target platform ELF reader</dd> + <dt><var>OBJCOPY</var></dt> + <dd>Command/path to target platform object copier</dd> + <dt><var>OBJDUMP</var></dt> + <dd>Command/path to target platform object dumper</dd> + <dt><var>RANLIB</var></dt> <dd> Command/path to <code>ranlib(1)</code>.<br /> @@ -83,7 +105,7 @@ <!-- Linux Kernel --> <dt><var>CROSS_COMPILE</var></dt> <dd> - Command prefix before default values of target-specific commands like <var>CC</var>, <var>AR</var>, <var>FC</var>, <var>RANLIB</var>, …<br /> + Command prefix before default values of target platform-specific commands like <var>CC</var>, <var>AR</var>, <var>FC</var>, <var>RANLIB</var>, …<br /> For example it can be set to <samp><code>CROSS_COMPILE=x86_64-pc-linux-musl-</code></samp> </dd> @@ -95,7 +117,7 @@ <!-- Linux Kernel --> <dt><var>CXX</var></dt> - <dd>Command/path to target C++ Compiler</dd> + <dd>Command/path to target platform C++ Compiler</dd> <dt><var>HOSTCXX</var></dt> <dd>Command/path to build host C++ Compiler</dd> <dt><var>HOSTCXXFLAGS</var></dt> @@ -104,7 +126,7 @@ <!-- mksh, own projects --> <dt><var>LDSTATIC</var></dt> <dd> - Flag(s) to enable static linking passed to target compiler when building executables.<br /> + Flag(s) to enable static linking passed to target platform compiler when building executables.<br /> For example <samp><code>LDSTATIC=-static</code></samp> </dd> </dl>