Fix build with modern host toolchains (GCC 15, CMake 4.x)#1978
Merged
widgetii merged 1 commit intoOpenIPC:masterfrom Apr 3, 2026
Merged
Fix build with modern host toolchains (GCC 15, CMake 4.x)#1978widgetii merged 1 commit intoOpenIPC:masterfrom
widgetii merged 1 commit intoOpenIPC:masterfrom
Conversation
Set CMAKE_POLICY_VERSION_MINIMUM=3.5 globally to fix CMake 4.x rejecting packages with cmake_minimum_required < 3.5 (e.g. host-lzo-2.10). Older CMake versions ignore this environment variable. Add m4 global patch to disable gnulib's C23 [[__nodiscard__]] attribute path that breaks with GCC 15's default -std=gnu23. Falls back to the equivalent __attribute__((warn_unused_result)). Both fixes are backward compatible with the Ubuntu CI environment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3a7f48c to
08559d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CMAKE_POLICY_VERSION_MINIMUM=3.5in Makefile to fix host package build failures with CMake 4.x (e.g. host-lzo-2.10 usescmake_minimum_required(VERSION 3.0)which CMake 4.x rejects)_GL_ATTRIBUTE_NODISCARDcompile error with GCC 15 (defaults to C23, where[[__nodiscard__]]attribute syntax doesn't work in all positions)Context
Modern distributions (e.g. Arch Linux) ship GCC 15 and CMake 4.x, which break the Buildroot 2024.02.10 host tool build. These two minimal fixes restore compatibility while remaining invisible to existing Ubuntu CI:
CMAKE_POLICY_VERSION_MINIMUMenv var was introduced in CMake 4.0 — older versions ignore itTest plan
hi3516ev300_litesucceeds on Arch Linux (GCC 15.2.1, CMake 4.3.1)🤖 Generated with Claude Code