Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-01-28 00:48:38 +0300
committerMichał Górny <mgorny@moritz.systems>2022-01-28 01:05:11 +0300
commitcd20e579df07517a4ddbf6eef58b96d04f6bd9a9 (patch)
tree75126c2dc565d17b1be0ab9172f57fe2c91fc19e /libunwind
parent867fdec1945df3c1031d3cefdc97903131a3482b (diff)
[unwind] fix build with GCC on PPC32
Originally reported downstream in Gentoo: https://bugs.gentoo.org/832140 ``` /var/tmp/portage/sys-libs/llvm-libunwind-13.0.0/work/libunwind/src/libunwind.cpp:77:3: error: #error Architecture not supported 77 | # error Architecture not supported | ^~~~~ [...] /var/tmp/portage/sys-libs/llvm-libunwind-13.0.0/work/libunwind/src/libunwind.cpp: In function ‘int __unw_init_local(unw_cursor_t*, unw_context_t*)’: /var/tmp/portage/sys-libs/llvm-libunwind-13.0.0/work/libunwind/src/libunwind.cpp:80:57: error: ‘REGISTER_KIND’ was not declared in this scope 80 | new (reinterpret_cast<UnwindCursor<LocalAddressSpace, REGISTER_KIND> *>(cursor)) | ^~~~~~~~~~~~~ [...] ``` PPC is actually a supported architecture, but GCC (tested with 11.2.0) on powerpc32 seems to only define: `__PPC__, _ARCH_PPC, __PPC, __powerpc` and //not// `__ppc__`. This instead uses `__powerpc__` which should be around on PPC32 and PPC64 (but we check it after PPC64, so it's fine). Signed-off-by: Sam James <sam@gentoo.org> Differential Revision: https://reviews.llvm.org/D118320
Diffstat (limited to 'libunwind')
-rw-r--r--libunwind/include/__libunwind_config.h2
-rw-r--r--libunwind/src/UnwindRegistersRestore.S2
-rw-r--r--libunwind/src/UnwindRegistersSave.S4
-rw-r--r--libunwind/src/assembly.h2
-rw-r--r--libunwind/src/config.h2
-rw-r--r--libunwind/src/libunwind.cpp2
6 files changed, 7 insertions, 7 deletions
diff --git a/libunwind/include/__libunwind_config.h b/libunwind/include/__libunwind_config.h
index 221980a24aeb..67527d9da404 100644
--- a/libunwind/include/__libunwind_config.h
+++ b/libunwind/include/__libunwind_config.h
@@ -55,7 +55,7 @@
# define _LIBUNWIND_CONTEXT_SIZE 167
# define _LIBUNWIND_CURSOR_SIZE 179
# define _LIBUNWIND_HIGHEST_DWARF_REGISTER _LIBUNWIND_HIGHEST_DWARF_REGISTER_PPC64
-# elif defined(__ppc__)
+# elif defined(__powerpc__)
# define _LIBUNWIND_TARGET_PPC 1
# define _LIBUNWIND_CONTEXT_SIZE 117
# define _LIBUNWIND_CURSOR_SIZE 124
diff --git a/libunwind/src/UnwindRegistersRestore.S b/libunwind/src/UnwindRegistersRestore.S
index 694738b5155a..f3d9dd31683e 100644
--- a/libunwind/src/UnwindRegistersRestore.S
+++ b/libunwind/src/UnwindRegistersRestore.S
@@ -394,7 +394,7 @@ Lnovec:
PPC64_LR(3)
bctr
-#elif defined(__ppc__)
+#elif defined(__powerpc__)
DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind13Registers_ppc6jumptoEv)
//
diff --git a/libunwind/src/UnwindRegistersSave.S b/libunwind/src/UnwindRegistersSave.S
index e77012e5c613..42fd7ed1a1b6 100644
--- a/libunwind/src/UnwindRegistersSave.S
+++ b/libunwind/src/UnwindRegistersSave.S
@@ -326,7 +326,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
teq $0, $0
-#elif defined(__powerpc64__)
+#elif defined(__powerpc__)
//
// extern int __unw_getcontext(unw_context_t* thread_state)
@@ -559,7 +559,7 @@ DEFINE_LIBUNWIND_FUNCTION(__unw_getcontext)
blr
-#elif defined(__ppc__)
+#elif defined(__powerpc__)
//
// extern int unw_getcontext(unw_context_t* thread_state)
diff --git a/libunwind/src/assembly.h b/libunwind/src/assembly.h
index b17f2ade590b..978f6bd619bd 100644
--- a/libunwind/src/assembly.h
+++ b/libunwind/src/assembly.h
@@ -234,7 +234,7 @@
#endif
#endif /* __arm__ */
-#if defined(__ppc__) || defined(__powerpc64__)
+#if defined(__powerpc__)
#define PPC_LEFT_SHIFT(index) << (index)
#endif
diff --git a/libunwind/src/config.h b/libunwind/src/config.h
index f469d3c232e6..560edda04eaa 100644
--- a/libunwind/src/config.h
+++ b/libunwind/src/config.h
@@ -105,7 +105,7 @@
#define _LIBUNWIND_BUILD_SJLJ_APIS
#endif
-#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__ppc64__) || defined(__powerpc64__)
+#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc__)
#define _LIBUNWIND_SUPPORT_FRAME_APIS
#endif
diff --git a/libunwind/src/libunwind.cpp b/libunwind/src/libunwind.cpp
index 48750ce670fb..ef48cbe860c7 100644
--- a/libunwind/src/libunwind.cpp
+++ b/libunwind/src/libunwind.cpp
@@ -51,7 +51,7 @@ _LIBUNWIND_HIDDEN int __unw_init_local(unw_cursor_t *cursor,
# define REGISTER_KIND Registers_x86_64
#elif defined(__powerpc64__)
# define REGISTER_KIND Registers_ppc64
-#elif defined(__ppc__)
+#elif defined(__powerpc__)
# define REGISTER_KIND Registers_ppc
#elif defined(__aarch64__)
# define REGISTER_KIND Registers_arm64