Files
openwrt/tools/cmake
Hauke Mehrtens ee6e56c82e tools/cmake: backport bootstrap fix for GCC 16
CMake fails to bootstrap its host tool with GCC 16:

    cmake.o: undefined reference to
    `cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake*)'

Source/cmake.cxx includes cmGlobalGhsMultiGenerator.h guarded only by
__linux__, not by CMAKE_BOOTSTRAP. The NewFactory() call is compiled out
during bootstrap, but GCC 16 devirtualization still emits the uncalled
inline NewFactory() and the cmGlobalGeneratorSimpleFactory<> template,
which reference symbols only defined in cmGlobalGhsMultiGenerator.cxx, a
file that is not compiled during bootstrap.

Backport the upstream fix, which moves the include behind the existing
CMAKE_BOOTSTRAP guard. It is in no 3.30.x release (that branch is EOL);
upstream shipped it first in 3.31.10 / 4.0.5 / 4.1.2.

Assisted-by: Claude:claude-opus-4-8
Link: https://github.com/openwrt/openwrt/pull/24303
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-07-20 23:18:13 +02:00
..