@@ -30,6 +30,23 @@ config BR2_PACKAGE_MESA3D_LLVM
depends on BR2_PACKAGE_LLVM_ARCH_SUPPORTS
select BR2_PACKAGE_LLVM
+config BR2_PACKAGE_MESA3D_OPENCL
+ bool "opencl support"
+ depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
+ depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on BR2_USE_WCHAR # elfutils
+ depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC
+ depends on !BR2_bfin # elfutils
+ select BR2_PACKAGE_CLANG
+ select BR2_PACKAGE_ELFUTILS
+ select BR2_PACKAGE_LIBCLC
+
+comment "mesa3d OpenCL needs a uClibc or glibc toolchain w/ wchar"
+ depends on BR2_PACKAGE_MESA3D_LLVM
+ depends on !BR2_bfin
+ depends on !BR2_USE_WCHAR \
+ || !(BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC)
+
# inform the .mk file of gallium, dri or vulkan driver selection
config BR2_PACKAGE_MESA3D_GALLIUM_DRIVER
bool
@@ -230,4 +230,14 @@ else
MESA3D_CONF_OPTS += --disable-lmsensors
endif
+# Clover requires libelf
+ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
+MESA3D_DEPENDENCIES += clang elfutils libclc
+MESA3D_CONF_OPTS += --enable-opencl \
+ --disable-opencl-icd \
+ --with-clang-libdir=$(STAGING_DIR)/usr/lib
+else
+MESA3D_CONF_OPTS += --disable-opencl
+endif
+
$(eval $(autotools-package))
This patch provides Clover, the OpenCL 1.1 API implementation by Mesa for AMD GPUs. It generates libOpenCL.so. Add --disable-opencl-icd because int Mesa 18 defaults to on. When disabled, the shared library is named libOpenCL instead of libMesaOpenCL and CL headers are installed. Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr> --- Tested with AMD Radeon Dual (AMD SUMO + AMD CAICOS) using Gallium r600: Piglit taken from Romain Naour's patch, setting -DPIGLIT_BUILD_CL_TESTS=ON: http://lists.busybox.net/pipermail/buildroot/2018-February/213601.html Results from 704 tests: skip 94 pass 541 fail 60 crash 9 Opencl-example (100% pass): https://cgit.freedesktop.org/~tstellar/opencl-example/ package/mesa3d/Config.in | 17 +++++++++++++++++ package/mesa3d/mesa3d.mk | 10 ++++++++++ 2 files changed, 27 insertions(+)