summaryrefslogtreecommitdiff
path: root/dev-libs/rocm-opencl-runtime/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-07-03 22:39:47 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-07-03 22:39:47 +0100
commit7f0ccc917c7abe6223784c703d86cd14755691fb (patch)
tree8c6793f68896b341e22f33d7e6cef88e481f4a8b /dev-libs/rocm-opencl-runtime/files
parent9aa80713372911cec499b3adb2cd746790920916 (diff)
gentoo resync : 03.07.2021
Diffstat (limited to 'dev-libs/rocm-opencl-runtime/files')
-rw-r--r--dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch
new file mode 100644
index 000000000000..14191adb5d0c
--- /dev/null
+++ b/dev-libs/rocm-opencl-runtime/files/rocm-opencl-runtime-4.2.0-opencl3-header.patch
@@ -0,0 +1,65 @@
+See bug #789717.
+
+Once opencl-headers is upgraded to 3.0 or higher this package starts
+complaining left and right about missing header definitions for
+CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR. The correct header for this
+definiton did move as of opencl-headers 3.0 so this makes some sense.
+(Actually I suspect there is a header-guard mismatch behind this problem).
+
+Most of this can be fixed by using -isystem instead of -I for the opencl
+headers. Although not terribly well documented, -isystem in lieu of -I
+comports with best practices for overriding 3rd-party header files in
+system include directories according to the gcc info pages. Why and how
+are apparently undocumented and appear to be somewhere inside the gcc
+fixincludes rabbit-hole.
+
+This still leaves a similar issue compiling the amdocl files which
+is addressed here with an extra #include.
+
+-gmt
+
+diff -urpN ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/CMakeLists.txt ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/CMakeLists.txt
+--- ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/CMakeLists.txt 2021-06-26 14:52:32.446875129 -0700
++++ ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/CMakeLists.txt 2021-06-26 15:00:30.401582470 -0700
+@@ -19,10 +19,10 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
+ add_definitions(-DDEBUG)
+ endif()
+
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/..)
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos)
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers)
+-include_directories(${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/..)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../khronos)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../khronos/headers)
++include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/../khronos/headers/opencl2.2)
+ include_directories(/usr/include/rocclr)
+ include_directories(/usr/include/rocclr/compiler/lib/include/)
+ include_directories(/usr/include/rocclr/elf/)
+diff -urpN ROCm-OpenCL-Runtime-rocm-4.1.0.orig/khronos/icd/CMakeLists.txt ROCm-OpenCL-Runtime-rocm-4.1.0/khronos/icd/CMakeLists.txt
+--- ROCm-OpenCL-Runtime-rocm-4.1.0.orig/khronos/icd/CMakeLists.txt 2021-06-26 14:52:32.445875109 -0700
++++ ROCm-OpenCL-Runtime-rocm-4.1.0/khronos/icd/CMakeLists.txt 2021-06-26 14:59:01.600778554 -0700
+@@ -121,10 +121,10 @@ else()
+ endif ()
+ endif ()
+
+-include_directories (${OPENCL_ICD_LOADER_HEADERS_DIR})
++include_directories (SYSTEM ${OPENCL_ICD_LOADER_HEADERS_DIR})
+ add_definitions (-DCL_TARGET_OPENCL_VERSION=220)
+
+-target_include_directories (OpenCL PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader)
++target_include_directories (OpenCL SYSTEM PRIVATE ${CMAKE_CURRENT_BINARY_DIR} loader)
+ target_link_libraries (OpenCL ${CMAKE_DL_LIBS})
+
+ include (CTest)
+diff -urpN ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/cl_common.hpp ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_common.hpp
+--- ROCm-OpenCL-Runtime-rocm-4.1.0.orig/amdocl/cl_common.hpp 2021-02-02 10:01:38.000000000 -0800
++++ ROCm-OpenCL-Runtime-rocm-4.1.0/amdocl/cl_common.hpp 2021-06-26 15:40:57.584449532 -0700
+@@ -21,6 +21,7 @@
+ #ifndef CL_COMMON_HPP_
+ #define CL_COMMON_HPP_
+
++#include <CL/cl_gl_ext.h>
+ #ifdef _WIN32
+ #include <CL/cl_d3d11.h>
+ #include <CL/cl_d3d10.h>