extra/llvm to 4.0.0-3

This commit is contained in:
Kevin Mihelich 2017-05-26 00:21:30 +00:00
parent 09cda85ca0
commit 1dc6d6b63f
3 changed files with 117 additions and 2 deletions

View file

@ -17,7 +17,7 @@ highmem=1
pkgname=('llvm' 'llvm-libs' 'llvm-ocaml' 'lld' 'lldb' 'clang' 'clang-tools-extra')
pkgver=4.0.0
pkgrel=2
pkgrel=3
_ocaml_ver=4.04.1
arch=('i686' 'x86_64')
url="http://llvm.org/"
@ -37,6 +37,8 @@ source=(http://releases.llvm.org/$pkgver/llvm-$pkgver.src.tar.xz{,.sig}
0002-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
0003-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
0001-AMDGPU-Fix-bug-31610.patch
lldb-gcc7.patch
lldb-libedit.patch
llvm-config.h)
sha256sums=('8d10511df96e73b8ff9e7abbfb4d4d432edbdbe965f1f4f07afaf370b8a533be'
'SKIP'
@ -54,6 +56,8 @@ sha256sums=('8d10511df96e73b8ff9e7abbfb4d4d432edbdbe965f1f4f07afaf370b8a533be'
'6d4e7541a70981d8c5162d92bf5604eec3f61536cc1a3ebc9f118dc892ae879b'
'a33a0106909b04c2a551a817d7184462e62995abaa01e5940cd3e67d28f141d5'
'cddd04be4fd822e03ff16b7640618e424d475d3bf04494c0d38aa225b920f00e'
'10cca2f593c711b1b547f479f9f783ab88f9a64b356519d9aa1367e0ff6da73a'
'b80bda6dc26792e499b3150e13c3017be4a65280b4b9f5c9f4c07b55a46d93b6'
'597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48')
validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D')
@ -70,6 +74,8 @@ prepare() {
patch -Np1 -i ../0001-AMDGPU-Fix-bug-31610.patch
patch -Np1 -d tools/clang/tools/extra <../0002-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
patch -Np1 -d tools/lld <../0003-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
patch -Np0 -d tools/lldb <../lldb-gcc7.patch
patch -Np1 -d tools/lldb <../lldb-libedit.patch
mkdir build
}
@ -89,7 +95,6 @@ build() {
-DLLVM_BUILD_DOCS=ON \
-DLLVM_ENABLE_SPHINX=ON \
-DLLVM_ENABLE_DOXYGEN=OFF \
-DLLDB_DISABLE_LIBEDIT=1 \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
-DLLVM_BINUTILS_INCDIR=/usr/include \

View file

@ -0,0 +1,12 @@
Index: include/lldb/Utility/TaskPool.h
===================================================================
--- include/lldb/Utility/TaskPool.h
+++ include/lldb/Utility/TaskPool.h
@@ -12,6 +12,7 @@
#include <cassert>
#include <cstdint>
+#include <functional>
#include <future>
#include <list>
#include <queue>

View file

@ -0,0 +1,98 @@
From 9ad9480c3a380a04b3dbe869c0675d6bba37247b Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski <n54@gmx.com>
Date: Thu, 25 May 2017 20:12:30 +0000
Subject: [PATCH] Fix bug #28898 lldb: libedit produces garbled, unusable input
on Linux
Apply patch from Christos Zoulas, upstream libedit developer.
It has been tested on NetBSD/amd64.
New code supports combination of wide libedit and disabled
LLDB_EDITLINE_USE_WCHAR, which was the popular case on Linux
systems.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@303907 91177308-0d34-0410-b5e6-96231b3b80d8
---
include/lldb/Host/Editline.h | 12 +++++++++---
source/Host/common/Editline.cpp | 8 ++++----
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
index 2b1a8e0..0b75e9c 100644
--- a/include/lldb/Host/Editline.h
+++ b/include/lldb/Host/Editline.h
@@ -82,8 +82,14 @@ using EditLineStringStreamType = std::stringstream;
using EditLineCharType = char;
#endif
+#ifdef EL_CLIENTDATA /* editline with wide support + wide char read function */
+using EditLineGetCharType = wchar_t;
+#else
+using EditLineGetCharType = char;
+#endif
+
typedef int (*EditlineGetCharCallbackType)(::EditLine *editline,
- EditLineCharType *c);
+ EditLineGetCharType *c);
typedef unsigned char (*EditlineCommandCallbackType)(::EditLine *editline,
int ch);
typedef const char *(*EditlinePromptCallbackType)(::EditLine *editline);
@@ -270,7 +276,7 @@ private:
/// Character reading implementation for EditLine that supports our multi-line
/// editing trickery.
- int GetCharacter(EditLineCharType *c);
+ int GetCharacter(EditLineGetCharType *c);
/// Prompt implementation for EditLine.
const char *Prompt();
@@ -323,7 +329,7 @@ private:
/// single or multi-line editing.
void ConfigureEditor(bool multiline);
- bool CompleteCharacter(char ch, EditLineCharType &out);
+ bool CompleteCharacter(char ch, EditLineGetCharType &out);
private:
#if LLDB_EDITLINE_USE_WCHAR
diff --git a/source/Host/common/Editline.cpp b/source/Host/common/Editline.cpp
index 7d4b398..7b580dd 100644
--- a/source/Host/common/Editline.cpp
+++ b/source/Host/common/Editline.cpp
@@ -474,7 +474,7 @@ unsigned char Editline::RecallHistory(bool earlier) {
return CC_NEWLINE;
}
-int Editline::GetCharacter(EditLineCharType *c) {
+int Editline::GetCharacter(EditLineGetCharType *c) {
const LineInfoW *info = el_wline(m_editline);
// Paint a faint version of the desired prompt over the version libedit draws
@@ -969,7 +969,7 @@ void Editline::ConfigureEditor(bool multiline) {
}));
el_wset(m_editline, EL_GETCFN, (EditlineGetCharCallbackType)([](
- EditLine *editline, EditLineCharType *c) {
+ EditLine *editline, EditLineGetCharType *c) {
return Editline::InstanceFor(editline)->GetCharacter(c);
}));
@@ -1360,12 +1360,12 @@ void Editline::PrintAsync(Stream *stream, const char *s, size_t len) {
}
}
-bool Editline::CompleteCharacter(char ch, EditLineCharType &out) {
+bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
#if !LLDB_EDITLINE_USE_WCHAR
if (ch == (char)EOF)
return false;
- out = ch;
+ out = (unsigned char)ch;
return true;
#else
std::codecvt_utf8<wchar_t> cvt;
--
2.13.0