Merge pull request #618 from pcercuei/update-lightrec-20220224
authorAutechre <libretro@gmail.com>
Thu, 24 Feb 2022 20:20:18 +0000 (21:20 +0100)
committerGitHub <noreply@github.com>
Thu, 24 Feb 2022 20:20:18 +0000 (21:20 +0100)
Attempt to fix CI build issues, try #2

Makefile
deps/lightrec/.gitrepo
deps/lightrec/lightrec.c
deps/lightrec/slist.h
include/mman/sys/mman.h [new symlink]
jni/Android.mk

index a1d6336..6a83f46 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -109,7 +109,7 @@ OBJS += deps/lightning/lib/jit_disasm.o \
                deps/lightrec/recompiler.o \
                deps/lightrec/reaper.o
 ifeq ($(MMAP_WIN32),1)
-CFLAGS += -Ideps/mman
+CFLAGS += -Iinclude/mman
 OBJS += deps/mman/mman.o
 endif
 else ifeq "$(DYNAREC)" "ari64"
index 770ee66..fb3c6d2 100644 (file)
@@ -6,7 +6,7 @@
 [subrepo]
        remote = https://github.com/pcercuei/lightrec.git
        branch = master
-       commit = d90de68429bf9c2d67c5f5051d495d1e3131e636
-       parent = a9725dc07f40b39a5533d546b59e45377d1f9b66
+       commit = d3329782e806b9643239832f59e09d48ebc03d01
+       parent = fc75c5470b8d931ad59d66b27203f02c1d1e674d
        method = merge
        cmdver = 0.4.3
index 3d4e1a2..e83f0e7 100644 (file)
@@ -454,11 +454,14 @@ static void lightrec_mtc0(struct lightrec_state *state, u8 reg, u32 data)
 
 static u32 count_leading_bits(s32 data)
 {
-#if defined(__has_builtin) && __has_builtin(__builtin_clrsb)
-       return 1 + __builtin_clrsb(data);
-#else
        u32 cnt = 33;
 
+#ifdef __has_builtin
+#if __has_builtin(__builtin_clrsb)
+       return 1 + __builtin_clrsb(data);
+#endif
+#endif
+
        data = (data ^ (data >> 31)) << 1;
 
        do {
@@ -467,7 +470,6 @@ static u32 count_leading_bits(s32 data)
        } while (data);
 
        return cnt;
-#endif
 }
 
 static void lightrec_mtc2(struct lightrec_state *state, u8 reg, u32 data)
index ae7e5d3..37557e6 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef __LIGHTREC_SLIST_H__
 #define __LIGHTREC_SLIST_H__
 
+#include <stddef.h>
+
 #define container_of(ptr, type, member)        \
        ((type *)((void *)(ptr) - offsetof(type, member)))
 
diff --git a/include/mman/sys/mman.h b/include/mman/sys/mman.h
new file mode 120000 (symlink)
index 0000000..1c111c3
--- /dev/null
@@ -0,0 +1 @@
+../../../deps/mman/mman.h
\ No newline at end of file
index d8fdd42..ce9762a 100644 (file)
@@ -141,7 +141,9 @@ endif
 ifeq ($(HAVE_LIGHTREC),1)
   COREFLAGS   += -DLIGHTREC -DLIGHTREC_STATIC
   EXTRA_INCLUDES += $(DEPS_DIR)/lightning/include \
-                                                 $(DEPS_DIR)/lightrec
+                   $(DEPS_DIR)/lightrec \
+                   $(ROOT_DIR)/include/lightning \
+                   $(ROOT_DIR)/include/lightrec
   SOURCES_C   += $(DEPS_DIR)/lightrec/blockcache.c \
                                          $(DEPS_DIR)/lightrec/disassembler.c \
                                          $(DEPS_DIR)/lightrec/emitter.c \