From: Paul Cercueil Date: Tue, 25 Jul 2023 10:27:50 +0000 (+0200) Subject: make: Enable Lightrec for GC/Wii X-Git-Tag: r24l~279^2 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e98140f91d4f86480343900a572e4a3fe2a10719;p=pcsx_rearmed.git make: Enable Lightrec for GC/Wii Add the missing sysconf() function so that the GC/Wii builds will link properly against Lightrec and GNU Lightning. Signed-off-by: Paul Cercueil --- diff --git a/Makefile b/Makefile index ee3a44f0..470b9e89 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,9 @@ ifeq ($(LIGHTREC_CUSTOM_MAP),1) LDLIBS += -lrt OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ) endif +ifeq ($(NEED_SYSCONF),1) +OBJS += libpcsxcore/lightrec/sysconf.o +endif ifeq ($(LIGHTREC_THREADED_COMPILER),1) OBJS += deps/lightrec/recompiler.o \ deps/lightrec/reaper.o diff --git a/Makefile.libretro b/Makefile.libretro index 5f43eea0..e297bb6d 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -330,10 +330,10 @@ else ifneq (,$(filter $(platform),ngc wii wiiu)) TARGET := $(TARGET_NAME)_libretro_$(platform).a ifeq ($(platform), ngc) CFLAGS += -DHW_DOL -mogc - DYNAREC := 0 # missing sysconf() + NEED_SYSCONF := 1 else ifeq ($(platform), wii) CFLAGS += -DHW_RVL -mrvl - DYNAREC := 0 # missing sysconf() + NEED_SYSCONF := 1 else ifeq ($(platform), wiiu) # -mwup was removed in newer devkitPPC versions CFLAGS += -DHW_WUP diff --git a/libpcsxcore/lightrec/sysconf.c b/libpcsxcore/lightrec/sysconf.c new file mode 100644 index 00000000..6d51bea4 --- /dev/null +++ b/libpcsxcore/lightrec/sysconf.c @@ -0,0 +1,13 @@ +#include +#include + +/* Implement the sysconf() symbol which is needed by GNU Lightning */ +long sysconf(int name) +{ + switch (name) { + case _SC_PAGE_SIZE: + return 4096; + default: + return -EINVAL; + } +}