From 0d87d06249b1c05a52288172d999648d13fab69b Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 23 Sep 2023 22:39:52 +0300 Subject: [PATCH] log some build info helpful for bug reports --- Makefile | 2 +- frontend/main.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 63ffcb62..c020274a 100644 --- a/Makefile +++ b/Makefile @@ -266,7 +266,7 @@ endif # misc OBJS += frontend/main.o frontend/plugin.o - +frontend/main.o: CFLAGS += -DBUILTIN_GPU=$(BUILTIN_GPU) frontend/menu.o frontend/main.o: frontend/revision.h frontend/plat_sdl.o frontend/libretro.o: frontend/revision.h diff --git a/frontend/main.c b/frontend/main.c index e2349903..34f68d40 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -436,6 +436,49 @@ static void log_wrong_cpu(void) #endif // DO_CPU_CHECKS } +#define MKSTR2(x) #x +#define MKSTR(x) MKSTR2(x) +static const char *get_build_info(void) +{ + return " (" +#ifdef __VERSION__ + "cc " __VERSION__ " " +#endif +#if defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8 + "64bit " +#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4 + "32bit " +#endif +#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ + "be " +#endif +#if defined(__PIC__) || defined(__pic__) + "pic " +#endif +#if defined(__aarch64__) + "arm64" +#elif defined(__arm__) + "arm" +#endif +#ifdef __ARM_ARCH + "v" MKSTR(__ARM_ARCH) " " +#endif +#if defined(__AVX__) + "avx " +#elif defined(__SSSE3__) + "ssse3 " +#elif defined(__ARM_NEON) || defined(__ARM_NEON__) + "neon " +#endif +#if defined(LIGHTREC) + "lightrec " +#elif !defined(DRC_DISABLE) + "ari64 " +#endif + "gpu=" MKSTR(BUILTIN_GPU) + ")"; +} + int emu_core_preinit(void) { // what is the name of the config file? @@ -465,7 +508,7 @@ int emu_core_preinit(void) int emu_core_init(void) { - SysPrintf("Starting PCSX-ReARMed " REV "\n"); + SysPrintf("Starting PCSX-ReARMed " REV "%s\n", get_build_info()); #ifndef NO_FRONTEND check_profile(); -- 2.39.2