about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-03-07 11:11:47 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-03-07 11:11:47 +0100
commit2b3c9b95af4ff056d05f4ed9aeb77e049bb844a5 (patch)
treee444cfd26677a89a0c42cdf7222eb23d7a4610d3 /src
parent09232ad0b63c360717f410e10b120ea38d84a12c (diff)
downloadbox64-2b3c9b95af4ff056d05f4ed9aeb77e049bb844a5.tar.gz
box64-2b3c9b95af4ff056d05f4ed9aeb77e049bb844a5.zip
Some work on gtk and co wrapping
Diffstat (limited to 'src')
-rw-r--r--src/librarian/librarian.c8
-rw-r--r--src/wrapped/wrappedlibc_private.h6
-rw-r--r--src/wrapped/wrappedpangocairo.c4
-rw-r--r--src/wrapped/wrappedpng16_private.h1
-rw-r--r--src/wrapped/wrappedselinux_private.h16
5 files changed, 20 insertions, 15 deletions
diff --git a/src/librarian/librarian.c b/src/librarian/librarian.c
index 4aff1864..56a0fffa 100644
--- a/src/librarian/librarian.c
+++ b/src/librarian/librarian.c
@@ -505,13 +505,13 @@ int GetGlobalSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* start, u
     }
     #ifndef STATICBUILD
     // some special case symbol, defined inside box64 itself
