GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
libiberty

libiberty: Declare strto{u,}ll for C++11 and later

libiberty now declares strtoll and strtoull in libiberty.h for C++11 and later, fixing a bootstrap issue on hppa64-hp-hpux11.11.

This change adds declarations for strtoll and strtoull to libiberty.h when the compiler is set to C++11 or later. This resolves a C++11 bootstrap failure observed on the hppa64-hp-hpux11.11 platform by ensuring these standard C functions are correctly declared.

In Details

The libiberty library provides common utility functions. This commit modifies include/libiberty.h to conditionally declare strtoll and strtoull using __GLIBC_STANDARD_CPP_OBJC checks. This ensures ABI compatibility and resolves a bootstrapping issue on specific platforms where these functions were not correctly declared for C++11 environments.

For Context
strtoll
A C standard library function that converts a string to a long long integer. It's part of the <stdlib.h> header.
strtoull
A C standard library function that converts a string to an unsigned long long integer. It's part of the <stdlib.h> header.
libiberty
A collection of utility routines used by GCC and other GNU projects, providing common functionality that may not be present in all standard C libraries.
bootstrap
The process of building a compiler using an earlier version of itself. It's a critical step in ensuring the compiler can be self-hosted and that new versions can be built reliably.
Filed Under: libibertybootstrapc++11