Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/files/, dev-lang/rust/
Date: Wed, 28 Oct 2020 01:42:04
Message-Id: 1603849181.b4fb6fc0f73b4b4145236b56355c35070c3b529a.gyakovlev@gentoo
1 commit: b4fb6fc0f73b4b4145236b56355c35070c3b529a
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 28 01:39:19 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 28 01:39:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4fb6fc0
7
8 dev-lang/rust: fix build with tensorflow installed
9
10 Closes: https://bugs.gentoo.org/750875
11 Package-Manager: Portage-3.0.8, Repoman-3.0.2
12 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
13
14 .../rust/files/1.47.0-llvm-tensorflow-fix.patch | 55 ++++++++++++++++++++++
15 dev-lang/rust/rust-1.47.0-r1.ebuild | 1 +
16 2 files changed, 56 insertions(+)
17
18 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
19 new file mode 100644
20 index 00000000000..5b12c15ff40
21 --- /dev/null
22 +++ b/dev-lang/rust/files/1.47.0-llvm-tensorflow-fix.patch
23 @@ -0,0 +1,55 @@
24 +From 8dcb88f7705fb3927938dd9bd103efcabafcefb0 Mon Sep 17 00:00:00 2001
25 +From: Georgy Yakovlev <gyakovlev@g.o>
26 +Date: Tue, 27 Oct 2020 18:20:56 -0700
27 +Subject: [PATCH] backport D88371, guard `find_library(tensorflow_c_api ...)`
28 +
29 +Differential Revision: https://reviews.llvm.org/D88371
30 +Signed-off-by: Georgy Yakovlev <gyakovlev@g.o>
31 +---
32 + src/llvm-project/llvm/CMakeLists.txt | 15 +++++++--------
33 + 1 file changed, 7 insertions(+), 8 deletions(-)
34 +
35 +diff --git a/src/llvm-project/llvm/CMakeLists.txt b/src/llvm-project/llvm/CMakeLists.txt
36 +index 1f137f0..4112def 100644
37 +--- a/src/llvm-project/llvm/CMakeLists.txt
38 ++++ b/src/llvm-project/llvm/CMakeLists.txt
39 +@@ -832,6 +832,11 @@ configure_file(
40 + ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
41 + )
42 +
43 ++# They are not referenced. See set_output_directory().
44 ++set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
45 ++set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
46 ++set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
47 ++
48 + # For up-to-date instructions for installing the Tensorflow dependency, refer to
49 + # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
50 + # In this case, the latest C API library is available for download from
51 +@@ -840,9 +845,9 @@ configure_file(
52 + # LLVM_HAVE_TF_API, through llvm-config.h, so that a user of the LLVM library may
53 + # also leverage the dependency.
54 + set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
55 +-find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)
56 +
57 +-if (tensorflow_c_api)
58 ++if (TENSORFLOW_C_LIB_PATH)
59 ++ find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
60 + set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
61 + include_directories(${TENSORFLOW_C_LIB_PATH}/include)
62 + endif()
63 +@@ -877,12 +882,6 @@ add_custom_target(srpm
64 + COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE})
65 + set_target_properties(srpm PROPERTIES FOLDER "Misc")
66 +
67 +-
68 +-# They are not referenced. See set_output_directory().
69 +-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
70 +-set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
71 +-set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
72 +-
73 + if(APPLE AND DARWIN_LTO_LIBRARY)
74 + set(CMAKE_EXE_LINKER_FLAGS
75 + "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
76 +--
77 +2.26.2
78 +
79
80 diff --git a/dev-lang/rust/rust-1.47.0-r1.ebuild b/dev-lang/rust/rust-1.47.0-r1.ebuild
81 index cd258a9cb85..371a9cd72b5 100644
82 --- a/dev-lang/rust/rust-1.47.0-r1.ebuild
83 +++ b/dev-lang/rust/rust-1.47.0-r1.ebuild
84 @@ -122,6 +122,7 @@ PATCHES=(
85 "${FILESDIR}"/1.47.0-libressl.patch
86 "${FILESDIR}"/1.46.0-don-t-create-prefix-at-time-of-check.patch
87 "${FILESDIR}"/1.47.0-ignore-broken-and-non-applicable-tests.patch
88 + "${FILESDIR}"/1.47.0-llvm-tensorflow-fix.patch
89 "${FILESDIR}"/gentoo-musl-target-specs.patch
90 )