summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2020-10-27 18:39:19 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2020-10-27 18:39:41 -0700
commitb4fb6fc0f73b4b4145236b56355c35070c3b529a (patch)
tree4e6d582665914d7bff13647d162bcd0159a631db /dev-lang
parentnet-wireless/srslte: switch branch for live (diff)
downloadgentoo-b4fb6fc0f73b4b4145236b56355c35070c3b529a.tar.gz
gentoo-b4fb6fc0f73b4b4145236b56355c35070c3b529a.tar.bz2
gentoo-b4fb6fc0f73b4b4145236b56355c35070c3b529a.zip
dev-lang/rust: fix build with tensorflow installed
Closes: https://bugs.gentoo.org/750875 Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch55
-rw-r--r--dev-lang/rust/rust-1.47.0-r1.ebuild1
2 files changed, 56 insertions, 0 deletions
diff --git a/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch b/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch
new file mode 100644
index 000000000000..5b12c15ff40e
--- /dev/null
+++ b/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch
@@ -0,0 +1,55 @@
+From 8dcb88f7705fb3927938dd9bd103efcabafcefb0 Mon Sep 17 00:00:00 2001
+From: Georgy Yakovlev <gyakovlev@gentoo.org>
+Date: Tue, 27 Oct 2020 18:20:56 -0700
+Subject: [PATCH] backport D88371, guard `find_library(tensorflow_c_api ...)`
+
+Differential Revision: https://reviews.llvm.org/D88371
+Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
+---
+ src/llvm-project/llvm/CMakeLists.txt | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/src/llvm-project/llvm/CMakeLists.txt b/src/llvm-project/llvm/CMakeLists.txt
+index 1f137f0..4112def 100644
+--- a/src/llvm-project/llvm/CMakeLists.txt
++++ b/src/llvm-project/llvm/CMakeLists.txt
+@@ -832,6 +832,11 @@ configure_file(
+ ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
+ )
+
++# They are not referenced. See set_output_directory().
++set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
++set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
++set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
++
+ # For up-to-date instructions for installing the Tensorflow dependency, refer to
+ # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
+ # In this case, the latest C API library is available for download from
+@@ -840,9 +845,9 @@ configure_file(
+ # LLVM_HAVE_TF_API, through llvm-config.h, so that a user of the LLVM library may
+ # also leverage the dependency.
+ set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
+-find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)
+
+-if (tensorflow_c_api)
++if (TENSORFLOW_C_LIB_PATH)
++ find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
+ set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
+ include_directories(${TENSORFLOW_C_LIB_PATH}/include)
+ endif()
+@@ -877,12 +882,6 @@ add_custom_target(srpm
+ COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE})
+ set_target_properties(srpm PROPERTIES FOLDER "Misc")
+
+-
+-# They are not referenced. See set_output_directory().
+-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
+-set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+-set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
+-
+ if(APPLE AND DARWIN_LTO_LIBRARY)
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
+--
+2.26.2
+
diff --git a/dev-lang/rust/rust-1.47.0-r1.ebuild b/dev-lang/rust/rust-1.47.0-r1.ebuild
index cd258a9cb85a..371a9cd72b54 100644
--- a/dev-lang/rust/rust-1.47.0-r1.ebuild
+++ b/dev-lang/rust/rust-1.47.0-r1.ebuild
@@ -122,6 +122,7 @@ PATCHES=(
"${FILESDIR}"/1.47.0-libressl.patch
"${FILESDIR}"/1.46.0-don-t-create-prefix-at-time-of-check.patch
"${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
+ "${FILESDIR}"/1.47.0-llvm-tensorflow-fix.patch
"${FILESDIR}"/gentoo-musl-target-specs.patch
)