Merge upstream patch to fix build with GCC. PR: 241496 Approved by: jhale (maintainer timeout), linimon (mentor)