devel/llvm: fix lldb build with swig 4.1.0

from https://reviews.llvm.org/D134877
via https://bugzilla.redhat.com/show_bug.cgi?id=2128646
This commit is contained in:
landry 2022-11-02 16:39:04 +00:00
parent dca1b3fa0d
commit a964f631b9
4 changed files with 46 additions and 0 deletions

View File

@ -16,6 +16,7 @@ PKGSPEC-main = llvm-=${LLVM_V}
PKGNAME-python = py3-llvm-${LLVM_V}
PKGNAME-lldb = lldb-${LLVM_V}
REVISION-main = 3
REVISION-lldb = 0
CATEGORIES = devel

View File

@ -0,0 +1,15 @@
Fix build with swig 4.1.0
cf https://reviews.llvm.org/D134877
cf https://bugzilla.redhat.com/show_bug.cgi?id=2128646
Index: tools/lldb/bindings/CMakeLists.txt
--- tools/lldb/bindings/CMakeLists.txt.orig
+++ tools/lldb/bindings/CMakeLists.txt
@@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS
-features autodoc
-I${LLDB_SOURCE_DIR}/include
-I${CMAKE_CURRENT_SOURCE_DIR}
- -D__STDC_LIMIT_MACROS
- -D__STDC_CONSTANT_MACROS
${DARWIN_EXTRAS}
)

View File

@ -0,0 +1,15 @@
Fix build with swig 4.1.0
cf https://reviews.llvm.org/D134877
cf https://bugzilla.redhat.com/show_bug.cgi?id=2128646
Index: tools/lldb/bindings/interfaces.swig
--- tools/lldb/bindings/interfaces.swig.orig
+++ tools/lldb/bindings/interfaces.swig
@@ -1,8 +1,5 @@
/* Various liblldb typedefs that SWIG needs to know about. */
#define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */
-/* The ISO C99 standard specifies that in C++ implementations limit macros such
- as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */
-#define __STDC_LIMIT_MACROS
%include "stdint.i"
%include "lldb/lldb-defines.h"

View File

@ -0,0 +1,15 @@
fix build with swig 4.1.0
https://github.com/llvm/llvm-project/commit/f0a25fe0b746f56295d5c02116ba28d2f965c175
Index: tools/lldb/bindings/python/python-typemaps.swig
--- tools/lldb/bindings/python/python-typemaps.swig.orig
+++ tools/lldb/bindings/python/python-typemaps.swig
@@ -439,7 +439,7 @@ bool SetNumberFromPyObject<double>(double &number, PyO
%typemap(out) lldb::FileSP {
$result = nullptr;
- lldb::FileSP &sp = $1;
+ const lldb::FileSP &sp = $1;
if (sp) {
PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp));
if (!pyfile.IsValid())