public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Iain D Sandoe <iains@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-3235] libbacktrace, Mach-O : Support PowerPC archs.
Date: Wed, 16 Sep 2020 18:39:03 +0000 (GMT)	[thread overview]
Message-ID: <20200916183903.90D4E3947438@sourceware.org> (raw)

https://gcc.gnu.org/g:d1339b519ae8cc4ae550baa127a21d8350462837

commit r11-3235-gd1339b519ae8cc4ae550baa127a21d8350462837
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Sep 16 08:03:05 2020 +0100

    libbacktrace, Mach-O : Support PowerPC archs.
    
    This adds the PPC architecture variants for Mach-O libbacktrace.
    
    With this (as for X86 and Arm) when dsymutil is run on the binary
    we get a basic usable backtrace.
    
    Testsuite results on powerpc-apple-darwin9 are the same as for X86:
     * btest fails (TBC why)
     * dwarf5 tests fail because dsymutil does not handle that so far.
    
    libbacktrace/ChangeLog:
    
            * macho.c (MACH_O_CPU_TYPE_PPC): New.
            (MACH_O_CPU_TYPE_PPC64): New.
            Add compile-tests for powerpc to the Mach-O variants.

Diff:
---
 libbacktrace/macho.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libbacktrace/macho.c b/libbacktrace/macho.c
index 241d54b5e5e..1f8bc50238f 100644
--- a/libbacktrace/macho.c
+++ b/libbacktrace/macho.c
@@ -128,9 +128,11 @@ struct macho_fat_arch_64
 
 #define MACH_O_CPU_TYPE_X86 7
 #define MACH_O_CPU_TYPE_ARM 12
+#define MACH_O_CPU_TYPE_PPC 18
 
 #define MACH_O_CPU_TYPE_X86_64 (MACH_O_CPU_TYPE_X86 | MACH_O_CPU_ARCH_ABI64)
 #define MACH_O_CPU_TYPE_ARM64  (MACH_O_CPU_TYPE_ARM | MACH_O_CPU_ARCH_ABI64)
+#define MACH_O_CPU_TYPE_PPC64  (MACH_O_CPU_TYPE_PPC | MACH_O_CPU_ARCH_ABI64)
 
 /* The header of a load command.  */
 
@@ -776,6 +778,10 @@ macho_add_fat (struct backtrace_state *state, const char *filename,
   cputype = MACH_O_CPU_TYPE_ARM64;
 #elif defined (__arm__)
   cputype = MACH_O_CPU_TYPE_ARM;
+#elif defined (__ppc__)
+  cputype = MACH_O_CPU_TYPE_PPC;
+#elif defined (__ppc64__)
+  cputype = MACH_O_CPU_TYPE_PPC64;
 #else
   error_callback (data, "unknown Mach-O architecture", 0);
   goto fail;


                 reply	other threads:[~2020-09-16 18:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200916183903.90D4E3947438@sourceware.org \
    --to=iains@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).