Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/ispc/files/, dev-lang/ispc/
Date: Thu, 10 Sep 2020 00:42:25
Message-Id: 1599698532.65348f0cb721bd7b1a16b44915ca70cfabcfc064.sam@gentoo
1 commit: 65348f0cb721bd7b1a16b44915ca70cfabcfc064
2 Author: Sebastian Parborg <darkdefende <AT> gmail <DOT> com>
3 AuthorDate: Sat Sep 5 21:41:48 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 10 00:42:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65348f0c
7
8 dev-lang/ispc: Version bump to 1.14.0
9
10 Signed-off-by: Sebastian Parborg <darkdefende <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 dev-lang/ispc/Manifest | 1 +
14 dev-lang/ispc/files/ispc-1.14.0-llvm-10.patch | 106 ++++++++++++++++++++++++++
15 dev-lang/ispc/ispc-1.14.0.ebuild | 65 ++++++++++++++++
16 3 files changed, 172 insertions(+)
17
18 diff --git a/dev-lang/ispc/Manifest b/dev-lang/ispc/Manifest
19 index b1de2c9d7ee..886b57a17be 100644
20 --- a/dev-lang/ispc/Manifest
21 +++ b/dev-lang/ispc/Manifest
22 @@ -1 +1,2 @@
23 DIST ispc-1.13.0.tar.gz 19202295 BLAKE2B 5fae81429acbda0d65d33e56609d05fb8b5a7db6dd0af5ff779d1e8954f6a98d1fcb0f7ecf0c1b9813630026557c21c2a70bfc87ed75959a8bd24e06fcd2e351 SHA512 d23c127beb9bb17e1ad2509f9ad51dd660c473458b939a6b64ca7f6319b3c2f25318ea2ceac00e4100a059f3f67fb97b6973f18e3432c82ff9691f2a08d15d5d
24 +DIST ispc-1.14.0.tar.gz 19454030 BLAKE2B 3bd494f4357c7c756c6bc63c76ced37feb83e8f6f73b0adc9e432f37e905efe0f7fe5f8b153d3ccff3ac9f826d0c76f7c33f2a151887ab900088bab95e626856 SHA512 a1325a26804f08a357c84cb1d7266bd56d6d135314985337e057e39ddf556a7332922926e9d10db817048a8d5b491467de7261029a0a46726f330a00791ee8f8
25
26 diff --git a/dev-lang/ispc/files/ispc-1.14.0-llvm-10.patch b/dev-lang/ispc/files/ispc-1.14.0-llvm-10.patch
27 new file mode 100644
28 index 00000000000..7a76d99aca8
29 --- /dev/null
30 +++ b/dev-lang/ispc/files/ispc-1.14.0-llvm-10.patch
31 @@ -0,0 +1,106 @@
32 +diff --git a/CMakeLists.txt b/CMakeLists.txt
33 +index 13e66268..27ff8364 100644
34 +--- a/CMakeLists.txt
35 ++++ b/CMakeLists.txt
36 +@@ -218,7 +218,7 @@ if (WASM_ENABLED)
37 + list(APPEND ISPC_TARGETS wasm-i32x4)
38 + endif()
39 +
40 +-set(CLANG_LIBRARY_LIST clangFrontend clangDriver clangSerialization clangParse clangSema clangAnalysis clangAST clangBasic clangEdit clangLex)
41 ++set(CLANG_LIBRARY_LIST clang clang-cpp)
42 + set(LLVM_COMPONENTS engine ipo bitreader bitwriter instrumentation linker option)
43 +
44 + if (${LLVM_VERSION_NUMBER} VERSION_GREATER_EQUAL "10.0.0")
45 +@@ -402,11 +402,8 @@ if (ISPC_USE_ASAN)
46 + endif()
47 +
48 + # Link against Clang libraries
49 +-foreach(clangLib ${CLANG_LIBRARY_LIST})
50 +- find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
51 +- list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
52 +-endforeach()
53 +-target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
54 ++find_package(Clang REQUIRED)
55 ++target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_LIST})
56 +
57 + # Link against LLVM libraries
58 + target_link_libraries(${PROJECT_NAME} ${LLVM_LIBRARY_LIST})
59 +diff --git a/src/llvmutil.cpp b/src/llvmutil.cpp
60 +index 06fab989..57a7130f 100644
61 +--- a/src/llvmutil.cpp
62 ++++ b/src/llvmutil.cpp
63 +@@ -42,6 +42,7 @@
64 + #include <llvm/IR/BasicBlock.h>
65 + #include <llvm/IR/Instructions.h>
66 + #include <llvm/IR/Module.h>
67 ++#include <llvm/Support/raw_ostream.h>
68 +
69 + #ifdef ISPC_GENX_ENABLED
70 + #include <llvm/GenXIntrinsics/GenXIntrinsics.h>
71 +@@ -1394,7 +1395,7 @@ static void lDumpValue(llvm::Value *v, std::set<llvm::Value *> &done) {
72 + return;
73 +
74 + fprintf(stderr, " ");
75 +- v->dump();
76 ++ v->print(llvm::outs(), false);
77 + done.insert(v);
78 +
79 + if (inst == NULL)
80 +diff --git a/src/opt.cpp b/src/opt.cpp
81 +index d78ac374..a607594a 100644
82 +--- a/src/opt.cpp
83 ++++ b/src/opt.cpp
84 +@@ -142,7 +142,7 @@ static llvm::Pass *CreateFixBooleanSelectPass();
85 + getenv("FUNC"), strlen(getenv("FUNC")))))) { \
86 + fprintf(stderr, "Start of " NAME "\n"); \
87 + fprintf(stderr, "---------------\n"); \
88 +- bb.dump(); \
89 ++ bb.print(llvm::outs(), false); \
90 + fprintf(stderr, "---------------\n\n"); \
91 + } else /* eat semicolon */
92 +
93 +@@ -152,7 +152,7 @@ static llvm::Pass *CreateFixBooleanSelectPass();
94 + getenv("FUNC"), strlen(getenv("FUNC")))))) { \
95 + fprintf(stderr, "End of " NAME " %s\n", modifiedAny ? "** CHANGES **" : ""); \
96 + fprintf(stderr, "---------------\n"); \
97 +- bb.dump(); \
98 ++ bb.print(llvm::outs(), false); \
99 + fprintf(stderr, "---------------\n\n"); \
100 + } else /* eat semicolon */
101 + #else
102 +@@ -453,7 +453,7 @@ void Optimize(llvm::Module *module, int optLevel) {
103 + #ifndef ISPC_NO_DUMPS
104 + if (g->debugPrint) {
105 + printf("*** Code going into optimization ***\n");
106 +- module->dump();
107 ++ module->print(llvm::outs(), nullptr);
108 + }
109 + #endif
110 + DebugPassManager optPM;
111 +@@ -666,7 +666,7 @@ void Optimize(llvm::Module *module, int optLevel) {
112 + #ifndef ISPC_NO_DUMPS
113 + if (g->debugPrint) {
114 + printf("\n*****\nFINAL OUTPUT\n*****\n");
115 +- module->dump();
116 ++ module->print(llvm::outs(), nullptr);
117 + }
118 + #endif
119 + }
120 +@@ -4256,7 +4256,7 @@ char DebugPass::ID = 0;
121 + bool DebugPass::runOnModule(llvm::Module &module) {
122 + fprintf(stderr, "%s", str_output);
123 + fflush(stderr);
124 +- module.dump();
125 ++ module.print(llvm::outs(), nullptr);
126 + return true;
127 + }
128 +
129 +@@ -4303,7 +4303,7 @@ void DebugPassFile::run(llvm::Module &module, bool init) {
130 + snprintf(fname, sizeof(fname), "%s_%d_%s.ll", init ? "init" : "ir", pnum, sanitize(std::string(pname)).c_str());
131 + llvm::raw_fd_ostream OS(fname, EC, llvm::sys::fs::F_None);
132 + Assert(!EC && "IR dump file creation failed!");
133 +- module.print(OS, 0);
134 ++ module.print(OS, nullptr);
135 + }
136 +
137 + bool DebugPassFile::runOnModule(llvm::Module &module) {
138
139 diff --git a/dev-lang/ispc/ispc-1.14.0.ebuild b/dev-lang/ispc/ispc-1.14.0.ebuild
140 new file mode 100644
141 index 00000000000..f5ecbcdb7ea
142 --- /dev/null
143 +++ b/dev-lang/ispc/ispc-1.14.0.ebuild
144 @@ -0,0 +1,65 @@
145 +# Copyright 1999-2020 Gentoo Authors
146 +# Distributed under the terms of the GNU General Public License v2
147 +
148 +EAPI=7
149 +
150 +PYTHON_COMPAT=( python3_{6,7,8,9} )
151 +
152 +inherit cmake toolchain-funcs python-any-r1
153 +
154 +DESCRIPTION="Intel SPMD Program Compiler"
155 +HOMEPAGE="https://ispc.github.com/"
156 +
157 +if [[ ${PV} = *9999 ]]; then
158 + inherit git-r3
159 + EGIT_REPO_URI="https://github.com/ispc/ispc.git"
160 + KEYWORDS=""
161 +else
162 + SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
163 + KEYWORDS="~amd64 ~x86"
164 +fi
165 +
166 +LICENSE="BSD BSD-2 UoI-NCSA"
167 +SLOT="0"
168 +IUSE="examples"
169 +
170 +RDEPEND="
171 + >=sys-devel/clang-3.0:*
172 + >=sys-devel/llvm-3.0:*
173 + "
174 +DEPEND="
175 + ${RDEPEND}
176 + ${PYTHON_DEPS}
177 + "
178 +BDEPEND="
179 + sys-devel/bison
180 + sys-devel/flex
181 + "
182 +
183 +PATCHES=(
184 + "${FILESDIR}/${PN}-1.13.0-cmake-gentoo-release.patch"
185 + "${FILESDIR}/${PN}-1.14.0-llvm-10.patch"
186 + "${FILESDIR}/${PN}-1.13.0-werror.patch"
187 +)
188 +
189 +src_configure() {
190 + local mycmakeargs=(
191 + "-DARM_ENABLED=$(usex arm)"
192 + )
193 + cmake_src_configure
194 +}
195 +
196 +src_install() {
197 + dobin "${BUILD_DIR}"/bin/ispc
198 + dodoc README.md
199 +
200 + if use examples; then
201 + insinto "/usr/share/doc/${PF}/examples"
202 + docompress -x "/usr/share/doc/${PF}/examples"
203 + doins -r "${BUILD_DIR}"/examples/*
204 + fi
205 +}
206 +
207 +src_test() {
208 + ${EPYTHON} run_tests.py || die "Testing failed."
209 +}