Fixes a problem where a space between the shebang and application
argument would result in us trying to execute a null program.
Additionally it now captures all the arguments passed in the shebang
header rather than just the application and first argument.
This was being checked by an application for kernel version. Which was
seeing too new of a kernel and using things that were unsupported.
Also removes the EmulatedMap which is an unnecessary lookup.
We need to check to see if the application wanting to be executed is in
the rootfs first. Otherwise we end up in a case where we either lose
tracking of applications in FEX, or applications fail to launch since
they don't exist in the global filesystem
Patch moves HandleSIGSEGV in HostFactory.cpp to a non-frontend host signal handler, then registers its own frontend signal handler to catch unhandled segfaults.
Fixes the formatting. Everything was using the incorrect formatting.
Changes the saved msg popup to a generic popup handler.
If a file couldn't be opened, open a popup claiming the error.
Makes it nicer to realize when trying to open main and nothing happens
when the file doesn't exit
Sadly these things can't be split without breaking functionality so it
turns in to a bit of a mess.
SyscallHandler is very much something that is a Linux only construct and
shouldn't be in FEXCore itself. Lets the frontend register a
Syscallhandler with FEXCore. FEXCore itself is then aware of the current
syscall ABI and handles the ABI in an optimal fashion.
So it is not a 100% clean break otherwise we would lose performance.
The SignalDelegator then needs to move to the frontend since the
SyscallHandler requires it for signal based syscalls.
The CPU backend signal handling still needs to happen in FEXCore because
it is a very tight coupling with the CPU backend.
Once we need to support more Signal handling we can give the backends
cleaner support to select which specific OS handler to handle.
If the guest application tried pushing arguments then optparse was still
capturing them as unknown and failing.
Just push the arguments directly in to our argument lists
If we want to execve files directly we need to ensure that the
binfmt_misc interpreter path is installed.
If it isn't installed then we need to fall down the regular path of
pushing FEX to the front of the argument list.
The only way to determine if we are running in the "interpreter" mode is
by determining filename.
if any application does an execve then we use /proc/self/exe to
determine which FEX we should execute. Sadly this resolved the softlink
to FEXLoader, breaking the chain.
Change it to a hardlink in order to ensure this doesn't happen.
This also moves the install target outside of aarch64 install target so
it can be tested on x86 hosts.
Symlinks FEXLoader to FEXInterpreter and switches binfmt_misc to use it
It's the only safe way to determine if we are the interpreter or just
someone executing through FEXLoader directly.
Instead of having the configuration being loaded and stored in to a
frontend system. First moves the backing store of the configuration in
to FEXCore.
Each layer that is constructed then loads its particular configuration.
After the layers are loaded, then a meta layer is constructed that
merges the layers flat.
This means we will no longer hit the problem where a configuration is
stored in the "main" configuration file, then environment and arguments
passed manage to overwrite it.
The order of the layers going from inner most layer to outer most, with
outermost overwriting previous layer configurations is as follows:
Main < Global application < Local application < Arguments < Environment
One step that needs to be changed in the future is that FEXCore can then
just load its configuration from the layers directly since the data is
in FEXCore now. This will be reserved for a future change so we are less
disruptive.
If we are passed a shebang application then append the rootfs prefix for
absolute paths.
Fixes the issue where bash scripts weren't working on ARM.
Also fixes a crash that can occur if FEX wasn't passed in arguments
or if the argument passed in didn't exist.
It'll now instead exit cleanly and state that the application doesn't
exist respectively.
- InvalidateFlags pseudo-op is a hint for the Dead Flags Elimination pass that flags are not needed past that point
- Adds a new option, --abi-local-flags, that invalidates the flags on CALLs or RETs. This might break code that doesn't follow the ABI rules.
This dumps the IR before and after optimizations
--dump-ir can be
"no" -> Do not dump
"stderr" -> Dump to stderr
"stdout" -> Dump to stdout
"some/path" -> Dump to "some/path/$GuestRip-pre.ir" and "some/path/$GuestRip-post.ir"