diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2022-11-23 12:40:56 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-11-23 08:38:38 -0800 |
commit | 8bf9f02d5193c9712d6b383bdf7d98d853c4711b (patch) | |
tree | 49256527ec1d5f6058a1d9e1a30290e07c37e261 /recipes-devtools | |
parent | f71d12dc480550ebf88d7bc47a34d7b20ee0707f (diff) | |
download | meta-clang-8bf9f02d5193c9712d6b383bdf7d98d853c4711b.tar.gz |
clang: backport patches to fix lldb errors
OE-core recently upgraded to swig 4.1.0 which results in errors:
11:49:31 | /poky/build/tmp/work-shared/llvm-project-source-15.0.4-r0/git/lldb/bindings/interfaces.swig:5: Error: Macro '__STDC_LIMIT_MACROS' redefined,
11:49:31 | :1: Error: previous definition of '__STDC_LIMIT_MACROS'.
Backport patches from release/15.x branch to fix these.
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'recipes-devtools')
3 files changed, 78 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0035-lldb-fix-swig-error.patch b/recipes-devtools/clang/clang/0035-lldb-fix-swig-error.patch new file mode 100644 index 0000000..460680b --- /dev/null +++ b/recipes-devtools/clang/clang/0035-lldb-fix-swig-error.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 392963bb1daf7ec8822a0f02929a8ada17eb0a0a 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 | (cherry picked from commit f0a25fe0b746f56295d5c02116ba28d2f965c175) | ||
11 | |||
12 | Upstream-Status: Backport | ||
13 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
14 | --- | ||
15 | lldb/bindings/python/python-typemaps.swig | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/lldb/bindings/python/python-typemaps.swig b/lldb/bindings/python/python-typemaps.swig | ||
19 | index bf3de66b91bf..d45431c771ca 100644 | ||
20 | --- a/lldb/bindings/python/python-typemaps.swig | ||
21 | +++ b/lldb/bindings/python/python-typemaps.swig | ||
22 | @@ -435,7 +435,7 @@ template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) { | ||
23 | |||
24 | %typemap(out) lldb::FileSP { | ||
25 | $result = nullptr; | ||
26 | - lldb::FileSP &sp = $1; | ||
27 | + const lldb::FileSP &sp = $1; | ||
28 | if (sp) { | ||
29 | PythonFile pyfile = unwrapOrSetPythonException(PythonFile::FromFile(*sp)); | ||
30 | if (!pyfile.IsValid()) | ||
diff --git a/recipes-devtools/clang/clang/0036-dc8f6ffc3bf297098a1dfd3fbce801afbe9f5238.patch b/recipes-devtools/clang/clang/0036-dc8f6ffc3bf297098a1dfd3fbce801afbe9f5238.patch new file mode 100644 index 0000000..2c3498c --- /dev/null +++ b/recipes-devtools/clang/clang/0036-dc8f6ffc3bf297098a1dfd3fbce801afbe9f5238.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From dc8f6ffc3bf297098a1dfd3fbce801afbe9f5238 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 | (cherry picked from commit 81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63) | ||
14 | Upstream-Status: Backport | ||
15 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
16 | --- | ||
17 | lldb/bindings/CMakeLists.txt | 2 -- | ||
18 | lldb/bindings/interfaces.swig | 3 --- | ||
19 | 2 files changed, 5 deletions(-) | ||
20 | |||
21 | diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt | ||
22 | index c8aa0bcf9681..9eed2f1e6299 100644 | ||
23 | --- a/lldb/bindings/CMakeLists.txt | ||
24 | +++ b/lldb/bindings/CMakeLists.txt | ||
25 | @@ -26,8 +26,6 @@ set(SWIG_COMMON_FLAGS | ||
26 | -features autodoc | ||
27 | -I${LLDB_SOURCE_DIR}/include | ||
28 | -I${CMAKE_CURRENT_SOURCE_DIR} | ||
29 | - -D__STDC_LIMIT_MACROS | ||
30 | - -D__STDC_CONSTANT_MACROS | ||
31 | ${DARWIN_EXTRAS} | ||
32 | ) | ||
33 | |||
34 | diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig | ||
35 | index c9a6d0f06056..021c7683d170 100644 | ||
36 | --- a/lldb/bindings/interfaces.swig | ||
37 | +++ b/lldb/bindings/interfaces.swig | ||
38 | @@ -1,8 +1,5 @@ | ||
39 | /* Various liblldb typedefs that SWIG needs to know about. */ | ||
40 | #define __extension__ /* Undefine GCC keyword to make Swig happy when processing glibc's stdint.h. */ | ||
41 | -/* The ISO C99 standard specifies that in C++ implementations limit macros such | ||
42 | - as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */ | ||
43 | -#define __STDC_LIMIT_MACROS | ||
44 | %include "stdint.i" | ||
45 | |||
46 | %include "lldb/lldb-defines.h" | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index a0f8a00..5f6a6f4 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -44,6 +44,8 @@ SRC_URI = "\ | |||
44 | file://0032-compiler-rt-Enable-__int128-for-ppc32.patch \ | 44 | file://0032-compiler-rt-Enable-__int128-for-ppc32.patch \ |
45 | file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ | 45 | file://0033-llvm-Do-not-use-cmake-infra-to-detect-libzstd.patch \ |
46 | file://0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch \ | 46 | file://0034-Revert-MIPS-compiler-rt-Fix-stat-struct-s-size-for-O.patch \ |
47 | file://0035-lldb-fix-swig-error.patch \ | ||
48 | file://0036-dc8f6ffc3bf297098a1dfd3fbce801afbe9f5238.patch \ | ||
47 | " | 49 | " |
48 | # Fallback to no-PIE if not set | 50 | # Fallback to no-PIE if not set |
49 | GCCPIE ??= "" | 51 | GCCPIE ??= "" |