diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2023-12-01 14:57:28 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2023-12-01 14:57:28 +0100 |
| commit | dd1aeb7265931708462401f1ec70cd28943ed620 (patch) | |
| tree | 7919865c4431e508bff6d820e5d4681b6f8c69c6 | |
| parent | 777c62c0562ee91b65797431a5f7c0798c5bc3e9 (diff) | |
| download | box64-dd1aeb7265931708462401f1ec70cd28943ed620.tar.gz box64-dd1aeb7265931708462401f1ec70cd28943ed620.zip | |
[TERMUX] Added 2 faked wrapped libs (symbols should be in libc already)
| -rw-r--r-- | CMakeLists.txt | 8 | ||||
| -rw-r--r-- | src/library_list.h | 4 | ||||
| -rw-r--r-- | src/wrapped/wrappedandroidsupport.c | 22 | ||||
| -rw-r--r-- | src/wrapped/wrappedandroidsupport_private.h | 4 | ||||
| -rw-r--r-- | src/wrapped/wrappediconv.c | 22 | ||||
| -rw-r--r-- | src/wrapped/wrappediconv_private.h | 4 |
6 files changed, 63 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index aa093358..ff7f1662 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -598,6 +598,12 @@ if(ANDROID) "${BOX64_ROOT}/src/wrapped/wrappedandroidshmem.c" ) endif() +if(TERMUX) + list(APPEND WRAPPEDS + "${BOX64_ROOT}/src/wrapped/wrappediconv.c" + "${BOX64_ROOT}/src/wrapped/wrappedandrdoidsupport.c" + ) +endif() # If BOX64_ROOT contains a ".c", the build breaks... string(REPLACE ".c" "_private.h" MODROOT ${BOX64_ROOT}) @@ -617,7 +623,7 @@ if(NOT CI) OUTPUT "${BOX64_ROOT}/src/wrapped/generated/functions_list.txt" COMMAND "${PYTHON_EXECUTABLE}" "${BOX64_ROOT}/rebuild_wrappers.py" "${BOX64_ROOT}" - "PANDORA" "HAVE_LD80BITS" "NOALIGN" "HAVE_TRACE" "ANDROID" "--" + "PANDORA" "HAVE_LD80BITS" "NOALIGN" "HAVE_TRACE" "ANDROID" "TERMUX" "--" ${WRAPPEDS_HEAD} MAIN_DEPENDENCY "${BOX64_ROOT}/rebuild_wrappers.py" DEPENDS ${WRAPPEDS} ${WRAPPEDS_HEAD} diff --git a/src/library_list.h b/src/library_list.h index 8c75e4c5..0be126c6 100644 --- a/src/library_list.h +++ b/src/library_list.h @@ -344,6 +344,10 @@ GO("libmpg123.so.0", mpg123) //GO("libtiff.so.5", libtiff) GO("libxml2.so.2", xml2) #endif +#ifdef TERMUX +GO("libiconv.so", iconv) +GO("libandroid-support.so", androidsupport) +#endif GO("ld-linux-x86-64.so.2", ldlinux) diff --git a/src/wrapped/wrappedandroidsupport.c b/src/wrapped/wrappedandroidsupport.c new file mode 100644 index 00000000..feafed79 --- /dev/null +++ b/src/wrapped/wrappedandroidsupport.c @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* androidsupportName = "libandroid-support.so"; + +#define LIBNAME androidsupport + +#define CUSTOM_INIT \ + setNeededLibs(lib, 1, "libc.so.6"); + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedandroidsupport_private.h b/src/wrapped/wrappedandroidsupport_private.h new file mode 100644 index 00000000..a0ed8e1f --- /dev/null +++ b/src/wrapped/wrappedandroidsupport_private.h @@ -0,0 +1,4 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#error Meh... +#endif + diff --git a/src/wrapped/wrappediconv.c b/src/wrapped/wrappediconv.c new file mode 100644 index 00000000..74a7f6be --- /dev/null +++ b/src/wrapped/wrappediconv.c @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" + +const char* iconvName = "libiconv.so"; + +#define LIBNAME iconv + +#define CUSTOM_INIT \ + setNeededLibs(lib, 1, "libc.so.6"); + +#include "wrappedlib_init.h" diff --git a/src/wrapped/wrappediconv_private.h b/src/wrapped/wrappediconv_private.h new file mode 100644 index 00000000..a0ed8e1f --- /dev/null +++ b/src/wrapped/wrappediconv_private.h @@ -0,0 +1,4 @@ +#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA) && defined(GOS)) +#error Meh... +#endif + |