Fix build for Nintendo platform
authorBruce A Henderson <woollybah@gmail.com>
Wed, 11 Jul 2018 07:39:28 +0000 (10:39 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 11 Jul 2018 07:39:28 +0000 (10:39 +0300)
(fix of commit 9718229)

Issue #228 (bdwgc).

The NINTENDO_SWITCH defines in gcconfig.h were in the wrong section
(under ARM32).  Now they are under AARCH64 instead.

* include/private/gcconfig.h (__arm__): Remove checking of
NN_BUILD_TARGET_PLATFORM_NX.
* include/private/gcconfig.h [AARCH64 && NINTENDO_SWITCH] (__bss_end,
NO_HANDLE_FORK, DATASTART, DATAEND, switch_get_stack_bottom,
STACKBOTTOM): Move from ARM32 section.

include/private/gcconfig.h

index bef3298..d67255b 100644 (file)
@@ -161,7 +161,6 @@ EXTERN_C_BEGIN
 #    elif !defined(LINUX) && !defined(NETBSD) && !defined(FREEBSD) \
           && !defined(OPENBSD) && !defined(DARWIN) && !defined(_WIN32) \
           && !defined(__CEGCC__) && !defined(NN_PLATFORM_CTR) \
-          && !defined(NN_BUILD_TARGET_PLATFORM_NX) \
           && !defined(SN_TARGET_ORBIS) && !defined(SN_TARGET_PSP2) \
           && !defined(SYMBIAN)
 #      define NOSYS
@@ -2305,6 +2304,14 @@ EXTERN_C_BEGIN
 #     define ELF_CLASS ELFCLASS64
 #     define DYNAMIC_LOADING
 #   endif
+#   ifdef NINTENDO_SWITCH
+      extern int __bss_end[];
+#     define NO_HANDLE_FORK
+#     define DATASTART (ptr_t)ALIGNMENT /* cannot be null */
+#     define DATAEND (ptr_t)(&__bss_end)
+      void *switch_get_stack_bottom(void);
+#     define STACKBOTTOM ((ptr_t)switch_get_stack_bottom())
+#   endif
 #   ifdef NOSYS
       /* __data_start is usually defined in the target linker script.   */
       extern int __data_start[];
@@ -2443,14 +2450,6 @@ EXTERN_C_BEGIN
       void *n3ds_get_stack_bottom(void);
 #     define STACKBOTTOM ((ptr_t)n3ds_get_stack_bottom())
 #   endif
-#   ifdef NINTENDO_SWITCH
-      extern int __bss_end[];
-#     define NO_HANDLE_FORK
-#     define DATASTART (ptr_t)ALIGNMENT /* cannot be null */
-#     define DATAEND (ptr_t)(&__bss_end)
-      void *switch_get_stack_bottom(void);
-#     define STACKBOTTOM ((ptr_t)switch_get_stack_bottom())
-#   endif
 #   ifdef NOSYS
       /* __data_start is usually defined in the target linker script.  */
       extern int __data_start[];