From e671a87bc957940e48fd15c6661e505191a27f65 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Mon, 22 Jan 2018 00:24:13 +0100 Subject: [PATCH 1/2] Makefile.libretro: Add Switch platform. --- Makefile.libretro | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile.libretro b/Makefile.libretro index f8fa0c71..5483a334 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -347,6 +347,15 @@ else ifeq ($(platform), wii) AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__ +# Nintendo Switch (libtransistor) +else ifeq ($(platform), switch) + TARGET := $(TARGET_NAME)_libretro_$(platform).a + include $(LIBTRANSISTOR_HOME)/libtransistor.mk + STATIC_LINKING=1 + NO_MMAP = 1 + ARCH = aarch64 + + # QNX else ifeq ($(platform), qnx) TARGET := $(TARGET_NAME)_libretro_$(platform).so From 471be6a92fcdfc44c82d3a9d5bf49513a2d35e74 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Mon, 22 Jan 2018 00:25:30 +0100 Subject: [PATCH 2/2] libretro: don't build mremap for Switch on Linux. --- platform/libretro/libretro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/libretro/libretro.c b/platform/libretro/libretro.c index 9111048f..137c7c6d 100644 --- a/platform/libretro/libretro.c +++ b/platform/libretro/libretro.c @@ -395,7 +395,7 @@ void *plat_mmap(unsigned long addr, size_t size, int need_exec, int is_fixed) void *plat_mremap(void *ptr, size_t oldsize, size_t newsize) { -#ifdef __linux__ +#if defined(__linux__) && !defined(__SWITCH__) void *ret = mremap(ptr, oldsize, newsize, 0); if (ret == MAP_FAILED) return NULL;