libgcroots: add support for netbsd/aarch64.

This commit is contained in:
maya 2019-11-20 21:24:33 +00:00
parent 3c2dbe6b89
commit f49451cafd
2 changed files with 95 additions and 1 deletions

View file

@ -1,6 +1,7 @@
$NetBSD: distinfo,v 1.4 2015/11/03 03:27:41 agc Exp $
$NetBSD: distinfo,v 1.5 2019/11/20 21:24:33 maya Exp $
SHA1 (libgcroots-0.2.3.tar.gz) = 0542e8ca20f465c0cd7355a426dea89a9b7be3af
RMD160 (libgcroots-0.2.3.tar.gz) = eef2db5ea64e6ba20ec68b01b4f0621f45e0ecab
SHA512 (libgcroots-0.2.3.tar.gz) = 0ab0d9937f1eb233423b633c8ae969a01570735f8eff2a1871fba6f14ed298d97904e634774ccc4b721f1843df6588258350f67a67ae45f02353c55bb1512a49
Size (libgcroots-0.2.3.tar.gz) = 379193 bytes
SHA1 (patch-include_private_gcconfig.h) = c6b57524599cdb09e43a3898c136d20a0a974b3f

View file

@ -0,0 +1,93 @@
$NetBSD: patch-include_private_gcconfig.h,v 1.1 2019/11/20 21:24:33 maya Exp $
Add support for netbsd/aarch64, based on netbsd/arm32 code within the same file.
--- include/private/gcconfig.h.orig 2008-02-19 15:51:24.000000000 +0000
+++ include/private/gcconfig.h
@@ -62,6 +62,14 @@
# endif
/* Determine the machine type: */
+# if defined(__aarch64__)
+# define AARCH64
+# if !defined(LINUX) && !defined(DARWIN) && !defined(FREEBSD) \
+ && !defined(NETBSD) && !defined(NN_BUILD_TARGET_PLATFORM_NX)
+# define NOSYS
+# define mach_type_known
+# endif
+# endif
# if defined(__arm__) || defined(__thumb__)
# define ARM32
# if !defined(LINUX) && !defined(NETBSD)
@@ -99,6 +107,10 @@
# define ARM32
# define mach_type_known
# endif
+# if defined(NETBSD) && defined(__aarch64__)
+# define AARCH64
+# define mach_type_known
+# endif
# if defined(NETBSD) && defined(__sh__)
# define SH
# define mach_type_known
@@ -1724,6 +1736,60 @@
# endif
# endif
+
+# ifdef ARM32
+# define CPP_WORDSZ 64
+# define MACH_TYPE "AARCH64"
+# define ALIGNMENT 8
+# ifdef NETBSD
+# define OS_TYPE "NETBSD"
+# define HEURISTIC2
+# ifdef __ELF__
+# define DATASTART GC_data_start
+# define DYNAMIC_LOADING
+# else
+ extern char etext[];
+# define DATASTART ((ptr_t)(etext))
+# endif
+# endif
+# ifdef LINUX
+# define OS_TYPE "LINUX"
+# define LINUX_STACKBOTTOM
+# ifdef __ELF__
+# define DYNAMIC_LOADING
+# include <features.h>
+# if defined(__GLIBC__) && __GLIBC__ >= 2
+# define SEARCH_FOR_DATA_START
+# else
+ extern char **__environ;
+# define DATASTART ((ptr_t)(&__environ))
+ /* hideous kludge: __environ is the first */
+ /* word in crt0.o, and delimits the start */
+ /* of the data segment, no matter which */
+ /* ld options were passed through. */
+ /* We could use _etext instead, but that */
+ /* would include .rodata, which may */
+ /* contain large read-only data tables */
+ /* that we'd rather not scan. */
+# endif
+ extern int _end[];
+# define DATAEND (_end)
+# else
+ extern int etext[];
+# define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
+# endif
+# endif
+# ifdef NOSYS
+ /* __data_start is usually defined in the target linker script. */
+ extern int __data_start[];
+# define DATASTART (ptr_t)(__data_start)
+ /* __stack_base__ is set in newlib/libc/sys/arm/crt0.S */
+ extern void *__stack_base__;
+# define STACKBOTTOM ((ptr_t) (__stack_base__))
+# endif
+#endif
+
+
# ifdef ARM32
# define CPP_WORDSZ 32
# define MACH_TYPE "ARM32"