genassym.sh(8)

genassym.sh8

Emit an assym.h file

Usage

sh genassym.sh [-c] C compiler invocation

Overview

genassym.sh is a shell script normally used during the kernel build process to create an assym.h file. This file defines a number of cpp constants derived from the configuration information genassym.sh reads from stdin. The generated file is used by kernel sources written in assembler to gain access to information (e.g. structure offsets and sizes) normally only known to the C compiler.

genassym.sh resides in the /sys/kern directory. Arguments to genassym.sh are usually of the form ${CC} ${CFLAGS} ${CPPFLAGS} where ${CC} is the C compiler used to compile the kernel, while ${CFLAGS} and ${CPPFLAGS} are flag arguments to the C compiler. The script creates a C source file from its input. Then the C compiler is called according to the script's arguments to compile this file.

Normally genassym.sh instructs the C compiler to create an assembler source from the constructed C source. The resulting file is then processed to extract the information needed to create the assym.h file. The -c flag instructs genassym.sh to create slightly different code, generate an executable from this code and run it. In both cases the assym.h file is written to stdout.

Diagnostics

Either self-explanatory, or generated by one of the programs called from the script. The script will exit with the return code from the compiler or, in the -c case, with the return code from the generated executable.

Releases

52 releases since OpenBSD 3.0; the text changed 6 times.

  1. 3.0
  2. 3.1–3.2
  3. 3.3
  4. 3.4–4.1
  5. 4.2–5.5
  6. 5.6–5.7
  7. 5.8–8.0

History

The genassym.sh script first appeared in OpenBSD 2.2.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.