1 |
commit: 5c5af6f0b0c4fb3e986d6a878568b2f8fed91db0 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 4 04:40:06 2018 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 4 04:41:26 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c5af6f0 |
7 |
|
8 |
dev-util/creduce: add upstream fix for building w/llvm-5 |
9 |
|
10 |
dev-util/creduce/creduce-2.7.0-r1.ebuild | 38 ++++++++++++++++ |
11 |
dev-util/creduce/files/creduce-2.7.0-llvm-5.patch | 54 +++++++++++++++++++++++ |
12 |
2 files changed, 92 insertions(+) |
13 |
|
14 |
diff --git a/dev-util/creduce/creduce-2.7.0-r1.ebuild b/dev-util/creduce/creduce-2.7.0-r1.ebuild |
15 |
new file mode 100644 |
16 |
index 00000000000..ec92e4710d2 |
17 |
--- /dev/null |
18 |
+++ b/dev-util/creduce/creduce-2.7.0-r1.ebuild |
19 |
@@ -0,0 +1,38 @@ |
20 |
+# Copyright 1999-2017 Gentoo Foundation |
21 |
+# Distributed under the terms of the GNU General Public License v2 |
22 |
+ |
23 |
+EAPI="6" |
24 |
+ |
25 |
+: ${CMAKE_MAKEFILE_GENERATOR=ninja} |
26 |
+inherit cmake-utils llvm |
27 |
+ |
28 |
+DESCRIPTION="C-Reduce - a plugin-based C program reducer" |
29 |
+HOMEPAGE="https://embed.cs.utah.edu/creduce/" |
30 |
+SRC_URI="https://embed.cs.utah.edu/creduce/${P}.tar.gz" |
31 |
+ |
32 |
+LICENSE="UoI-NCSA" |
33 |
+SLOT="0" |
34 |
+KEYWORDS="~amd64 ~x86" |
35 |
+IUSE="" |
36 |
+ |
37 |
+COMMON_DEPEND=" |
38 |
+ >=dev-lang/perl-5.10.0 |
39 |
+ >=sys-devel/clang-4:=" |
40 |
+RDEPEND="${COMMON_DEPEND} |
41 |
+ dev-perl/Benchmark-Timer |
42 |
+ dev-perl/Exporter-Lite |
43 |
+ dev-perl/File-Which |
44 |
+ dev-perl/Getopt-Tabular |
45 |
+ dev-perl/Regexp-Common |
46 |
+ dev-perl/Sys-CPU |
47 |
+ dev-util/astyle |
48 |
+ dev-util/indent" |
49 |
+DEPEND="${COMMON_DEPEND}" |
50 |
+ |
51 |
+PATCHES=( |
52 |
+ "${FILESDIR}"/${P}-llvm-5.patch |
53 |
+) |
54 |
+ |
55 |
+llvm_check_deps() { |
56 |
+ has_version "sys-devel/clang:${LLVM_SLOT}" |
57 |
+} |
58 |
|
59 |
diff --git a/dev-util/creduce/files/creduce-2.7.0-llvm-5.patch b/dev-util/creduce/files/creduce-2.7.0-llvm-5.patch |
60 |
new file mode 100644 |
61 |
index 00000000000..ecf2ac70fa8 |
62 |
--- /dev/null |
63 |
+++ b/dev-util/creduce/files/creduce-2.7.0-llvm-5.patch |
64 |
@@ -0,0 +1,54 @@ |
65 |
+From 97e2b29956adbe61973228ef7d8bff28e83d04d4 Mon Sep 17 00:00:00 2001 |
66 |
+From: Yang Chen <chenyang@×××××××.edu> |
67 |
+Date: Thu, 27 Apr 2017 20:55:32 -0700 |
68 |
+Subject: [PATCH] Fix build failure with LLVM trunk |
69 |
+ |
70 |
+Patch provided by Markus Trippelsdorf. Thanks! |
71 |
+ |
72 |
+"InputKind was refactored in Clang r301442. |
73 |
+ |
74 |
+The IK_Preprocessed* comparisons are superfluous now and can be dropped." |
75 |
+--- |
76 |
+ clang_delta/TransformationManager.cpp | 16 ++++++++-------- |
77 |
+ 1 file changed, 8 insertions(+), 8 deletions(-) |
78 |
+ |
79 |
+diff --git a/clang_delta/TransformationManager.cpp b/clang_delta/TransformationManager.cpp |
80 |
+index 8b6bdf454847..5db190cd71d1 100644 |
81 |
+--- a/clang_delta/TransformationManager.cpp |
82 |
++++ b/clang_delta/TransformationManager.cpp |
83 |
+@@ -101,16 +101,16 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg) |
84 |
+ CompilerInvocation &Invocation = ClangInstance->getInvocation(); |
85 |
+ InputKind IK = FrontendOptions::getInputKindForExtension( |
86 |
+ StringRef(SrcFileName).rsplit('.').second); |
87 |
+- if ((IK == IK_C) || (IK == IK_PreprocessedC)) { |
88 |
+- Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_C, T, PPOpts); |
89 |
++ if (IK.getLanguage() == InputKind::C) { |
90 |
++ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts); |
91 |
+ } |
92 |
+- else if ((IK == IK_CXX) || (IK == IK_PreprocessedCXX)) { |
93 |
++ else if (IK.getLanguage() == InputKind::CXX) { |
94 |
+ // ISSUE: it might cause some problems when building AST |
95 |
+- // for a function which has a non-declared callee, e.g., |
96 |
+- // It results an empty AST for the caller. |
97 |
+- Invocation.setLangDefaults(ClangInstance->getLangOpts(), IK_CXX, T, PPOpts); |
98 |
++ // for a function which has a non-declared callee, e.g., |
99 |
++ // It results an empty AST for the caller. |
100 |
++ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts); |
101 |
+ } |
102 |
+- else if(IK == IK_OpenCL) { |
103 |
++ else if(IK.getLanguage() == InputKind::OpenCL) { |
104 |
+ //Commandline parameters |
105 |
+ std::vector<const char*> Args; |
106 |
+ Args.push_back("-x"); |
107 |
+@@ -135,7 +135,7 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg) |
108 |
+ &Args[0], &Args[0] + Args.size(), |
109 |
+ ClangInstance->getDiagnostics()); |
110 |
+ Invocation.setLangDefaults(ClangInstance->getLangOpts(), |
111 |
+- IK_OpenCL, T, PPOpts); |
112 |
++ InputKind::OpenCL, T, PPOpts); |
113 |
+ } |
114 |
+ else { |
115 |
+ ErrorMsg = "Unsupported file type!"; |
116 |
+-- |
117 |
+2.15.1 |
118 |
+ |