public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yvan Roux <yvan.roux@linaro.org>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH, boehm-gc, AArch64] Add AArch64 support
Date: Sun, 17 Mar 2013 20:34:00 -0000	[thread overview]
Message-ID: <CAD57uCeB4rgg=XmHEyHYZwU9ZhnSsaS1vBTf+qgdgWgMWYzXoA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2757 bytes --]

Hi,

this is a backport from gc mainline of the basic AArch64 support (it
covers the Linux and bare machine mode). I tested it on the Foundation
model with enabling the objc frontend, and passing the testsuite
manually (maybe I miss-configured it, but it seems that the boehm-gc
testsuite is not cross-environment friendly, as the gctest script
looks for the host gcc build tree), and everything is fine, except the
thread_leak_test which has a different output than the x86 one:

x86 thread_leak_test output

Leaked composite object at 0x2aaaaab05fe0
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at start: 0x2aaaaab03fa0, appr. length: 40
Leaked composite object at 0x2aaaaab05ec0
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at 0x2aaaaab05f20
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at start: 0x2aaaaab03f50, appr. length: 40
Leaked composite object at start: 0x2aaaaab03f78, appr. length: 40
Leaked composite object at 0x2aaaaab05ef0
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at start: 0x2aaaaab03fa0, appr. length: 40
Leaked composite object at 0x2aaaaab05e00
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at start: 0x2aaaaab03f78, appr. length: 40

AArch64 thread_leak_test output:

Leaked composite object at 0x7f91e14ef0
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at 0x7f91e14fe0
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at 0x7f91e14e00
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at 0x7f91e14e30
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)

Leaked composite object at 0x7f91e14fe0
(/work/sources/gcc-fsf/bgc/boehm-gc/testsuite/boehm-gc.c/thread_leak_test.c:21,
sz=4, NORMAL)


Regards,
Yvan

2013-03-16  Yvan Roux <yvan.roux@linaro.org>

        * include/private/gcconfig.h (AARCH64): New macro (defined
only if
        __aarch64__).
        * include/private/gcconfig.h (mach_type_known): Update comment
adding
        ARM AArch64 target.
        * include/private/gcconfig.h (NOSYS, mach_type_known,
CPP_WORDSZ,
        MACH_TYPE, ALIGNMENT, HBLKSIZE, OS_TYPE, LINUX_STACKBOTTOM,
        USE_GENERIC_PUSH_REGS, DYNAMIC_LOADING, DATASTART, DATAEND,
        STACKBOTTOM): Define for AArch64.

[-- Attachment #2: boehm-gc-aarch64.patch --]
[-- Type: application/octet-stream, Size: 2057 bytes --]

diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index 9420c7c..475bb2c 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -60,6 +60,13 @@
 # endif
 
 /* Determine the machine type: */
+#if defined(__aarch64__)
+#    define AARCH64
+#    if !defined(LINUX)
+#      define NOSYS
+#      define mach_type_known
+#    endif
+# endif
 # if defined(__arm__) || defined(__thumb__)
 #    define ARM32
 #    if !defined(LINUX) && !defined(NETBSD)
@@ -239,6 +246,10 @@
 #    define IA64
 #    define mach_type_known
 # endif
+# if defined(LINUX) && defined(__aarch64__)
+#    define AARCH64
+#    define mach_type_known
+# endif
 # if defined(LINUX) && defined(__arm__)
 #    define ARM32
 #    define mach_type_known
@@ -500,6 +511,7 @@
 		    /* 			running Amdahl UTS4		*/
                     /*             S390       ==> 390-like machine      */
 		    /*                  running LINUX                   */
+                    /*             AARCH64    ==> ARM AArch64           */
 		    /* 		   ARM32      ==> Intel StrongARM	*/
 		    /* 		   IA64	      ==> Intel IPF		*/
 		    /*				  (e.g. Itanium)	*/
@@ -1833,6 +1845,32 @@
 #   define HEURISTIC1
 # endif
 
+# ifdef AARCH64
+#   define CPP_WORDSZ 64
+#   define MACH_TYPE "AARCH64"
+#   define ALIGNMENT 8
+#   ifndef HBLKSIZE
+#     define HBLKSIZE 4096
+#   endif
+#   ifdef LINUX
+#     define OS_TYPE "LINUX"
+#     define LINUX_STACKBOTTOM
+#     define USE_GENERIC_PUSH_REGS
+#     define DYNAMIC_LOADING
+      extern int __data_start[];
+#     define DATASTART ((ptr_t)__data_start)
+      extern char _end[];
+#     define DATAEND ((ptr_t)(&_end))
+#   endif
+#   ifdef NOSYS
+      /* __data_start is usually defined in the target linker script.   */
+      extern int __data_start[];
+#     define DATASTART ((ptr_t)__data_start)
+      extern void *__stack_base__;
+#     define STACKBOTTOM ((ptr_t)__stack_base__)
+#   endif
+# endif
+
 # ifdef ARM32
 #   define CPP_WORDSZ 32
 #   define MACH_TYPE "ARM32"

             reply	other threads:[~2013-03-17 20:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17 20:34 Yvan Roux [this message]
     [not found] ` <CAD57uCfa2K7bux0siwxK_+ktDzwxbN9VQJTTU=SMOOXkWCm2iQ@mail.gmail.com>
2013-04-02 11:31   ` Yvan Roux
2013-04-11 12:25     ` Marcus Shawcroft
2013-04-11 12:33       ` Yvan Roux
2013-05-02 19:51         ` Christophe Lyon

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='CAD57uCeB4rgg=XmHEyHYZwU9ZhnSsaS1vBTf+qgdgWgMWYzXoA@mail.gmail.com' \
    --to=yvan.roux@linaro.org \
    --cc=gcc-patches@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).