Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()

include(CheckLinkerFlag)
enable_language(C)
check_linker_flag(C "-fuse-ld=gold" HAS_FUSE_LD_GOLD)

if(RPI3ARM64)
add_definitions(-DRPI)
add_definitions(-DRPI3ARM64)
Expand Down Expand Up @@ -241,7 +245,11 @@ elseif(SDORYON1)
set(CFLAGS -pipe -march=armv8.6-a+crypto+sm4+sha3+fp16 -mtune=cortex-a57)
elseif(ADLINK)
add_definitions(-DADLINK)
set(CFLAGS -pipe -mcpu=neoverse-n1 -fuse-ld=gold -fuse-linker-plugin)
set(CFLAGS -pipe -mcpu=neoverse-n1)
if(HAS_FUSE_LD_GOLD)
list(APPEND CFLAGS "-fuse-ld=gold")
list(APPEND CFLAGS "-fuse-linker-plugin")
endif()
elseif(M1)
add_definitions(-DM1)
set(CFLAGS -pipe -march=armv8.5-a+simd+crypto)
Expand Down
2 changes: 1 addition & 1 deletion src/emu/x64int3.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void x64Int3(x64emu_t* emu, uintptr_t* addr)
} else if (strstr(s, "popen")==s) {
tmp = (char*)(R_RDI);
char* tmp2 = (char*)(R_RSI);
snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (tmp2)?tmp2:"nil");
snprintf(buff, 256, "%04d|%p: Calling %s(\"%s\", \"%s\")", tid, *(void**)(R_RSP), s, (tmp)?tmp:"(nil)", (tmp2)?tmp2:"nil");
perr = 5;
} else if (!strcmp(s, "read") || !strcmp(s, "my_read")) {
snprintf(buff, 256, "%04d|%p: Calling %s(%d, %p, %zu)", tid, *(void**)(R_RSP), s, R_EDI, (void*)R_RSI, R_RDX);
Expand Down
364 changes: 183 additions & 181 deletions src/libtools/vulkanoverlay.c

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/os/sysinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <string.h>
#include <stdlib.h>
#include <sched.h>
#include <inttypes.h>

#include "debug.h"
#include "sysinfo.h"
Expand Down Expand Up @@ -170,7 +171,7 @@ static void readCpuinfo(sysinfo_t* info)
sprintf(str, "%d", (info->ncpu) ? (int)info->ncpu : 1);
setenv("BOX64_SYSINFO_NCPU", str, 1);
setenv("BOX64_SYSINFO_CPUNAME", info->cpuname, 1);
sprintf(str, "%llu", info->frequency);
sprintf(str, "%" PRIu64, info->frequency);
setenv("BOX64_SYSINFO_FREQUENCY", str, 1);
setenv("BOX64_SYSINFO_CACHED", "1", 1);
return;
Expand All @@ -190,7 +191,7 @@ void InitializeSystemInfo(void)
if (box64_sysinfo.frequency > 1500000) {
snprintf(branding, sizeof(branding), BOX64_BUILD_INFO_STRING_SHORT " on %.*s @%1.2f GHz", 28, box64_sysinfo.cpuname, box64_sysinfo.frequency / 1000000000.);
} else {
snprintf(branding, sizeof(branding), BOX64_BUILD_INFO_STRING_SHORT " on %.*s @%04d MHz", 28, box64_sysinfo.cpuname, box64_sysinfo.frequency / 1000000);
snprintf(branding, sizeof(branding), BOX64_BUILD_INFO_STRING_SHORT " on %.*s @%04" PRIu64 " MHz", 28, box64_sysinfo.cpuname, box64_sysinfo.frequency / 1000000);
}
}
box64_sysinfo.box64_cpuname = (char*)calloc(strlen(branding) + 1, 1);
Expand Down
3 changes: 2 additions & 1 deletion src/tools/dynacache.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <fcntl.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
#if defined(DYNAREC) && !defined(WIN32)
#include <sys/types.h>
#include <dirent.h>
Expand Down Expand Up @@ -168,7 +169,7 @@ char* MmaplistName(const char* filename, uint64_t dynarec_settings, const char*
// Where XXXXX is the hash of the full name
// and YYYY is the Dynarec optim (in hex)
static char mapname[4096];
snprintf(mapname, 4095-6, "%s-%llx-%u", filename, dynarec_settings, __ac_X31_hash_string(fullname));
snprintf(mapname, 4095-6, "%s-%" PRIx64 "-%u", filename, dynarec_settings, __ac_X31_hash_string(fullname));
strcat(mapname, ".box64");
return mapname;
}
Expand Down
8 changes: 4 additions & 4 deletions src/wrapped/generated/wrappedgmptypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#endif

typedef void (*vFppp_t)(void*, void*, void*);
typedef int32_t (*iFppV_t)(void*, void*, ...);
typedef int32_t (*iFppA_t)(void*, void*, va_list);
typedef int32_t (*iFSpV_t)(void*, void*, ...);
typedef int32_t (*iFSpA_t)(void*, void*, va_list);
typedef int32_t (*iFppV_t)(void*, const char *, ...);
typedef int32_t (*iFppA_t)(void*, const char *, va_list);
typedef int32_t (*iFSpV_t)(void*, const char *, ...);
typedef int32_t (*iFSpA_t)(void*, const char *, va_list);

#define SUPER() ADDED_FUNCTIONS() \
GO(__gmp_get_memory_functions, vFppp_t) \
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped/wrappercallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef struct TYPENAME2(LIBNAME, _my_s) {
} TYPENAME(LIBNAME);

static library_t* my_lib = NULL;
static TYPENAME(LIBNAME) TYPENAME2(my_, LIBNAME) = {0};
static TYPENAME(LIBNAME) TYPENAME2(my_, LIBNAME) = {};
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that a C23 feature? There are people that use old compiler, pretty sure that will not work there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, true... I just checked with clang and gcc but hadn't older compilers in mind. Is there actually any reason for the initializer? Since this is static anyway, it could be removed altogether

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember correctly, this warning appear only on a couple of file, and I think a solution is to remove the include file, because the structure is empty, the whole include file is not usefull.

static TYPENAME(LIBNAME) * const my = &TYPENAME2(my_, LIBNAME);

static void getMy(library_t* lib)
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped32/wrappeddbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ EXPORT int my32_dbus_message_append_args(x64emu_t* emu, void* message, int arg,
// fill the array
while(type) {
void* value = from_ptrv(V[idx*2]);
if((type == (int)'s')) {
if(type == (int)'s') {
array[count + nstr] = from_ptrv(*(ptr_t*)value);
array[idx*2+0] = &array[count + nstr++];
} else if(type == ((int)'a')) {
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped32/wrappedopenal.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ EXPORT void* my32_alGetProcAddress(x64emu_t* emu, void* name)
const char* rname = (const char*)name;
printf_log(LOG_DEBUG, "Calling 32bits alGetProcAddress(%s)\n", rname);
if(!emu->context->alwrappers) // could be moved in "my" structure...
fillALProcWrapper32(emu->context);
fillALProcWrapper32();
// get proc adress using actual alGetProcAddress
k = kh_get(symbolmap, emu->context->almymap, rname);
int is_my = (k==kh_end(emu->context->almymap))?0:1;
Expand Down
Loading