GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libstdc++

libstdc++: Use #embed For Static tzdata.zi File

The libstdc++ now uses `#embed` to include the `tzdata.zi` file, simplifying the build process.

The C++ standard library now uses the #embed directive to include the tzdata.zi file, which contains timezone data. This change simplifies the build process by eliminating the need for a Makefile rule to generate a header file from the data. While the compilation time impact is minimal, the new approach is considered simpler and more maintainable.

In Details

This commit replaces the Makefile-based generation of tzdata.zi.h with a #embed directive in src/c++20/tzdb.cc. This simplifies the build process for the timezone database within libstdc++. Toolchain developers should note this change as it affects how the timezone data is integrated into the library.

For Context

The C++ standard library relies on timezone data to handle time-related calculations correctly. This commit changes how that timezone data is included during the library's build process. Instead of generating a header file using a Makefile, the code now directly embeds the data file using the #embed directive. This makes the build process simpler and easier to maintain, reducing the risk of build-related issues.

Filed Under: libstdc++timezonebuild