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"
This will become important in the future when we are actually executing
this code directly on host.
FEX itself doesn't yet care about memory permissions
This allows us to only check for the lower 64bits of the MM registers
when doing MMX ops for example.
Top 16bits in that case is undefined and needs to be ignored
All the previous fixed offset problems are now fixed so we can flick
this on.
We still allocate memory regions at fixed addresses, but due to
enforcing pie this is fine.
This will install a binfmt_misc target for x86_64 targets that allows
FEXLoader to be the interpreter.
Everything else is already set up to allow this to work, just time to
hook it up.
This requires implementing custom ASM dispatchers for the interpreter
side of things so it works correctly.
Allows all of our CPU backends to safely support signaling.
This is a bit of a nightmare change and requires rethinking logic about
debugging in some instances.