-    if(!strcmp(name, "gdk_display")) {
+    if(!strcmp(name, "gdk_display") && !box64_nogtk) {
         *start = (uintptr_t)my_GetGTKDisplay();
         *end = *start+sizeof(void*);
         printf_log(LOG_INFO, "Using global gdk_display for gdk-x11 (%p:%p)\n", start, *(void**)start);
         return 1;
     }
-    if(!strcmp(name, "g_threads_got_initialized")) {
+    if(!strcmp(name, "g_threads_got_initialized") && !box64_nogtk) {
         *start = (uintptr_t)my_GetGthreadsGotInitialized();
         *end = *start+sizeof(int);
         printf_log(LOG_INFO, "Using global g_threads_got_initialized for gthread2 (%p:%p)\n", start, *(void**)start);
@@ -578,14 +578,14 @@ int GetGlobalWeakSymbolStartEnd(lib_t *maplib, const char* name, uintptr_t* star
     }
     #ifndef STATICBUILD
     // some special case symbol, defined inside box64 itself
-    if(!strcmp(name, "gdk_display")) {
+    if(!strcmp(name, "gdk_display") && !box64_nogtk) {
         *start = (uintptr_t)my_GetGTKDisplay();
         *end = *start+sizeof(void*);
         if(elfsym) *elfsym = NULL;
         printf_log(LOG_INFO, "Using global gdk_display for gdk-x11 (%p:%p)\n", start, *(void**)start);
         return 1;
     }
-    if(!strcmp(name, "g_threads_got_initialized")) {
+    if(!strcmp(name, "g_threads_got_initialized") && !box64_nogtk) {
         *start = (uintptr_t)my_GetGthreadsGotInitialized();
         *end = *start+sizeof(int);
         if(elfsym) *elfsym = NULL;
diff --git a/src/wrapped/wrappedlibc_private.h b/src/wrapped/wrappedlibc_private.h
index 583bd268..893515ea 100644
--- a/src/wrapped/wrappedlibc_private.h
+++ b/src/wrapped/wrappedlibc_private.h
@@ -2245,7 +2245,7 @@ GO(wcsstr, pFpp)
 GO(wcstod, dFpp)
 //GO(__wcstod_internal, 
 //GO(__wcstod_l, 
-//GOW(wcstod_l, dFpp!)
+GOW(wcstod_l, dFppp)
 GO(wcstof, fFpp)
 GO(wcstof128, DFpp)
 //GO(__wcstof128_internal, 
@@ -2270,7 +2270,7 @@ GO(wcstold, DFpp)
 //GOW(wcstold_l, DFpp!)
 //GO(__wcstol_internal, 
 //GO(__wcstol_l, 
-//GOW(wcstol_l, lFppi!)
+GOW(wcstol_l, lFppip)
 GOW(wcstoll, IFppi)
 //GO(__wcstoll_internal, 
 //GOW(__wcstoll_l, 
@@ -2281,7 +2281,7 @@ GOW(wcstoq, IFppi)
 GO(wcstoul, LFppi)
 //GO(__wcstoul_internal, 
 //GO(__wcstoul_l, 
-//GOW(wcstoul_l, LFppi!)
+GOW(wcstoul_l, LFppip)
 GOW(wcstoull, UFppi)
 //GO(__wcstoull_internal, 
 //GOW(__wcstoull_l, 
diff --git a/src/wrapped/wrappedpangocairo.c b/src/wrapped/wrappedpangocairo.c
index 6ef8f878..bd4464d9 100644
--- a/src/wrapped/wrappedpangocairo.c
+++ b/src/wrapped/wrappedpangocairo.c
@@ -19,6 +19,10 @@
 #endif
 #define LIBNAME pangocairo
 
+#define PRE_INIT    \
+    if(box64_nogtk) \
+        return -1;
+
 #ifdef ANDROID
 #define NEEDED_LIBS "libpango-1.0.so"
 #else
diff --git a/src/wrapped/wrappedpng16_private.h b/src/wrapped/wrappedpng16_private.h
index 84203c0f..dd4d3ddc 100644
--- a/src/wrapped/wrappedpng16_private.h
+++ b/src/wrapped/wrappedpng16_private.h
@@ -13,6 +13,7 @@ GO(png_free, vFpp)
 GO(png_get_bit_depth, CFpp)
 GO(png_get_color_type, CFpp)
 GO(png_get_error_ptr, pFp)
+GO(png_get_header_version, CFp)
 GO(png_get_iCCP, uFpppppp)
 GO(png_get_IHDR, uFppppppppp)
 GO(png_get_image_height, uFpp)
diff --git a/src/wrapped/wrappedselinux_private.h b/src/wrapped/wrappedselinux_private.h
index 94a4f730..661e5c97 100644
--- a/src/wrapped/wrappedselinux_private.h
+++ b/src/wrapped/wrappedselinux_private.h
@@ -41,12 +41,12 @@
 //GO(context_user_set, 
 //DATAB(dir_xattr_list, 
 //GO(fgetfilecon, 
-//GO(fgetfilecon_raw, 
+GO(fgetfilecon_raw, iFip)
 //GO(fini_selinuxmnt, 
-//GO(freecon, 
-//GO(freeconary, 
+GO(freecon, vFp)
+GO(freeconary, vFp)
 //GO(fsetfilecon, 
-//GO(fsetfilecon_raw, 
+GO(fsetfilecon_raw, iFip)
 //GO(getcon, 
 //GO(getcon_raw, 
 //GO(get_default_context, 
@@ -57,7 +57,7 @@
 //GO(getexeccon, 
 //GO(getexeccon_raw, 
 //GO(getfilecon, 
-//GO(getfilecon_raw, 
+GO(getfilecon_raw, iFpp)
 //GO(getfscreatecon, 
 //GO(getfscreatecon_raw, 
 //GO(getkeycreatecon, 
@@ -75,7 +75,7 @@
 //GO(getsockcreatecon, 
 //GO(getsockcreatecon_raw, 
 //GO(is_context_customizable, 
-//GO(is_selinux_enabled, 
+GO(is_selinux_enabled, iFv)
 //GO(is_selinux_mls_enabled, 
 GO(lgetfilecon, iFpp)
 GO(lgetfilecon_raw, iFpp)
@@ -214,7 +214,7 @@ GO(lsetfilecon_raw, iFpp)
 //GO(selinux_status_updated, 
 //GO(selinux_systemd_contexts_path, 
 //GO(selinux_translations_path, 
-//GO(selinux_trans_to_raw_context, 
+GO(selinux_trans_to_raw_context, iFpp)
 //GO(selinux_user_contexts_path, 
 //GO(selinux_usersconf_path, 
 //GO(selinux_users_path, 
@@ -227,7 +227,7 @@ GO(lsetfilecon_raw, iFpp)
 //GO(setexeccon_raw, 
 //GO(setexecfilecon, 
 //GO(setfilecon, 
-//GO(setfilecon_raw, 
+GO(setfilecon_raw, iFpp)
 //GO(setfscreatecon, 
 //GO(setfscreatecon_raw, 
 //GO(setkeycreatecon,