[arch-commits] Commit in llvm/trunk (PKGBUILD lldb-libedit.patch)

Evangelos Foutras foutrelis at archlinux.org
Fri May 26 00:06:05 UTC 2017


    Date: Friday, May 26, 2017 @ 00:06:04
  Author: foutrelis
Revision: 296634

upgpkg: llvm 4.0.0-3

Re-enable libedit in LLDB and patch the latter to work properly with
recent versions of libedit (FS#49974).

Added:
  llvm/trunk/lldb-libedit.patch
Modified:
  llvm/trunk/PKGBUILD

--------------------+
 PKGBUILD           |    6 ++-
 lldb-libedit.patch |   98 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-05-25 23:50:09 UTC (rev 296633)
+++ PKGBUILD	2017-05-26 00:06:04 UTC (rev 296634)
@@ -11,7 +11,7 @@
 
 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/"
@@ -32,6 +32,7 @@
         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'
@@ -50,6 +51,7 @@
             'a33a0106909b04c2a551a817d7184462e62995abaa01e5940cd3e67d28f141d5'
             'cddd04be4fd822e03ff16b7640618e424d475d3bf04494c0d38aa225b920f00e'
             '10cca2f593c711b1b547f479f9f783ab88f9a64b356519d9aa1367e0ff6da73a'
+            'b80bda6dc26792e499b3150e13c3017be4a65280b4b9f5c9f4c07b55a46d93b6'
             '597dc5968c695bbdbb0eac9e8eb5117fcd2773bc91edf5ec103ecffffab8bc48')
 validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D')
 
@@ -67,6 +69,7 @@
   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
 }
@@ -86,7 +89,6 @@
     -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 \

Added: lldb-libedit.patch
===================================================================
--- lldb-libedit.patch	                        (rev 0)
+++ lldb-libedit.patch	2017-05-26 00:06:04 UTC (rev 296634)
@@ -0,0 +1,98 @@
+From 9ad9480c3a380a04b3dbe869c0675d6bba37247b Mon Sep 17 00:00:00 2001
+From: Kamil Rytarowski <n54 at 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
+



More information about the arch-commits mailing list