From 13404ed090453ffa1a2b475b004b74db7086ff74 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 26 Feb 2024 19:22:53 +0100 Subject: Added ability to staticaly build box64 (for #1045 and #310, maybe a few others tickets) --- src/wrapped/wrappedldlinux.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/wrapped/wrappedldlinux.c') diff --git a/src/wrapped/wrappedldlinux.c b/src/wrapped/wrappedldlinux.c index 83245e93..90ec1b23 100644 --- a/src/wrapped/wrappedldlinux.c +++ b/src/wrapped/wrappedldlinux.c @@ -34,14 +34,25 @@ void stSetup(box64context_t* context) my___libc_stack_end = context->stack; // is this the end, or should I add stasz? } +#ifdef STATICBUILD +#include +extern void* __libc_enable_secure; +extern void* __stack_chk_guard; +//extern void* __pointer_chk_guard; +//extern void* _rtld_global; +//extern void* _rtld_global_ro; +#endif + // don't try to load the actual ld-linux (because name is variable), just use box64 itself, as it's linked to ld-linux const char* ldlinuxName = "ld-linux.so.2"; #define LIBNAME ldlinux +#ifndef STATICBUILD #define PRE_INIT\ if(1) \ lib->w.lib = dlopen(NULL, RTLD_LAZY | RTLD_GLOBAL); \ else +#endif #define CUSTOM_INIT \ stSetup(box64); \ -- cgit 1.4.1