aboutsummaryrefslogtreecommitdiffstats
path: root/testing/creduce
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-03-29 11:28:35 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-03-29 19:29:10 +0200
commitede55750bf42cdf3e5aa9b3814449aa265c9cc59 (patch)
tree33e983e6abf8c60b3e382e4dd2f37ed2c3453260 /testing/creduce
parent32cfcc20369ef63b64311b080ce4116c9a82828d (diff)
downloadaports-ede55750bf42cdf3e5aa9b3814449aa265c9cc59.tar.bz2
aports-ede55750bf42cdf3e5aa9b3814449aa265c9cc59.tar.xz
testing/creduce: apply upstream-pending patch to allow building with LLVM10
Diffstat (limited to 'testing/creduce')
-rw-r--r--testing/creduce/204.patch79
-rw-r--r--testing/creduce/APKBUILD8
2 files changed, 84 insertions, 3 deletions
diff --git a/testing/creduce/204.patch b/testing/creduce/204.patch
new file mode 100644
index 0000000000..1c02a36553
--- /dev/null
+++ b/testing/creduce/204.patch
@@ -0,0 +1,79 @@
+See: https://github.com/csmith-project/creduce/pull/204
+From 37a8db44d97029e95f3ab9a728d23053eb82c1cd Mon Sep 17 00:00:00 2001
+From: Bernhard Rosenkraenzer <bero@lindev.ch>
+Date: Thu, 6 Feb 2020 15:02:35 +0100
+Subject: [PATCH] Port to LLVM 10.0
+
+---
+ clang_delta/TransformationManager.cpp | 27 +++++++++++++++++++++++++--
+ 1 file changed, 25 insertions(+), 2 deletions(-)
+
+diff --git a/clang_delta/TransformationManager.cpp b/clang_delta/TransformationManager.cpp
+index ca2f2b48..acf82837 100644
+--- a/clang_delta/TransformationManager.cpp
++++ b/clang_delta/TransformationManager.cpp
+@@ -16,6 +16,7 @@
+
+ #include <sstream>
+
++#include "clang/Basic/Builtins.h"
+ #include "clang/Basic/Diagnostic.h"
+ #include "clang/Basic/TargetInfo.h"
+ #include "clang/Lex/Preprocessor.h"
+@@ -101,6 +102,7 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg)
+ CompilerInvocation &Invocation = ClangInstance->getInvocation();
+ InputKind IK = FrontendOptions::getInputKindForExtension(
+ StringRef(SrcFileName).rsplit('.').second);
++#if LLVM_VERSION_MAJOR < 10
+ if (IK.getLanguage() == InputKind::C) {
+ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::C, T, PPOpts);
+ }
+@@ -111,6 +113,18 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg)
+ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind::CXX, T, PPOpts);
+ }
+ else if(IK.getLanguage() == InputKind::OpenCL) {
++#else
++ if (IK.getLanguage() == Language::C) {
++ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::C), T, PPOpts);
++ }
++ else if (IK.getLanguage() == Language::CXX) {
++ // ISSUE: it might cause some problems when building AST
++ // for a function which has a non-declared callee, e.g.,
++ // It results an empty AST for the caller.
++ Invocation.setLangDefaults(ClangInstance->getLangOpts(), InputKind(Language::CXX), T, PPOpts);
++ }
++ else if(IK.getLanguage() == Language::OpenCL) {
++#endif
+ //Commandline parameters
+ std::vector<const char*> Args;
+ Args.push_back("-x");
+@@ -122,7 +136,7 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg)
+ ClangInstance->createFileManager();
+
+ if(CLCPath != NULL && ClangInstance->hasFileManager() &&
+- ClangInstance->getFileManager().getDirectory(CLCPath, false) != NULL) {
++ ClangInstance->getFileManager().getDirectory(CLCPath, false)) {
+ Args.push_back("-I");
+ Args.push_back(CLCPath);
+ }
+@@ -132,10 +146,19 @@ bool TransformationManager::initializeCompilerInstance(std::string &ErrorMsg)
+ Args.push_back("-fno-builtin");
+
+ CompilerInvocation::CreateFromArgs(Invocation,
++#if LLVM_VERSION_MAJOR >= 10
++ Args,
++#else
+ &Args[0], &Args[0] + Args.size(),
++#endif
+ ClangInstance->getDiagnostics());
+ Invocation.setLangDefaults(ClangInstance->getLangOpts(),
+- InputKind::OpenCL, T, PPOpts);
++#if LLVM_VERSION_MAJOR >= 10
++ InputKind(Language::OpenCL),
++#else
++ InputKind::OpenCL,
++#endif
++ T, PPOpts);
+ }
+ else {
+ ErrorMsg = "Unsupported file type!";
diff --git a/testing/creduce/APKBUILD b/testing/creduce/APKBUILD
index 495b883fad..7b7556e8aa 100644
--- a/testing/creduce/APKBUILD
+++ b/testing/creduce/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=creduce
pkgver=2.10.0
-pkgrel=2
+pkgrel=3
pkgdesc="A C/C++ program reducer"
url="https://embed.cs.utah.edu/creduce/"
arch="all"
@@ -12,7 +12,8 @@ depends="clang indent perl perl-exporter-lite perl-file-which
perl-getopt-tabular perl-regexp-common perl-term-readkey
util-linux"
makedepends="clang-dev clang-static flex llvm-dev zlib-dev"
-source="https://embed.cs.utah.edu/creduce/creduce-$pkgver.tar.gz"
+source="https://embed.cs.utah.edu/creduce/creduce-$pkgver.tar.gz
+ 204.patch"
build() {
./configure \
@@ -32,4 +33,5 @@ package() {
make DESTDIR="$pkgdir" install
}
-sha512sums="f2f2cc498cbf78331ea62e533579c84042ddc1ad8eb146adeae6b3a833e0ea4bb26a4ab5f1f61a30500a5a0c9c89cc1d4e4c8547aa9e4a14d3b5d744aeb4f6a7 creduce-2.10.0.tar.gz"
+sha512sums="f2f2cc498cbf78331ea62e533579c84042ddc1ad8eb146adeae6b3a833e0ea4bb26a4ab5f1f61a30500a5a0c9c89cc1d4e4c8547aa9e4a14d3b5d744aeb4f6a7 creduce-2.10.0.tar.gz
+c8c91ee37f6d633c34e6828a6235c409ec1e3f35292dc0722aa1c054ec8040cbd2bdb5f0792785a5c61cf3922c08f95ed819f9b1c2d82e793591c61dcbbb7249 204.patch"