From c5fe217f97e4d67be160d48789a79999160e4154 Mon Sep 17 00:00:00 2001 From: M4xw Date: Mon, 8 Jun 2020 13:55:19 +0200 Subject: [PATCH] Fix GCC common symbols - For now lets just link those against GLN64 - They never run at the same time, are same type and it lowers maintenance efforts --- GLideN64/src/N64.cpp | 14 ++++++++++++-- GLideN64/src/N64.h | 9 +++++++-- mupen64plus-rsp-cxd4/su.c | 6 ++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/GLideN64/src/N64.cpp b/GLideN64/src/N64.cpp index dc91c4cc..e10e0558 100644 --- a/GLideN64/src/N64.cpp +++ b/GLideN64/src/N64.cpp @@ -1,8 +1,18 @@ #include "N64.h" u8 *HEADER; -u8 *DMEM; -u8 *IMEM; + +/* + DMEM and IMEM conflict with CXD4 with GCC 10.x + It's defined as pu8 so it's the same type as used in GLN64, just typedef'd. + Since we never run both at the same time, let's just link CXD4's to this + Also we always assume that we will build with GLideN64 at all times +*/ +extern "C" { + u8 *DMEM; + u8 *IMEM; +} + u64 TMEM[512]; u8 *RDRAM; diff --git a/GLideN64/src/N64.h b/GLideN64/src/N64.h index 2b2a650c..4fdd01f5 100644 --- a/GLideN64/src/N64.h +++ b/GLideN64/src/N64.h @@ -38,8 +38,13 @@ struct N64Regs extern N64Regs REG; extern u8 *HEADER; -extern u8 *DMEM; -extern u8 *IMEM; + +extern "C" { + // See comment in N64.cpp + extern u8 *DMEM; + extern u8 *IMEM; +} + extern u8 *RDRAM; extern u64 TMEM[512]; extern u32 RDRAMSize; diff --git a/mupen64plus-rsp-cxd4/su.c b/mupen64plus-rsp-cxd4/su.c index b8033cb6..96613acc 100644 --- a/mupen64plus-rsp-cxd4/su.c +++ b/mupen64plus-rsp-cxd4/su.c @@ -27,8 +27,10 @@ u32 SR[32]; typedef VECTOR_OPERATION(*p_vector_func)(v16, v16); pu8 DRAM; -pu8 DMEM; -pu8 IMEM; + +// NOTE: Links against GLideN64\src\N64.cpp due to conflicts and maintenance efforts +extern pu8 DMEM; +extern pu8 IMEM; NOINLINE void res_S(void) {