Backport patch fixing compilation with GCC 15 and remove upstreamed one. Signed-off-by: Rosen Penev <rosenp@gmail.com>