diff options
author | Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> | 2023-12-13 18:33:11 -0500 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-12-13 18:57:01 -0800 |
commit | 1602c0ad2a0dc011a3fac94b178a5b9935d78b80 (patch) | |
tree | 54cdc561324b586025172cb49b0e00d7aa675ed7 | |
parent | 79169d9be565b7a87310ca280d3a21aaf608ce33 (diff) | |
download | meta-clang-1602c0ad2a0dc011a3fac94b178a5b9935d78b80.tar.gz |
clang-native: fix swig binding generation
LLDB can't be built using kirkstone poky (swig 4.0.2) and current
kirkstone clang 14.0.6, because of compiler error mentioned in patches
Signed-off-by: Maxime Roussin-Belanger <maxime.roussinbelanger@gmail.com>
3 files changed, 76 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0038-lldb-Get-rid-of-__STDC_LIMIT_MACROS-and-__STDC_CONST.patch b/recipes-devtools/clang/clang/0038-lldb-Get-rid-of-__STDC_LIMIT_MACROS-and-__STDC_CONST.patch new file mode 100644 index 0000000..7a83a5c --- /dev/null +++ b/recipes-devtools/clang/clang/0038-lldb-Get-rid-of-__STDC_LIMIT_MACROS-and-__STDC_CONST.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | From 81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63 Mon Sep 17 00:00:00 2001 | ||
2 | From: serge-sans-paille <sguelton@redhat.com> | ||
3 | Date: Thu, 29 Sep 2022 21:48:38 +0200 | ||
4 | Subject: [PATCH] [lldb] Get rid of __STDC_LIMIT_MACROS and | ||
5 | __STDC_CONSTANT_MACROS | ||
6 | |||
7 | C++11 made the use of these macro obsolete, see https://sourceware.org/bugzilla/show_bug.cgi?id=15366 | ||
8 | |||
9 | As a side effect this prevents https://github.com/swig/swig/issues/2193. | ||
10 | |||
11 | Differential Revision: https://reviews.llvm.org/D134877 | ||
12 | |||
13 | Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63] | ||
14 | --- | ||
15 | lldb/bindings/CMakeLists.txt | 2 -- | ||
16 | lldb/bindings/interfaces.swig | 3 --- | ||
17 | 2 files changed, 5 deletions(-) | ||
18 | |||
19 | diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt | ||
20 | index c8aa0bcf9681..9eed2f1e6299 100644 | ||
21 | --- a/lldb/bindings/CMakeLists.txt | ||
22 | +++ b/lldb/bindings/CMakeLists.txt | ||
23 | @@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS | ||
24 | -features autodoc | ||
25 | -I${LLDB_SOURCE_DIR}/include | ||
26 | -I${CMAKE_CURRENT_SOURCE_DIR} | ||
27 | - -D__STDC_LIMIT_MACROS | ||
28 | - -D__STDC_CONSTANT_MACROS | ||
29 | ${DARWIN_EXTRAS} | ||
30 | ) | ||
31 | |||
32 | diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig | ||
33 | index fb75513a0df1..d984711bbd8a 100644 | ||
34 | --- a/lldb/bindings/interfaces.swig | ||
35 | +++ b/lldb/bindings/interfaces.swig | ||
36 | @@ -1,8 +1,5 @@ | ||
37 | /* Various liblldb typedefs that SWIG needs to know about. */ | ||
38 | #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ | ||
39 | -/* The ISO C99 standard specifies that in C++ implementations limit macros such | ||
40 | - as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ | ||
41 | -#define __STDC_LIMIT_MACROS | ||
42 | %include "stdint.i" | ||
43 | |||
44 | %include "lldb/lldb-defines.h" | ||
diff --git a/recipes-devtools/clang/clang/0039-lldb-Fix-error-non-const-lvalue.-caused-by-SWIG-4.1..patch b/recipes-devtools/clang/clang/0039-lldb-Fix-error-non-const-lvalue.-caused-by-SWIG-4.1..patch new file mode 100644 index 0000000..230798a --- /dev/null +++ b/recipes-devtools/clang/clang/0039-lldb-Fix-error-non-const-lvalue.-caused-by-SWIG-4.1..patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From f0a25fe0b746f56295d5c02116ba28d2f965c175 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jitka Plesnikova <jplesnik@redhat.com> | ||
3 | Date: Wed, 21 Sep 2022 11:42:46 +0200 | ||
4 | Subject: [PATCH] [lldb] Fix 'error: non-const lvalue...' caused by SWIG 4.1.0 | ||
5 | |||
6 | Fix the failure caused by change in SwigValueWraper for C++11 and later | ||
7 | for improved move semantics in SWIG commit. | ||
8 | |||
9 | https://github.com/swig/swig/commit/d1055f4b3d51cb8060893f8036846ac743302dab | ||
10 | |||
11 | Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/f0a25fe0b746f56295d5c02116ba28d2f965c175] | ||
12 | --- | ||
13 | lldb/bindings/python/python-typemaps.swig | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig | ||
17 | index 203be803d2eb..11f68d59ae7b 100644 | ||
18 | --- a/lldb/bindings/python/python-typemaps.swig | ||
19 | +++ b/lldb/bindings/python/python-typemaps.swig | ||
20 | @@ -435,7 +435,7 @@ template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) { | ||
21 | |||
22 | %typemap(out) lldb::FileSP { | ||
23 | $result = nullptr; | ||
24 | - lldb::FileSP &sp = $1; | ||
25 | + const lldb::FileSP &sp = $1; | ||
26 | if (sp) { | ||
27 | PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); | ||
28 | if (!pyfile.IsValid()) | ||
29 | -- | ||
30 | 2.36.0 | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 77d7142..d07243d 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -47,6 +47,8 @@ SRC_URI = "\ | |||
47 | file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \ | 47 | file://0035-compiler-rt-Enable-__int128-for-ppc32.patch \ |
48 | file://0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch \ | 48 | file://0036-compiler-rt-builtins-Move-DMB-definition-to-syn-opsh.patch \ |
49 | file://0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch \ | 49 | file://0037-sanitizer-Remove-include-linux-fs.h-to-resolve-fscon.patch \ |
50 | file://0038-lldb-Get-rid-of-__STDC_LIMIT_MACROS-and-__STDC_CONST.patch \ | ||
51 | file://0039-lldb-Fix-error-non-const-lvalue.-caused-by-SWIG-4.1..patch \ | ||
50 | " | 52 | " |
51 | # Fallback to no-PIE if not set | 53 | # Fallback to no-PIE if not set |
52 | GCCPIE ??= "" | 54 | GCCPIE ??= "" |