Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/llvm/files/11.0.0/, sys-devel/llvm/
Date: Wed, 28 Oct 2020 08:37:48
Message-Id: 1603874255.20ab0d476f1f2467cb35a863d36e21dfb48f075b.mgorny@gentoo
1 commit: 20ab0d476f1f2467cb35a863d36e21dfb48f075b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 28 08:08:41 2020 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 28 08:37:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20ab0d47
7
8 sys-devel/llvm: Backport tensorflow automagic dep fix
9
10 Backport patch fixing CMakeLists.txt not to use tensorflow
11 automagically. This also fixes build failure due to our TF packages
12 being incompatible. TF is now always-off.
13
14 Thanks to Georgy Yakovlev for rebasing and testing the patch.
15
16 Closes: https://bugs.gentoo.org/748444
17 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
18
19 ...88371-guard-find_library-tensorflow_c_api.patch | 55 ++++++++++++++++++++++
20 sys-devel/llvm/llvm-11.0.0.ebuild | 6 +++
21 2 files changed, 61 insertions(+)
22
23 diff --git a/sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch b/sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch
24 new file mode 100644
25 index 00000000000..73959afb267
26 --- /dev/null
27 +++ b/sys-devel/llvm/files/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch
28 @@ -0,0 +1,55 @@
29 +From 8dcb88f7705fb3927938dd9bd103efcabafcefb0 Mon Sep 17 00:00:00 2001
30 +From: Georgy Yakovlev <gyakovlev@g.o>
31 +Date: Tue, 27 Oct 2020 18:20:56 -0700
32 +Subject: [PATCH] backport D88371, guard `find_library(tensorflow_c_api ...)`
33 +
34 +Differential Revision: https://reviews.llvm.org/D88371
35 +Signed-off-by: Georgy Yakovlev <gyakovlev@g.o>
36 +---
37 + llvm/CMakeLists.txt | 15 +++++++--------
38 + 1 file changed, 7 insertions(+), 8 deletions(-)
39 +
40 +diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
41 +index 1f137f0..4112def 100644
42 +--- a/llvm/CMakeLists.txt
43 ++++ b/llvm/CMakeLists.txt
44 +@@ -832,6 +832,11 @@ configure_file(
45 + ${LLVM_INCLUDE_DIR}/llvm/Config/Targets.def
46 + )
47 +
48 ++# They are not referenced. See set_output_directory().
49 ++set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
50 ++set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
51 ++set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
52 ++
53 + # For up-to-date instructions for installing the Tensorflow dependency, refer to
54 + # the bot setup script: https://github.com/google/ml-compiler-opt/blob/master/buildbot/buildbot_init.sh
55 + # In this case, the latest C API library is available for download from
56 +@@ -840,9 +845,9 @@ configure_file(
57 + # LLVM_HAVE_TF_API, through llvm-config.h, so that a user of the LLVM library may
58 + # also leverage the dependency.
59 + set(TENSORFLOW_C_LIB_PATH "" CACHE PATH "Path to TensorFlow C library install")
60 +-find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib)
61 +
62 +-if (tensorflow_c_api)
63 ++if (TENSORFLOW_C_LIB_PATH)
64 ++ find_library(tensorflow_c_api tensorflow PATHS ${TENSORFLOW_C_LIB_PATH}/lib NO_DEFAULT_PATH REQUIRED)
65 + set(LLVM_HAVE_TF_API "ON" CACHE BOOL "Full Tensorflow API available")
66 + include_directories(${TENSORFLOW_C_LIB_PATH}/include)
67 + endif()
68 +@@ -877,12 +882,6 @@ add_custom_target(srpm
69 + COMMAND rpmbuild -bs --define '_topdir ${LLVM_SRPM_DIR}' ${LLVM_SRPM_BINARY_SPECFILE})
70 + set_target_properties(srpm PROPERTIES FOLDER "Misc")
71 +
72 +-
73 +-# They are not referenced. See set_output_directory().
74 +-set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/bin )
75 +-set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
76 +-set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
77 +-
78 + if(APPLE AND DARWIN_LTO_LIBRARY)
79 + set(CMAKE_EXE_LINKER_FLAGS
80 + "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
81 +--
82 +2.26.2
83 +
84
85 diff --git a/sys-devel/llvm/llvm-11.0.0.ebuild b/sys-devel/llvm/llvm-11.0.0.ebuild
86 index 6bdf1c7ec77..ad20115fb6b 100644
87 --- a/sys-devel/llvm/llvm-11.0.0.ebuild
88 +++ b/sys-devel/llvm/llvm-11.0.0.ebuild
89 @@ -73,6 +73,12 @@ RDEPEND="${RDEPEND}
90 PDEPEND="sys-devel/llvm-common
91 gold? ( >=sys-devel/llvmgold-${SLOT} )"
92
93 +PATCHES=(
94 + # backport tensorflow finding fix (avoids broken automagic dep)
95 + # https://bugs.gentoo.org/748444
96 + "${FILESDIR}"/11.0.0/0001-backport-D88371-guard-find_library-tensorflow_c_api.patch
97 +)
98 +
99 python_check_deps() {
100 use doc || return 0