From 45ea0cd782b2a983cd1d0a4bef9085223d29bea8 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 20 Mar 2024 22:04:32 -0700 Subject: [PATCH] Removes false termux support This was a funny joke that this was here, but it is fundamentally incompatible with what we're doing. All those users are running proot anyway because of how broken running under termux directly is. Just remove this from here. --- CMakeLists.txt | 13 ------------- .../Utils/Allocator/IntrusiveArenaAllocator.h | 11 ----------- Scripts/GenerateSyscallNumbers.py | 6 ------ Source/Tools/CMakeLists.txt | 5 +---- Source/Tools/FEXLoader/CMakeLists.txt | 5 ----- .../LinuxSyscalls/Arm64/SyscallsEnum.h | 8 ++++---- .../LinuxSyscalls/Syscalls/Passthrough.cpp | 8 ++++---- .../LinuxEmulation/LinuxSyscalls/x32/Memory.cpp | 4 ++-- .../LinuxEmulation/LinuxSyscalls/x32/Semaphore.cpp | 14 +++++++------- .../LinuxSyscalls/x32/SyscallsEnum.h | 8 ++++---- .../LinuxEmulation/LinuxSyscalls/x64/Memory.cpp | 4 ++-- .../LinuxSyscalls/x64/SyscallsEnum.h | 8 ++++---- docs/ReleaseProcess.md | 8 -------- 13 files changed, 28 insertions(+), 74 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b19cfafa5..b53c80fde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ option(ENABLE_OFFLINE_TELEMETRY "Enables FEX offline telemetry" TRUE) option(ENABLE_COMPILE_TIME_TRACE "Enables time trace compile option" FALSE) option(ENABLE_LIBCXX "Enables LLVM libc++" FALSE) option(ENABLE_CCACHE "Enables ccache for compile caching" TRUE) -option(ENABLE_TERMUX_BUILD "Forces building for Termux on a non-Termux build machine" FALSE) option(ENABLE_VIXL_SIMULATOR "Forces the FEX JIT to use the VIXL simulator" FALSE) option(ENABLE_VIXL_DISASSEMBLER "Enables debug disassembler output with VIXL" FALSE) option(COMPILE_VIXL_DISASSEMBLER "Compiles the vixl disassembler in to vixl" FALSE) @@ -163,18 +162,6 @@ if (NOT ENABLE_OFFLINE_TELEMETRY) add_definitions(-DFEX_DISABLE_TELEMETRY=1) endif() -if(DEFINED ENV{TERMUX_VERSION} OR ENABLE_TERMUX_BUILD) - add_definitions(-DTERMUX_BUILD=1) - set(TERMUX_BUILD 1) - - # Termux doesn't support Jemalloc due to bad interactions between emutls, jemalloc, and scudo - set(ENABLE_JEMALLOC FALSE) - - # Termux builds can't rely on X11 packages - # SDL2 isn't even compiled with GL support so our GUIs wouldn't even work - set(BUILD_FEXCONFIG FALSE) -endif() - if (ENABLE_ASAN) add_definitions(-DENABLE_ASAN=1) add_compile_options(-fno-omit-frame-pointer -fsanitize=address -fsanitize-address-use-after-scope) diff --git a/FEXCore/Source/Utils/Allocator/IntrusiveArenaAllocator.h b/FEXCore/Source/Utils/Allocator/IntrusiveArenaAllocator.h index 97a879a03..91c27569f 100644 --- a/FEXCore/Source/Utils/Allocator/IntrusiveArenaAllocator.h +++ b/FEXCore/Source/Utils/Allocator/IntrusiveArenaAllocator.h @@ -9,19 +9,8 @@ #include #include -#ifdef TERMUX_BUILD -#ifdef __has_include -#if __has_include() -#error Termux workaround can be removed -#endif -#endif -#include -#include -namespace fex_pmr = std::experimental::pmr; -#else #include namespace fex_pmr = std::pmr; -#endif #include #include diff --git a/Scripts/GenerateSyscallNumbers.py b/Scripts/GenerateSyscallNumbers.py index 38aba03c9..66cdb7c1d 100755 --- a/Scripts/GenerateSyscallNumbers.py +++ b/Scripts/GenerateSyscallNumbers.py @@ -60,12 +60,6 @@ DefinitionRenameDict = { "pread64": "pread_64", "pwrite64": "pwrite_64", "prlimit64": "prlimit_64", - # Shm symbols conflict with termux defines and FEX's syscall token pasting. - # Underscore at the start to avoid name collision - "shmget": "_shmget", - "shmctl": "_shmctl", - "shmat": "_shmat", - "shmdt": "_shmdt", # musl/Alpine Linux defines `fstatat64` as a define that points to `fstatat`. # Rename it to avoid global define conflicts. "fstatat64": "fstatat_64", diff --git a/Source/Tools/CMakeLists.txt b/Source/Tools/CMakeLists.txt index a6b151a7c..3acb0ca66 100644 --- a/Source/Tools/CMakeLists.txt +++ b/Source/Tools/CMakeLists.txt @@ -5,15 +5,12 @@ if (NOT MINGW_BUILD) add_subdirectory(FEXConfig/) endif() - if (NOT TERMUX_BUILD) - # Disable FEXRootFSFetcher on Termux, it doesn't even work there - add_subdirectory(FEXRootFSFetcher/) - endif() if (ENABLE_GDB_SYMBOLS) add_subdirectory(FEXGDBReader/) endif() + add_subdirectory(FEXRootFSFetcher/) add_subdirectory(FEXGetConfig/) add_subdirectory(FEXServer/) add_subdirectory(FEXBash/) diff --git a/Source/Tools/FEXLoader/CMakeLists.txt b/Source/Tools/FEXLoader/CMakeLists.txt index 8d9711303..2264f1c82 100644 --- a/Source/Tools/FEXLoader/CMakeLists.txt +++ b/Source/Tools/FEXLoader/CMakeLists.txt @@ -5,11 +5,6 @@ if (ENABLE_VIXL_SIMULATOR) list(APPEND DEFINES -DVIXL_SIMULATOR=1) endif() -if (TERMUX_BUILD) - # Termux needs android-shmem to get the shm emulation library. - list(APPEND LIBS android-shmem) -endif() - function(GenerateInterpreter NAME AsInterpreter) add_executable(${NAME} FEXLoader.cpp diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Arm64/SyscallsEnum.h b/Source/Tools/LinuxEmulation/LinuxSyscalls/Arm64/SyscallsEnum.h index 988519c71..54e7cfe70 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Arm64/SyscallsEnum.h +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Arm64/SyscallsEnum.h @@ -205,10 +205,10 @@ enum Syscalls_Arm64 { SYSCALL_Arm64_semctl = 191, SYSCALL_Arm64_semtimedop = 192, SYSCALL_Arm64_semop = 193, - SYSCALL_Arm64__shmget = 194, - SYSCALL_Arm64__shmctl = 195, - SYSCALL_Arm64__shmat = 196, - SYSCALL_Arm64__shmdt = 197, + SYSCALL_Arm64_shmget = 194, + SYSCALL_Arm64_shmctl = 195, + SYSCALL_Arm64_shmat = 196, + SYSCALL_Arm64_shmdt = 197, SYSCALL_Arm64_socket = 198, SYSCALL_Arm64_socketpair = 199, SYSCALL_Arm64_bind = 200, diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Passthrough.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Passthrough.cpp index f71330e8b..243b9050a 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Passthrough.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls/Passthrough.cpp @@ -249,10 +249,10 @@ uint64_t SyscallPassthrough7(FEXCore::Core::CpuStateFrame *Frame, uint64_t arg1, SyscallPassthrough3); REGISTER_SYSCALL_IMPL_PASS_FLAGS(mincore, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, SyscallPassthrough3); - REGISTER_SYSCALL_IMPL_PASS_FLAGS(_shmget, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, - SyscallPassthrough3); - REGISTER_SYSCALL_IMPL_PASS_FLAGS(_shmctl, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, - SyscallPassthrough3); + REGISTER_SYSCALL_IMPL_PASS_FLAGS(shmget, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, + SyscallPassthrough3); + REGISTER_SYSCALL_IMPL_PASS_FLAGS(shmctl, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, + SyscallPassthrough3); REGISTER_SYSCALL_IMPL_PASS_FLAGS(getpid, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, SyscallPassthrough0); REGISTER_SYSCALL_IMPL_PASS_FLAGS(socket, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Memory.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Memory.cpp index 36973a053..842371662 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Memory.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Memory.cpp @@ -112,7 +112,7 @@ namespace FEX::HLE::x32 { SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL_X32(_shmat, [](FEXCore::Core::CpuStateFrame *Frame, int shmid, const void *shmaddr, int shmflg) -> uint64_t { + REGISTER_SYSCALL_IMPL_X32(shmat, [](FEXCore::Core::CpuStateFrame *Frame, int shmid, const void *shmaddr, int shmflg) -> uint64_t { // also implemented in ipc:OP_SHMAT uint32_t ResultAddr{}; uint64_t Result = static_cast(FEX::HLE::_SyscallHandler)->GetAllocator()-> @@ -127,7 +127,7 @@ namespace FEX::HLE::x32 { } }); - REGISTER_SYSCALL_IMPL_X32(_shmdt, [](FEXCore::Core::CpuStateFrame *Frame, const void *shmaddr) -> uint64_t { + REGISTER_SYSCALL_IMPL_X32(shmdt, [](FEXCore::Core::CpuStateFrame *Frame, const void *shmaddr) -> uint64_t { // also implemented in ipc:OP_SHMDT uint64_t Result = static_cast(FEX::HLE::_SyscallHandler)->GetAllocator()-> Shmdt(shmaddr); diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Semaphore.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Semaphore.cpp index feccb3f97..31b0cabc3 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Semaphore.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/Semaphore.cpp @@ -319,7 +319,7 @@ namespace FEX::HLE::x32 { else { buf = *shmun.buf32; } - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, &buf); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, &buf); // IPC_SET sets the internal data structure that the kernel uses // No need to writeback break; @@ -328,7 +328,7 @@ namespace FEX::HLE::x32 { case SHM_STAT_ANY: case IPC_STAT: { struct shmid64_ds buf{}; - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, &buf); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, &buf); if (Result != -1) { if (IPC64) { *shmun.buf64 = buf; @@ -341,7 +341,7 @@ namespace FEX::HLE::x32 { } case IPC_INFO: { struct shminfo si{}; - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, reinterpret_cast(&si)); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, reinterpret_cast(&si)); if (Result != -1) { if (IPC64) { *shmun.__buf64 = si; @@ -354,7 +354,7 @@ namespace FEX::HLE::x32 { } case SHM_INFO: { struct shm_info si{}; - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, reinterpret_cast(&si)); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, reinterpret_cast(&si)); if (Result != -1) { // SHM_INFO doesn't follow IPC64 behaviour *shmun.__buf_info_32 = si; @@ -362,13 +362,13 @@ namespace FEX::HLE::x32 { break; } case SHM_LOCK: - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, nullptr); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, nullptr); break; case SHM_UNLOCK: - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, nullptr); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, nullptr); break; case IPC_RMID: - Result = ::syscall(SYSCALL_DEF(_shmctl), shmid, cmd, nullptr); + Result = ::syscall(SYSCALL_DEF(shmctl), shmid, cmd, nullptr); break; default: diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/SyscallsEnum.h b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/SyscallsEnum.h index cff8bb54a..ed7d9a1f7 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/SyscallsEnum.h +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x32/SyscallsEnum.h @@ -412,10 +412,10 @@ enum Syscalls_x86 { SYSCALL_x86_rseq = 386, SYSCALL_x86_semget = 393, SYSCALL_x86_semctl = 394, - SYSCALL_x86__shmget = 395, - SYSCALL_x86__shmctl = 396, - SYSCALL_x86__shmat = 397, - SYSCALL_x86__shmdt = 398, + SYSCALL_x86_shmget = 395, + SYSCALL_x86_shmctl = 396, + SYSCALL_x86_shmat = 397, + SYSCALL_x86_shmdt = 398, SYSCALL_x86_msgget = 399, SYSCALL_x86_msgsnd = 400, SYSCALL_x86_msgrcv = 401, diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Memory.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Memory.cpp index b61a9a0f8..1dbe51d66 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Memory.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Memory.cpp @@ -103,7 +103,7 @@ namespace FEX::HLE::x64 { SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL_X64_FLAGS(_shmat, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, + REGISTER_SYSCALL_IMPL_X64_FLAGS(shmat, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, [](FEXCore::Core::CpuStateFrame *Frame, int shmid, const void *shmaddr, int shmflg) -> uint64_t { uint64_t Result = reinterpret_cast(shmat(shmid, shmaddr, shmflg)); @@ -113,7 +113,7 @@ namespace FEX::HLE::x64 { SYSCALL_ERRNO(); }); - REGISTER_SYSCALL_IMPL_X64_FLAGS(_shmdt, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, + REGISTER_SYSCALL_IMPL_X64_FLAGS(shmdt, SyscallFlags::OPTIMIZETHROUGH | SyscallFlags::NOSYNCSTATEONENTRY, [](FEXCore::Core::CpuStateFrame *Frame, const void *shmaddr) -> uint64_t { uint64_t Result = ::shmdt(shmaddr); diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/SyscallsEnum.h b/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/SyscallsEnum.h index df5e5de09..65548a5d2 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/SyscallsEnum.h +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/SyscallsEnum.h @@ -38,9 +38,9 @@ enum Syscalls_x64 { SYSCALL_x64_msync = 26, SYSCALL_x64_mincore = 27, SYSCALL_x64_madvise = 28, - SYSCALL_x64__shmget = 29, - SYSCALL_x64__shmat = 30, - SYSCALL_x64__shmctl = 31, + SYSCALL_x64_shmget = 29, + SYSCALL_x64_shmat = 30, + SYSCALL_x64_shmctl = 31, SYSCALL_x64_dup = 32, SYSCALL_x64_dup2 = 33, SYSCALL_x64_pause = 34, @@ -76,7 +76,7 @@ enum Syscalls_x64 { SYSCALL_x64_semget = 64, SYSCALL_x64_semop = 65, SYSCALL_x64_semctl = 66, - SYSCALL_x64__shmdt = 67, + SYSCALL_x64_shmdt = 67, SYSCALL_x64_msgget = 68, SYSCALL_x64_msgsnd = 69, SYSCALL_x64_msgrcv = 70, diff --git a/docs/ReleaseProcess.md b/docs/ReleaseProcess.md index 0e73b2c6a..d3384b256 100644 --- a/docs/ReleaseProcess.md +++ b/docs/ReleaseProcess.md @@ -70,14 +70,6 @@ Follow the steps in: https://github.com/FEX-Emu/FEX-ppa/blob/main/README.md * Jekyll will automatically regenerate the website with a github action * Verify that the post shows up on the site at fex-emu.com -## Termux package update steps -* Clone https://github.com/termux/termux-packages -* Update the package script with thew new version tag (https://github.com/termux/termux-packages/blob/master/packages/fex/build.sh) -* ***!!! Test the build locally on an Android device !!!*** - * Check the wiki for a command to run in the local changed repo on-device - * https://github.com/termux/termux-packages/wiki/Building-packages#how-to-build-package -* Submit a PR to upstream on github to get it picked up - ## @FEX_Emu twitter account steps * Requires @FEX_Emu twitter account access * Create a tweet with some small blurb/sizzle text about some relevant changes in this tagged version