diff --git a/Data/binfmts/FEX-x86.conf.in b/Data/binfmts/FEX-x86.conf.in index 7459953b8..6e09250ee 100644 --- a/Data/binfmts/FEX-x86.conf.in +++ b/Data/binfmts/FEX-x86.conf.in @@ -1 +1 @@ -:FEX-x86:M:0:\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:@CMAKE_INSTALL_PREFIX@/bin/FEXInterpreter:POCF +:FEX-x86:M:0:\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:@CMAKE_INSTALL_PREFIX@/bin/FEX:POCF diff --git a/Data/binfmts/FEX-x86.in b/Data/binfmts/FEX-x86.in index c76259dca..ab14c1873 100644 --- a/Data/binfmts/FEX-x86.in +++ b/Data/binfmts/FEX-x86.in @@ -1,5 +1,5 @@ package fex -interpreter @CMAKE_INSTALL_PREFIX@/bin/FEXInterpreter +interpreter @CMAKE_INSTALL_PREFIX@/bin/FEX magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00 offset 0 mask \xff\xff\xff\xff\xff\xfe\xfe\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff diff --git a/Data/binfmts/FEX-x86_64.conf.in b/Data/binfmts/FEX-x86_64.conf.in index 6c4ad882c..2652ebcc3 100644 --- a/Data/binfmts/FEX-x86_64.conf.in +++ b/Data/binfmts/FEX-x86_64.conf.in @@ -1 +1 @@ -:FEX-x86_64:M:0:\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:@CMAKE_INSTALL_PREFIX@/bin/FEXInterpreter:POCF +:FEX-x86_64:M:0:\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff:@CMAKE_INSTALL_PREFIX@/bin/FEX:POCF diff --git a/Data/binfmts/FEX-x86_64.in b/Data/binfmts/FEX-x86_64.in index fa0e195f4..15bf93038 100644 --- a/Data/binfmts/FEX-x86_64.in +++ b/Data/binfmts/FEX-x86_64.in @@ -1,5 +1,5 @@ package fex -interpreter @CMAKE_INSTALL_PREFIX@/bin/FEXInterpreter +interpreter @CMAKE_INSTALL_PREFIX@/bin/FEX magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00 offset 0 mask \xff\xff\xff\xff\xff\xfe\xfe\x00\x00\x00\x00\xff\xff\xff\xff\xff\xfe\xff\xff\xff diff --git a/FEXCore/Scripts/config_generator.py b/FEXCore/Scripts/config_generator.py index 9f2220bed..ea291c91d 100644 --- a/FEXCore/Scripts/config_generator.py +++ b/FEXCore/Scripts/config_generator.py @@ -159,7 +159,7 @@ def print_man_environment_tail(): "By default FEX will look in {$HOME, $XDG_CONFIG_HOME}/.fex-emu/", "This will override the full path", "If FEX_PORTABLE is declared then relative paths are also supported", - "For FEXInterpreter: Relative to the FEXInterpreter binary", + "For FEX: Relative to the FEX binary", "For WINE: Relative to %LOCALAPPDATA%" ], "''", True) @@ -173,7 +173,7 @@ def print_man_environment_tail(): "One must be careful with this option as it will override any applications that load with execve as well" "If you need to support applications that execve then use FEX_APP_CONFIG_LOCATION instead" "If FEX_PORTABLE is declared then relative paths are also supported", - "For FEXInterpreter: Relative to the FEXInterpreter binary", + "For FEX: Relative to the FEX binary", "For WINE: Relative to %LOCALAPPDATA%" ], "''", True) @@ -192,8 +192,8 @@ def print_man_environment_tail(): "PORTABLE", [ "Allows FEX to run without installation. Global locations for configuration and binfmt_misc are ignored.", - "For FEXInterpreter on Linux:", - "These files are instead read from /fex-emu/ by default.", + "For FEX on Linux:", + "These files are instead read from /fex-emu/ by default.", "For Arm64ec/Wow64 WINE builds:", "These files are instead read from $LOCALAPPDATA/fex-emu/ by default.", "For further customization, see FEX_APP_CONFIG_LOCATION and FEX_APP_DATA_LOCATION." @@ -205,7 +205,7 @@ def print_man_header(): .Dt FEX .Os Linux .Sh NAME -.Nm FEXInterpreter +.Nm FEX .Nm FEXBash .Nd Fast x86-64 and x86 emulation. .Sh SYNOPSIS diff --git a/Scripts/InstallFEX.py b/Scripts/InstallFEX.py index ff6fd7225..3db8dd3b5 100755 --- a/Scripts/InstallFEX.py +++ b/Scripts/InstallFEX.py @@ -333,7 +333,7 @@ def TryInstallRootFS(): return DidInstall def TryBasicProgramExecution(): - return subprocess.call(["FEXInterpreter", "/usr/bin/uname", "-a"]) == 0 + return subprocess.call(["FEX", "/usr/bin/uname", "-a"]) == 0 def ExitWithStatus(Status): # Remove the cached credentials @@ -380,7 +380,7 @@ def main(): print ("FEX is now installed. Trying basic program run") if not TryBasicProgramExecution(): - print ("FEXInterpreter failed to run. Not continuing") + print ("FEX failed to run. Not continuing") ExitWithStatus(-1) print ("") @@ -391,7 +391,7 @@ def main(): print ("# steam is a bash script. Wrap with FEXBash") print ("\tFEXBash steam") print ("# Full path execution execution will wrap the application if it exists in the rootfs") - print ("\tFEXInterpreter /usr/bin/uname") + print ("\tFEX /usr/bin/uname") print ("# Freestanding x86/x86-64 programs can be executed directly. binfmt_misc will redirect to FEX") print ("\t$HOME/PetalCrashOnline.AppImage") print ("# If you need a terminal that emulates everything.") diff --git a/Scripts/guest_test_runner.py b/Scripts/guest_test_runner.py index 07776aa7d..a02e149d2 100644 --- a/Scripts/guest_test_runner.py +++ b/Scripts/guest_test_runner.py @@ -6,7 +6,7 @@ import subprocess # Check if FEX indicates support for AVX def DoesFEXSupportAVX(mode): - fex_interpreter_path = os.path.dirname(sys.argv[7]) + "/FEXInterpreter" + fex_interpreter_path = os.path.dirname(sys.argv[7]) + "/FEX" args = list() args.append(fex_interpreter_path) diff --git a/Source/Common/Config.cpp b/Source/Common/Config.cpp index 45e6d5549..9722c6f81 100644 --- a/Source/Common/Config.cpp +++ b/Source/Common/Config.cpp @@ -373,11 +373,11 @@ fextl::string RecoverGuestProgramFilename(fextl::string Program, bool ExecFDInte // // Examples: // - Regular execve. Application must exist on disk. - // execve binfmt_misc args layout: `FEXInterpreter ...` + // execve binfmt_misc args layout: `FEX ...` // - Regular execveat with FD. FD is backed by application on disk. - // execveat binfmt_misc args layout: `FEXInterpreter ...` + // execveat binfmt_misc args layout: `FEX ...` // - Regular execveat with FD. FD points to file on disk that has been deleted. - // execveat binfmt_misc args layout: `FEXInterpreter /dev/fd/ ...` + // execveat binfmt_misc args layout: `FEX /dev/fd/ ...` #ifndef _WIN32 if (ExecFDInterp || ProgramFDFromEnv != -1) { // Only in the case that FEX is executing an FD will the program argument potentially be a symlink. diff --git a/Source/Common/Config.h b/Source/Common/Config.h index 3a1e26e5f..9bcfaab25 100644 --- a/Source/Common/Config.h +++ b/Source/Common/Config.h @@ -37,7 +37,7 @@ struct ApplicationNames { struct PortableInformation { bool IsPortable; - // Path of folder containing FEXInterpreter (including / at the end) + // Path of folder containing FEX (including / at the end) fextl::string InterpreterPath; }; diff --git a/Source/Common/FEXServerClient.cpp b/Source/Common/FEXServerClient.cpp index f77c5eb3d..cf9b00318 100644 --- a/Source/Common/FEXServerClient.cpp +++ b/Source/Common/FEXServerClient.cpp @@ -121,7 +121,7 @@ fextl::string GetServerMountFolder() { // This is due to pressure-vesssel being a chroot environment. // It by default maps the host-filesystem to `/run/host/` so we need to redirect. // After pressure-vessel is fully set up it will set the `FEX_ROOTFS` environment variable, - // which the FEXInterpreter will pick up on. + // which FEX will pick up. Folder = "/run/host/" + Folder; } @@ -244,7 +244,7 @@ int ConnectToAndStartServer(std::string_view InterpreterPath) { } fextl::string FEXServerPath = fextl::fmt::format("{}/FEXServer", InterpreterDir); - // Check if a local FEXServer next to FEXInterpreter exists + // Check if a local FEXServer next to FEX exists // If it does then it takes priority over the installed one if (!FHU::Filesystem::Exists(FEXServerPath)) { FEXServerPath = "FEXServer"; diff --git a/Source/Tools/CommonTools/PortabilityInfo.h b/Source/Tools/CommonTools/PortabilityInfo.h index e3c8ad1c2..320096856 100644 --- a/Source/Tools/CommonTools/PortabilityInfo.h +++ b/Source/Tools/CommonTools/PortabilityInfo.h @@ -4,7 +4,7 @@ namespace FEX { static inline std::optional GetSelfPath() { - // Read the FEXInterpreter path from `/proc/self/exe` which is always a symlink to the absolute path of the executable running. + // Read the FEX path from `/proc/self/exe` which is always a symlink to the absolute path of the executable running. // This way we can get the parent path that the application is executing from. char SelfPath[PATH_MAX]; auto Result = readlink("/proc/self/exe", SelfPath, PATH_MAX); @@ -34,7 +34,7 @@ static inline FEX::Config::PortableInformation ReadPortabilityInformation() { return {false, {}}; } - // Extract the absolute path from the FEXInterpreter path + // Extract the absolute path from the FEX path return {true, *SelfPath}; } } // namespace FEX diff --git a/Source/Tools/FEXBash/FEXBash.cpp b/Source/Tools/FEXBash/FEXBash.cpp index 05933ee8c..903ad12b0 100644 --- a/Source/Tools/FEXBash/FEXBash.cpp +++ b/Source/Tools/FEXBash/FEXBash.cpp @@ -19,28 +19,28 @@ int main(int argc, char** argv, char** const envp) { const bool EmptyArgs = ArgCount == 0; std::vector Argv; - // FEXInterpreter will handle finding bash in the rootfs + // FEX will handle finding bash in the rootfs // Use /bin/sh for -c commands and /bin/bash for interactive mode const char* BashPath = EmptyArgs ? "/bin/bash" : "/bin/sh"; - std::string FEXInterpreterPath = std::filesystem::path(argv[0]).parent_path().string() + "/FEXInterpreter"; + std::string FEXPath = std::filesystem::path(argv[0]).parent_path().string() + "/FEX"; - // Check if a local FEXInterpreter to FEXBash exists + // Check if a local FEX to FEXBash exists // If it does then it takes priority over the installed one - if (!std::filesystem::exists(FEXInterpreterPath)) { + if (!std::filesystem::exists(FEXPath)) { char FEXBashPath[PATH_MAX]; auto Result = readlink("/proc/self/exe", FEXBashPath, PATH_MAX); if (Result != -1) { - FEXInterpreterPath = std::filesystem::path(&FEXBashPath[0], &FEXBashPath[Result]).parent_path().string() + "/FEXInterpreter"; + FEXPath = std::filesystem::path(&FEXBashPath[0], &FEXBashPath[Result]).parent_path().string() + "/FEX"; } - if (!std::filesystem::exists(FEXInterpreterPath)) { - fmt::print(stderr, "Could not locate FEXInterpreter executable\n"); + if (!std::filesystem::exists(FEXPath)) { + fmt::print(stderr, "Could not locate FEX executable\n"); std::abort(); } } const char* FEXArgs[] = { - FEXInterpreterPath.c_str(), + FEXPath.c_str(), BashPath, "-c", }; @@ -51,7 +51,7 @@ int main(int argc, char** argv, char** const envp) { Argv.resize(ArgCount + FEXArgsCount); - // Pass in the FEXInterpreter arguments + // Pass in the FEX arguments for (size_t i = 0; i < FEXArgsCount; ++i) { Argv[i] = FEXArgs[i]; } diff --git a/Source/Tools/FEXInterpreter/CMakeLists.txt b/Source/Tools/FEXInterpreter/CMakeLists.txt index b9ab6350b..411d1c837 100644 --- a/Source/Tools/FEXInterpreter/CMakeLists.txt +++ b/Source/Tools/FEXInterpreter/CMakeLists.txt @@ -5,26 +5,26 @@ if (ENABLE_VIXL_SIMULATOR) list(APPEND DEFINES -DVIXL_SIMULATOR=1) endif() -add_executable(FEXInterpreter +add_executable(FEX FEXInterpreter.cpp AOT/AOTGenerator.cpp) -target_compile_definitions(FEXInterpreter PRIVATE ${DEFINES}) +target_compile_definitions(FEX PRIVATE ${DEFINES}) -# Enable FEX APIs to be used by targets that use target_link_libraries on FEXInterpreter -set_target_properties(FEXInterpreter PROPERTIES +# Enable FEX APIs to be used by targets that use target_link_libraries on FEX +set_target_properties(FEX PROPERTIES ENABLE_EXPORTS 1 C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN TRUE ) -target_include_directories(FEXInterpreter +target_include_directories(FEX PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ ${CMAKE_BINARY_DIR}/generated ) -target_link_libraries(FEXInterpreter +target_link_libraries(FEX PRIVATE ${LIBS} LinuxEmulation @@ -32,10 +32,10 @@ target_link_libraries(FEXInterpreter ${PTHREAD_LIB} fmt::fmt ) -target_compile_options(FEXInterpreter PRIVATE ${FEX_TUNE_COMPILE_FLAGS}) +target_compile_options(FEX PRIVATE ${FEX_TUNE_COMPILE_FLAGS}) if (CMAKE_BUILD_TYPE MATCHES "RELEASE") - target_link_options(FEXInterpreter + target_link_options(FEX PRIVATE "LINKER:--gc-sections" "LINKER:--strip-all" @@ -43,12 +43,18 @@ if (CMAKE_BUILD_TYPE MATCHES "RELEASE") ) endif() -install(TARGETS FEXInterpreter +install(TARGETS FEX RUNTIME DESTINATION bin COMPONENT Runtime ) +# Create a copy of FEX with legacy names until phased out. +install(PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FEX + RENAME FEXInterpreter + DESTINATION bin + COMPONENT LegacyRuntime) + if (_M_ARM_64) if (NOT USE_LEGACY_BINFMTMISC) # Just restart the systemd service @@ -98,10 +104,10 @@ if (_M_ARM_64) echo "Attempting to install FEX misc now." COMMAND ${CMAKE_COMMAND} -E echo - ':FEX-x86:M:0:\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x03\\x00:\\xff\\xff\\xff\\xff\\xff\\xfe\\xfe\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:${CMAKE_INSTALL_PREFIX}/bin/FEXInterpreter:POCF' > /proc/sys/fs/binfmt_misc/register + ':FEX-x86:M:0:\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x03\\x00:\\xff\\xff\\xff\\xff\\xff\\xfe\\xfe\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:${CMAKE_INSTALL_PREFIX}/bin/FEX:POCF' > /proc/sys/fs/binfmt_misc/register COMMAND ${CMAKE_COMMAND} -E echo - ':FEX-x86_64:M:0:\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x3e\\x00:\\xff\\xff\\xff\\xff\\xff\\xfe\\xfe\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:${CMAKE_INSTALL_PREFIX}/bin/FEXInterpreter:POCF' > /proc/sys/fs/binfmt_misc/register + ':FEX-x86_64:M:0:\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x3e\\x00:\\xff\\xff\\xff\\xff\\xff\\xfe\\xfe\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:${CMAKE_INSTALL_PREFIX}/bin/FEX:POCF' > /proc/sys/fs/binfmt_misc/register COMMAND ${CMAKE_COMMAND} -E echo "binfmt_misc FEX installed" ) diff --git a/Source/Tools/FEXInterpreter/ELFCodeLoader.h b/Source/Tools/FEXInterpreter/ELFCodeLoader.h index c7f53086c..78b6f5d1d 100644 --- a/Source/Tools/FEXInterpreter/ELFCodeLoader.h +++ b/Source/Tools/FEXInterpreter/ELFCodeLoader.h @@ -280,7 +280,7 @@ public: // If we have loaded with EXECFD then we have binfmt_misc preserve argv[0] also set // This adds an additional argument to our argument list that we need to ignore - // argv[0] = FEXInterpreter + // argv[0] = FEX // argv[1] = // argv[2] = // If our kernel if v5.12 or higher then diff --git a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp index c7b1c824f..aca9e103c 100644 --- a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp +++ b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT /* $info$ -tags: Bin|FEXInterpreter +tags: Bin|FEX desc: Glues the ELF loader, FEXCore and LinuxSyscalls to launch an elf under fex $end_info$ */ @@ -141,7 +141,7 @@ bool InterpreterHandler(fextl::string* Filename, const fextl::string& RootFS, fe /** * @brief Queries if FEX is installed as a binfmt_misc interpreter * - * @param ExecutedWithFD If FEXInterpreter was executed using a binfmt_misc FD handle from the kernel + * @param ExecutedWithFD If FEX was executed using a binfmt_misc FD handle from the kernel * @param Portable Portability information about FEX being run in portable mode * * @return true if the binfmt_misc handlers are installed and being used diff --git a/Source/Tools/FEXServer/Main.cpp b/Source/Tools/FEXServer/Main.cpp index df440c170..330b531ac 100644 --- a/Source/Tools/FEXServer/Main.cpp +++ b/Source/Tools/FEXServer/Main.cpp @@ -96,7 +96,7 @@ void SetupSignals() { // Ignore SIGPIPE, we will be checking for pipe closure which could send this signal signal(SIGPIPE, SIG_IGN); - // Reset SIGCHLD which is likely SIG_IGN if FEXInterpreter started the server. + // Reset SIGCHLD which is likely SIG_IGN if FEX started the server. // We now wait for child processes with waitpid, newer libfuse also requires SIGCHLD to not be ignored by child processes. signal(SIGCHLD, SIG_DFL); } @@ -205,7 +205,7 @@ int main(int argc, char** argv, char** const envp) { if (Options.Foreground) { // Only start a log thread if we are in the foreground. - // Prevents FEXInterpreter from trying to log to nothing. + // Prevents FEX from trying to log to nothing. Logger::StartLogThread(); } @@ -215,7 +215,7 @@ int main(int argc, char** argv, char** const envp) { } // Close the pipes we found at the start - // This will let FEXInterpreter know we are ready + // This will let FEX know we are ready PipeScanner::ClosePipes(); ProcessPipe::SetConfiguration(Options.Foreground, Options.PersistentTimeout ?: 1); diff --git a/Source/Tools/FEXServer/ProcessPipe.cpp b/Source/Tools/FEXServer/ProcessPipe.cpp index b4375fedb..e9203a139 100644 --- a/Source/Tools/FEXServer/ProcessPipe.cpp +++ b/Source/Tools/FEXServer/ProcessPipe.cpp @@ -308,7 +308,7 @@ void HandleSocketData(fasio::tcp_socket& Socket) { ++NumFilesOpened; CheckRaiseFDLimit(); } else { - // Log thread isn't running. Let FEXInterpreter know it can't have one. + // Log thread isn't running. Let FEX know it can't have one. SendEmptyErrorPacket(Socket); } diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp index aaf815281..2f0ac8021 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/FileManagement.cpp @@ -977,7 +977,7 @@ uint64_t FileManager::Openat2(int dirfs, const char* pathname, FEX::HLE::open_ho uint64_t FileManager::Statx(int dirfd, const char* pathname, int flags, uint32_t mask, struct statx* statxbuf) { if (IsSelfNoFollow(pathname, flags)) { // If we aren't following the symlink for self then we need to return data about the symlink itself. - // Let's just /actually/ return FEXInterpreter symlink information in this case. + // Let's just /actually/ return FEX symlink information in this case. return FHU::Syscalls::statx(dirfd, pathname, flags, mask, statxbuf); } diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp index 4b8dc1eae..924cf0369 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.cpp @@ -240,7 +240,7 @@ uint64_t ExecveHandler(FEXCore::Core::CpuStateFrame* Frame, const char* pathname if (strcmp(pathname, "/proc/self/exe") == 0 || strcmp(pathname, "/proc/thread-self/exe") == 0 || strcmp(pathname, PidSelfPath) == 0) { // If the application is trying to execve `/proc/self/exe` or its variants, // then we need to redirect this path to the true application path. - // This is because this path is a symlink to the executing application, which is always `FEXInterpreter` or `FEXLoader`. + // This is because this path is a symlink to the executing application, which is always `FEX`. // ex: JRE and shapez.io do this self-execution. Filename = SyscallHandler->Filename(); } diff --git a/Source/Tools/pidof/pidof.cpp b/Source/Tools/pidof/pidof.cpp index 1be99a9db..59ffede5e 100644 --- a/Source/Tools/pidof/pidof.cpp +++ b/Source/Tools/pidof/pidof.cpp @@ -217,10 +217,7 @@ int main(int argc, char** argv) { } auto FindFEXArgument = [](auto& Path) -> int32_t { - if (Path.ends_with("FEXInterpreter")) { - return 1; - } - if (Path.ends_with("FEXLoader")) { + if (Path.ends_with("FEX")) { return 1; } @@ -290,7 +287,7 @@ int main(int argc, char** argv) { bool IsWine = false; if (ProgramArg == -1) { - // If we still haven't found a FEXInterpreter path then this might be an arm64ec FEX application. + // If we still haven't found a FEX path then this might be an arm64ec FEX application. // The only way to know for sure is the walk the mapped files of the process and check if FEX is mapped. if (FindWineFEXApplication(pid.pid, pid.exe_link, Args)) { // Search from the start. diff --git a/ThunkLibs/HostLibs/CMakeLists.txt b/ThunkLibs/HostLibs/CMakeLists.txt index 3a449090a..1059a64e5 100644 --- a/ThunkLibs/HostLibs/CMakeLists.txt +++ b/ThunkLibs/HostLibs/CMakeLists.txt @@ -81,7 +81,7 @@ function(add_host_lib NAME GUEST_BITNESS) target_include_directories(${NAME}-host-${GUEST_BITNESS} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/gen_${GUEST_BITNESS}/") target_link_libraries(${NAME}-host-${GUEST_BITNESS} PRIVATE dl) target_link_libraries(${NAME}-host-${GUEST_BITNESS} PRIVATE lib${NAME}-${GUEST_BITNESS}-deps) - target_link_libraries(${NAME}-host-${GUEST_BITNESS} PRIVATE FEXInterpreter) + target_link_libraries(${NAME}-host-${GUEST_BITNESS} PRIVATE FEX) ## Make signed overflow well defined 2's complement overflow target_compile_options(${NAME}-host-${GUEST_BITNESS} PRIVATE -fwrapv) diff --git a/ThunkLibs/README.md b/ThunkLibs/README.md index f65c23277..1f7d1c5a9 100644 --- a/ThunkLibs/README.md +++ b/ThunkLibs/README.md @@ -15,7 +15,7 @@ ln -s $BUILDDIR/Guest/libX11-guest.so $ROOTFS/lib/x86_64-linux-gnu/libX11.so.6 ``` Finally, FEX needs to be told where to look for the matching host libraries with `-t /Host/Libs/Path`. eg -```FEX_THUNKHOSTLIBS= $BUILDDIR/Host FEXInterpreter /PATH/TO/ELF``` +```FEX_THUNKHOSTLIBS= $BUILDDIR/Host FEX /PATH/TO/ELF``` We currently don't have any unit tests for the guest libraries, only for OP_THUNK. diff --git a/docs/ProgrammingConcerns.md b/docs/ProgrammingConcerns.md index 2c073ae08..b2745cf74 100644 --- a/docs/ProgrammingConcerns.md +++ b/docs/ProgrammingConcerns.md @@ -16,7 +16,7 @@ allocations entirely (where possible). ## Sub-projects and applications that need to follow this. - FEXCore -- FEXInterpreter/FEXLoader +- FEXInterpreter ## Sub-projects that explicitly cannot follow this - Thunks diff --git a/unittests/FEXLinuxTests/CMakeLists.txt b/unittests/FEXLinuxTests/CMakeLists.txt index eb2821d3d..445aed04a 100644 --- a/unittests/FEXLinuxTests/CMakeLists.txt +++ b/unittests/FEXLinuxTests/CMakeLists.txt @@ -54,7 +54,7 @@ function(AddTests Tests BinDirectory Bitness) "${CMAKE_CURRENT_SOURCE_DIR}/Flake_Tests" "${TEST_CASE}" "guest" - "$" + "$" "${BIN_PATH}") set_property(TEST "${TEST_CASE}.jit.flt" APPEND PROPERTY ENVIRONMENT "FEX_OUTPUTLOG=stderr;FEX_SILENTLOG=0;FEX_MAXINST=500") @@ -100,7 +100,7 @@ add_custom_target( WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" USES_TERMINAL COMMAND "ctest" "--output-on-failure" "--timeout" "30" ${TEST_JOB_FLAG} "-R" "\.*\.jit\.flt$$" - DEPENDS FEXLinuxTests FEXLinuxTests_32 FEXInterpreter + DEPENDS FEXLinuxTests FEXLinuxTests_32 FEX ) # Only host @@ -118,5 +118,5 @@ add_custom_target( WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" USES_TERMINAL COMMAND "ctest" "--output-on-failure" "--timeout" "30" ${TEST_JOB_FLAG} "-R" "\.*\.flt$$" - DEPENDS FEXLinuxTests FEXLinuxTests_32 FEXInterpreter + DEPENDS FEXLinuxTests FEXLinuxTests_32 FEX ) diff --git a/unittests/POSIX/CMakeLists.txt b/unittests/POSIX/CMakeLists.txt index 5420c0371..199b4b43b 100644 --- a/unittests/POSIX/CMakeLists.txt +++ b/unittests/POSIX/CMakeLists.txt @@ -17,7 +17,7 @@ foreach(POSIX_TEST ${POSIX_TESTS}) "${CMAKE_CURRENT_SOURCE_DIR}/Flake_Tests" "${TEST_NAME}" "guest" - "${CMAKE_BINARY_DIR}/Bin/FEXInterpreter" + "$" "${POSIX_TEST}") set_property(TEST "${TEST_NAME}.jit.posix" APPEND PROPERTY SKIP_RETURN_CODE 125) set_property(TEST "${TEST_NAME}.jit.posix" APPEND PROPERTY ENVIRONMENT "FEX_OUTPUTLOG=stderr;FEX_SILENTLOG=0;FEX_MAXINST=500") diff --git a/unittests/Readme.md b/unittests/Readme.md index 5117126b2..35f9baaee 100644 --- a/unittests/Readme.md +++ b/unittests/Readme.md @@ -7,10 +7,10 @@ We also regularly run and pass qemu's and valgrind's tests for validation, but t ## x86/64 testing - A lot of handwritten assembly unit tests in [32Bit_ASM](32Bit_ASM) and [ASM](ASM) folders, run via our TestHarnessHelper - A few handwritten IR tests in [IR](IR), run via our IRLoader -- gcc-target-tests-32 and gcc-target-tests-64, run via FEXInterpreter. The tests binaries are in [External/fex-gcc-target-tests-bins](../External/fex-gcc-target-tests-bins) +- gcc-target-tests-32 and gcc-target-tests-64, run via FEX. The tests binaries are in [External/fex-gcc-target-tests-bins](../External/fex-gcc-target-tests-bins) ## Syscall testing -- 64-bit posixtest from http://posixtest.sourceforge.net/, run via FEXInterpreter. The tests binaries are in [External/fex-posixtest-bins](../External/fex-posixtest-bins) -- 64-bit gvisor tests from https://github.com/google/gvisor, run via FEXInterpreter. The tests binaries are in [External/fex-gvisor-tests-bins](../External/fex-gvisor-tests-bins) +- 64-bit posixtest from http://posixtest.sourceforge.net/, run via FEX. The tests binaries are in [External/fex-posixtest-bins](../External/fex-posixtest-bins) +- 64-bit gvisor tests from https://github.com/google/gvisor, run via FEX. The tests binaries are in [External/fex-gvisor-tests-bins](../External/fex-gvisor-tests-bins) diff --git a/unittests/ThunkFunctionalTests/CMakeLists.txt b/unittests/ThunkFunctionalTests/CMakeLists.txt index 7d8cd72a6..1acb11a65 100644 --- a/unittests/ThunkFunctionalTests/CMakeLists.txt +++ b/unittests/ThunkFunctionalTests/CMakeLists.txt @@ -8,7 +8,7 @@ function(AddThunksTest Bin ThunksFile) endif() add_test(NAME ${TEST_NAME} - COMMAND "$" + COMMAND "$" ${Bin}) set_property(TEST ${TEST_NAME} APPEND PROPERTY DEPENDS "${Bin}") set_property(TEST "${TEST_NAME}" APPEND PROPERTY ENVIRONMENT diff --git a/unittests/gcc-target-tests-32/CMakeLists.txt b/unittests/gcc-target-tests-32/CMakeLists.txt index 2ff2a6eeb..66fcd15e8 100644 --- a/unittests/gcc-target-tests-32/CMakeLists.txt +++ b/unittests/gcc-target-tests-32/CMakeLists.txt @@ -22,7 +22,7 @@ foreach(TEST ${TESTS}) "${CMAKE_CURRENT_SOURCE_DIR}/Flake_Tests" "${TEST_NAME}" "guest" - "${CMAKE_BINARY_DIR}/Bin/FEXInterpreter" + "$" "${TEST}") set_property(TEST "${TEST_NAME}" APPEND PROPERTY SKIP_RETURN_CODE 125) set_property(TEST "${TEST_NAME}" APPEND PROPERTY ENVIRONMENT "FEX_OUTPUTLOG=stderr;FEX_SILENTLOG=0;FEX_MAXINST=${BLOCK_SIZE}") diff --git a/unittests/gcc-target-tests-64/CMakeLists.txt b/unittests/gcc-target-tests-64/CMakeLists.txt index 8c781d90d..d6b2490fa 100644 --- a/unittests/gcc-target-tests-64/CMakeLists.txt +++ b/unittests/gcc-target-tests-64/CMakeLists.txt @@ -22,7 +22,7 @@ foreach(TEST ${TESTS}) "${CMAKE_CURRENT_SOURCE_DIR}/Flake_Tests" "${TEST_NAME}" "guest" - "${CMAKE_BINARY_DIR}/Bin/FEXInterpreter" + "$" "${TEST}") set_property(TEST "${TEST_NAME}" APPEND PROPERTY SKIP_RETURN_CODE 125) set_property(TEST "${TEST_NAME}" APPEND PROPERTY ENVIRONMENT "FEX_OUTPUTLOG=stderr;FEX_SILENTLOG=0;FEX_MAXINST=${BLOCK_SIZE}") diff --git a/unittests/gvisor-tests/CMakeLists.txt b/unittests/gvisor-tests/CMakeLists.txt index 92bbc3b2d..9701c49b7 100644 --- a/unittests/gvisor-tests/CMakeLists.txt +++ b/unittests/gvisor-tests/CMakeLists.txt @@ -17,7 +17,7 @@ foreach(TEST ${TESTS}) "${CMAKE_CURRENT_SOURCE_DIR}/Flake_Tests" "${TEST_NAME}" "guest" - "${CMAKE_BINARY_DIR}/Bin/FEXInterpreter" + "$" "${TEST}") set_property(TEST "${TEST_NAME}.jit.gvisor" APPEND PROPERTY SKIP_RETURN_CODE 125) set_property(TEST "${TEST_NAME}.jit.gvisor" APPEND PROPERTY ENVIRONMENT "FEX_OUTPUTLOG=stderr;FEX_SILENTLOG=0;FEX_MAXINST=500")