aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeancoot2013-12-19 16:53:46 -0500
committermeancoot2013-12-19 16:53:46 -0500
commitf543ae2baef4ba714d7b061f0fa374a374fa79d5 (patch)
tree34d052c3240f3c09b4ec29f7874d17bcdc41f048
parent779692e400119ccb41a879d80fbd3e3ad71b4591 (diff)
downloadpcsx_rearmed-f543ae2baef4ba714d7b061f0fa374a374fa79d5.tar.gz
pcsx_rearmed-f543ae2baef4ba714d7b061f0fa374a374fa79d5.tar.bz2
pcsx_rearmed-f543ae2baef4ba714d7b061f0fa374a374fa79d5.zip
(iOS) Work around clang crash when compiling libpcsxcor/new_dynarec/pcsxmem.c.
-rw-r--r--Makefile.libretro5
-rw-r--r--libpcsxcore/new_dynarec/pcsxmem.c5
2 files changed, 5 insertions, 5 deletions
diff --git a/Makefile.libretro b/Makefile.libretro
index 6f7b29a..8b4a61b 100644
--- a/Makefile.libretro
+++ b/Makefile.libretro
@@ -144,11 +144,6 @@ NO_CONFIG_MAK = yes
include Makefile
-# workaround segfault for this file seen on:
-# Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
-libpcsxcore/new_dynarec/pcsxmem.o: libpcsxcore/new_dynarec/pcsxmem.c
- $(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS) -Os
-
# no special AS needed for gpu_neon
plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o: plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
$(CC) $(CFLAGS) -c $^ -o $@
diff --git a/libpcsxcore/new_dynarec/pcsxmem.c b/libpcsxcore/new_dynarec/pcsxmem.c
index 3d14904..0a75442 100644
--- a/libpcsxcore/new_dynarec/pcsxmem.c
+++ b/libpcsxcore/new_dynarec/pcsxmem.c
@@ -30,7 +30,12 @@ static u32 mem_ffwtab[(1+2+4) * 0x1000 / 4];
//static u32 mem_unmrtab[(1+2+4) * 0x1000 / 4];
static u32 mem_unmwtab[(1+2+4) * 0x1000 / 4];
+// When this is called in a loop, and 'h' is a function pointer, clang will crash.
+#ifdef __clang__
+static __attribute__ ((noinline)) void map_item(u32 *out, const void *h, u32 flag)
+#else
static void map_item(u32 *out, const void *h, u32 flag)
+#endif
{
u32 hv = (u32)h;
if (hv & 1) {