Skip to content

Commit 6d39b24

Browse files
Gary-Hobsonxiaoxiang781216
authored andcommitted
libcxxabi: fix compilation warnings
Signed-off-by: yinshengkai <[email protected]>
1 parent ad76a4f commit 6d39b24

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From df7ad61eb3ce52ebf864f30ec3ad1a6ccea74730 Mon Sep 17 00:00:00 2001
2+
From: cuiziwei <[email protected]>
3+
Date: Thu, 23 May 2024 11:11:30 +0800
4+
libcxxabi:Fix build warnings generated by CMake
5+
compilation.
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset=UTF-8
8+
Content-Transfer-Encoding: 8bit
9+
10+
VELAPLATFO-32782
11+
12+
nuttx/libs/libxx/libcxxabi/src/cxa_personality.cpp: In function ‘void __cxxabiv1::__cxa_call_unexpected(void*)’:
13+
nuttx/libs/libxx/libcxxabi/src/cxa_personality.cpp:1250:46: warning: ‘ttypeIndex’ may be used uninitialized [-Wmaybe-uninitialized]
14+
1250 | if (!exception_spec_can_catch(ttypeIndex, classInfo, ttypeEncoding,
15+
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
1251 | excpType, adjustedPtr,
17+
| ~~~~~~~~~~~~~~~~~~~~~~
18+
1252 | unwind_exception, base))
19+
20+
Change-Id: Ic114508ecdad7cc84e7ad997a9379e50b2efd2a5
21+
Signed-off-by: cuiziwei <[email protected]>
22+
---
23+
src/cxa_personality.cpp | 2 +-
24+
1 file changed, 1 insertion(+), 1 deletion(-)
25+
26+
diff --git libcxxabi/src/cxa_personality.cpp libcxxabi/src/cxa_personality.cpp
27+
index b28c58d..5b58037 100644
28+
--- libcxxabi/src/cxa_personality.cpp
29+
+++ libcxxabi/src/cxa_personality.cpp
30+
@@ -1174,7 +1174,7 @@ __cxa_call_unexpected(void* arg)
31+
std::unexpected_handler u_handler;
32+
std::terminate_handler t_handler;
33+
__cxa_exception* old_exception_header = 0;
34+
- int64_t ttypeIndex;
35+
+ int64_t ttypeIndex = 0;
36+
const uint8_t* lsda;
37+
uintptr_t base = 0;
38+
39+
--
40+
2.34.1
41+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From b84bcf890c949d248ade97a5e1fbcf2a8e3efcd7 Mon Sep 17 00:00:00 2001
2+
From: yinshengkai <[email protected]>
3+
Date: Fri, 5 Jul 2024 16:59:49 +0800
4+
libcxxabi: fix compilation errors
5+
6+
error: invalid conversion from 'int' to '_Unwind_State' [-fpermissive]
7+
1073 | state &= ~_US_FORCE_UNWIND;
8+
| ~~~~~~^~~~~~~~~~~~~~~~~~~~
9+
| |
10+
| int
11+
12+
Change-Id: I47827d58438f248e2171d20a44cc29ed8b259fc5
13+
Signed-off-by: yinshengkai <[email protected]>
14+
---
15+
src/cxa_personality.cpp | 2 +-
16+
1 file changed, 1 insertion(+), 1 deletion(-)
17+
18+
diff --git libcxxabi/src/cxa_personality.cpp libcxxabi/src/cxa_personality.cpp
19+
index 5b58037..3e1fd83 100644
20+
--- libcxxabi/src/cxa_personality.cpp
21+
+++ libcxxabi/src/cxa_personality.cpp
22+
@@ -1070,7 +1070,7 @@ __gxx_personality_v0(_Unwind_State state,
23+
24+
// Check the undocumented force unwinding behavior
25+
bool is_force_unwinding = state & _US_FORCE_UNWIND;
26+
- state &= ~_US_FORCE_UNWIND;
27+
+ state = (_Unwind_State)(state & ~_US_FORCE_UNWIND);
28+
29+
scan_results results;
30+
switch (state) {
31+
--
32+
2.34.1
33+

libs/libxx/libcxxabi.defs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz:
2828
libcxxabi: libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
2929
$(Q) tar -xf libcxxabi-$(LIBCXXABI_VERSION).src.tar.xz
3030
$(Q) mv libcxxabi-$(LIBCXXABI_VERSION).src libcxxabi
31+
$(Q) patch -p0 < 0001-libcxxabi-Fix-build-warnings-generated-by-CMake-comp.patch
32+
$(Q) patch -p0 < 0002-libcxxabi-fix-compilation-errors.patch
3133
$(Q) touch $@
3234
endif
3335

0 commit comments

Comments
 (0)