[staging-next] intel-graphics-compiler: fix build with gcc 15 (#472886)

This commit is contained in:
Sandro
2025-12-22 20:09:48 +00:00
committed by GitHub
3 changed files with 49 additions and 0 deletions
@@ -0,0 +1,14 @@
diff --git a/igc/IGC/common/LLVMWarningsPush.hpp b/igc/IGC/common/LLVMWarningsPush.hpp
index 12874dfcc2..38acd80943 100644
--- a/igc/IGC/common/LLVMWarningsPush.hpp
+++ b/igc/IGC/common/LLVMWarningsPush.hpp
@@ -43,6 +43,9 @@
#if __GNUC__ > 8
#pragma GCC diagnostic ignored "-Winit-list-lifetime"
#endif
+#if __GNUC__ > 14
+#pragma GCC diagnostic ignored "-Wfree-nonheap-object"
+#endif
#endif
#if defined(_WIN32) || defined(_WIN64)
@@ -0,0 +1,25 @@
diff --git a/llvm-project/llvm/include/llvm/ADT/SmallVector.h b/llvm-project/llvm/include/llvm/ADT/SmallVector.h
index 98dce89168..a52947e16e 100644
--- a/llvm-project/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm-project/llvm/include/llvm/ADT/SmallVector.h
@@ -19,6 +19,7 @@
#include <algorithm>
#include <cassert>
#include <cstddef>
+#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <functional>
diff --git a/llvm-project/llvm/include/llvm/Support/Threading.h b/llvm-project/llvm/include/llvm/Support/Threading.h
index ba6c531ab4..78aa5e7be5 100644
--- a/llvm-project/llvm/include/llvm/Support/Threading.h
+++ b/llvm-project/llvm/include/llvm/Support/Threading.h
@@ -18,7 +18,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
#include "llvm/Support/Compiler.h"
-#include <ciso646> // So we can check the C++ standard lib macros.
+#include <version> // So we can check the C++ standard lib macros.
#include <optional>
#if defined(_MSC_VER)
@@ -66,6 +66,16 @@ stdenv.mkDerivation rec {
# https://github.com/intel/intel-graphics-compiler/commit/4f0123a7d67fb716b647f0ba5c1ab550abf2f97d
# https://github.com/intel/intel-graphics-compiler/pull/364
./bump-cmake.patch
# Fix for GCC 15 by adding a previously-implicit `#include <cstdint>` and
# replacing `<ciso646>` with `<version>` in the the llvm directory. Based
# on https://github.com/intel/intel-graphics-compiler/pull/383.
./gcc15-llvm-header-fixes.patch
# Fix for GCC 15 by disabling `-Werror` for `-Wfree-nonheap-object`
# warnings within LLVM. This is in accordance with IGC disabling warnings
# that originate from within LLVM (see `IGC/common/LLVMWarningsPush.hpp`).
./gcc15-allow-llvm-free-nonheap-object-warning.patch
];
sourceRoot = ".";