GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
build

Build: Add stdatomic.h to USER_H for OpenBSD libatomic builds

Fixes OpenBSD libatomic build by including stdatomic.h.

This commit addresses a build failure in libatomic when compiling on OpenBSD. The header file stdatomic.h, which is required for atomic operations, was not being found. The change modifies the OpenBSD build configuration to include stdatomic.h from the GCC include directory in the USER_H list, resolving the “No such file or directory” errors during compilation.

In Details

The build system configuration for OpenBSD, specifically in gcc/config/t-openbsd, has been updated. The stdatomic.h header, located in $(srcdir)/ginclude/, is now explicitly added to the USER_H make variable. This ensures that the libatomic library can correctly include and use atomic types and operations, resolving compilation failures previously encountered due to the missing header.

For Context
libatomic
A GCC library that provides atomic built-in functions for languages like C and C++, especially for platforms that lack native hardware support.
stdatomic.h
A standard C header file that defines types and functions for atomic operations, introduced in C11.
USER_H
A make variable used in GCC's build system to specify user-provided header files that should be included during compilation.
OpenBSD
A Unix-like operating system known for its security focus. GCC builds for OpenBSD sometimes require specific configurations.
Filed Under: buildopenbsdlibatomicstdatomic