dev-libs/opencl-icd-loader: build with -fno-common / gcc-10
authorMarek Szuba <marecki@gentoo.org>
Mon, 6 Apr 2020 22:22:31 +0000 (23:22 +0100)
committerMarek Szuba <marecki@gentoo.org>
Tue, 7 Apr 2020 09:08:13 +0000 (10:08 +0100)
Just force -fcommon in CFLAGS if tests are enabled (loader code hasn't
got any problems with -fno-common) until the next release, the problem has
already been fixed upstream but the patch is rather large.

Closes: https://bugs.gentoo.org/716410
Signed-off-by: Marek Szuba <marecki@gentoo.org>
dev-libs/opencl-icd-loader/opencl-icd-loader-2020.03.13.ebuild

index 354e60244a5a313a169cfad118b2a2a5fb6ba009..617e29a65dd2232ef1178a05c0f0e4b8e8725fc7 100644 (file)
@@ -4,7 +4,7 @@
 EAPI=7
 
 CMAKE_ECLASS=cmake
-inherit cmake-multilib
+inherit cmake-multilib flag-o-matic
 
 MY_PN="OpenCL-ICD-Loader"
 MY_P="${MY_PN}-${PV}"
@@ -26,6 +26,15 @@ RDEPEND="${DEPEND}
 
 S="${WORKDIR}/${MY_P}"
 
+src_prepare() {
+       # Until the next upstream release. Bug #716410
+       if use test; then
+               append-cflags $(test-flags-CC -fcommon)
+       fi
+
+       cmake_src_prepare
+}
+
 multilib_src_configure() {
        local ocl_dir="/usr/$(get_libdir)/OpenCL/vendors/${PN}"