72 Commits

Author SHA1 Message Date
Ryan Houdek
19de33f9ca Adds an option to disable jemalloc from cmake
While not recommended. It is necessary to allow disabling jemalloc if you want to run asan or tsan
2021-07-22 18:16:24 -07:00
Ryan Houdek
310cfcbcc4 Works around static-pie crashing
static-pie is crashing early due to an issue with pthread symbols being exposed as weak.
For some reason the weak symbols never get resolved and jump to zero or ELF base.

When linking static-pie, force search for the pthread symbols using an undefined glob.

With this, static-pie works as long as you link with a new enough version of lld (version 13.0)
2021-07-20 05:24:57 -07:00
Ryan Houdek
6b90663be3 Adds cmake option ENABLE_STATIC_PIE
This option does cmake checks to determine if your system can handle static-pie.
With upstream projects static-pie only works if you use the binutils linker.
Using lld doesn't currently work because it defines __rela_iplt_{start,end} symbols.

Our cmake file will now compile a test application and check for these symbols.
Either the symbols will not exist at all or they will exist but be a null address

Once your system passes the checks then it will allow you to enable static-pie
2021-07-14 09:56:47 -07:00
Ryan Houdek
728e9fc187 Use externals xxhash if not found installed
Also in the case that you don't have v0.8.0 minimum installed
2021-07-05 17:42:35 -07:00
Ryan Houdek
b546869d9d CPack: Update package name to remove conflict
'fex' is already taken by another projects. Use 'fex-emu' instead; Similar to other emulator package names.
2021-07-01 05:08:57 -07:00
Ryan Houdek
6ac942266f Implements support for cpack debian package building
This doesn't currently install thunks which can come a bit later.
We require a postinst and prerm step for importing and unimporting the binfmt_misc files.
Easy enough
2021-06-23 18:47:04 -07:00
Ryan Houdek
24a2a0c4eb Switches binfmt_misc install step to use registration files
This is easier to represent than the raw files. Once we do a debian file install then
this becomes more important
2021-06-22 20:22:09 -07:00
Ryan Houdek
9b4b136121 Move Config.h to ConfigDefines.h
We already have a Config.h which conflicts with this file.
In issue cropped up if you need to include Config.h (the generated one)
from inside Common/ then it would only pull the Common/Config.h file.

Just change the name to not be confusing
2021-06-15 19:06:49 -07:00
Lioncash
37a33bf127 Externals: Add fmt as an external
Begins the process of addressing issue #146.

This is separated off, so that others can make use of fmt for other
purposes (general localized non-sucky string formatting), while the
logging rework is being tackled.
2021-05-20 13:18:38 -04:00
Ryan Houdek
09284331a7 Adds pregen include directory for jemalloc 2021-04-30 18:28:45 -07:00
Ryan Houdek
6b082f4ef7 Removes xxhash version check
xxhash doesn't yet have a version of the library with pkg-config giving
a version.
Debian has backported a change for this but Arch hasn't.
https://github.com/Cyan4973/xxHash/issues/524
2021-04-30 01:35:03 -07:00
Ryan Houdek
b06ebf486f Work around M1 Parallels hypervisor not showing CPU type
Parallels claims that the CPU is of implementor 0x41 and part number 0.
Easy enough to work around before real numbers get exposed
2021-04-27 22:26:35 -07:00
Stefanos Kornilios Mitsis Poiitidis
2294419353 Deps: Require xxhash 0.7.3, ubuntu 20.04 ships with that version 2021-04-26 19:07:23 +03:00
Ryan Houdek
0b0db08ebf Switch from fasthash64 to xxhash's XXH3
Fixes #797
2021-04-18 18:13:27 -07:00
Ryan Houdek
1ad46c5af1 Use mcpu=native with Clang 12
Clang 12 fixes the bug with big.little configurations so we
can keep using mcpu=native past this point
2021-04-16 18:44:34 -07:00
Ryan Houdek
cc0c45cf47 Switches FEX over to using jemalloc
This is the first step that we need to do for correct 32-bit memory allocations.
2021-04-08 12:42:37 -07:00
Ryan Houdek
acb329b8e7 Adds use-after-scope to the ASAN options
Useful for seeing stack scoping problems that can crop up
2021-04-04 22:07:40 -07:00
Ryan Houdek
da49eb3394 Allows installing of FEXThunks in our data directory
This is necessary for building FEX packages that contain some initial thunk libs.
Gives an initial foothold for a default location for the host and guest thunk folders
2021-03-24 03:27:38 -07:00
Ryan Houdek
c5648ac84c Implements support for installing global application profiles
These need to be used sparingly, we don't want to proactively crush user options.
2021-03-23 22:34:01 -07:00
Ryan Houdek
afa869e1f2 Adds Config.h generated file
Gives us the install path and FEXInterpreter locations
2021-03-23 19:12:18 -07:00
Ryan Houdek
48027f1d2e Moves BUILD_TESTS check up the list
This way Source/ can have its own tests
2021-03-15 06:58:06 -07:00
Ryan Houdek
5285f4baa6 Adds CMake option to enable -Werror
We aren't error free so can't be default enabled
2021-03-14 13:27:39 -07:00
Ryan Houdek
ddce28df11
Merge pull request #834 from Sonicadvance1/cleanup_clang_tidy_iwyu
Moves clang-tidy arguments to root cmakelists
2021-03-10 17:47:19 -08:00
Ryan Houdek
1ddfa3e7ed Moves clang-tidy arguments to root cmakelists
This way we don't need to redeclare the arguments twice
Also moves IWYU lower so it doesn't hit any external projects other than FEXCore

Still not running these since everything needs to be cleaned up anyway
2021-03-10 12:38:16 -08:00
Ryan Houdek
ec3883181b Adds x86-64 host performance warning
Lets users know that x86-64 isn't our optimal target but can still be used if passed in a new cmake argument.
Easy enough just pass in -DENABLE_X86_HOST_DEBUG=True to cmake.

Closes #776
2021-03-10 11:36:19 -08:00
Scott Mansell
98cb54e3e4
Merge pull request #812 from phire/both_sides
Allow both ARM64 and X86_64 jits to be compiled at the same time
2021-03-09 14:59:11 +13:00
Scott Mansell
9c339c85c6 Cmake: allow independant control of both jits 2021-03-08 16:30:25 +13:00
Ryan Houdek
8222acdf20 Disabled cmake check for python development
We only need the interpreter
2021-03-06 06:06:59 -08:00
Ryan Houdek
69891867b1 Adds python version check 2021-02-05 10:36:52 -08:00
Scott Mansell
89bfacd845 Don't build thunks by default
Allow people to build fex without a cross-compiler installed
2021-02-02 16:47:55 +13:00
Ryan Houdek
f58d018934 Enables vixl asserts when in debug mode globally
Fixes an issue where some header asserts were missed
2021-01-27 00:52:37 -08:00
Ryan Houdek
921867de7e Works around Clang failing to identify new Kryo CPUs
Some of the newer CPU cores in LLVM's source claim to be a Cortex-A73,
which means they become limited to an ARMv8.0 feature set.

This is what you get if you compile FEX with -mcpu=native

To work around this issue, manually parse /proc/cpuinfo ourselves and
pull out the CPU type to pass to clang directly.
This also fixes the issue that we were using -march on AArch64, which no
longer works on newer clang versions. We instead need to use mcpu or
mtune.

Should improve all atomic op performance outside of the JITs, where they
were turning in to loadstore exclusive pairs.
2021-01-19 03:21:10 -08:00
Stefanos Kornilios Mitsis Poiitidis
d7868fd2bd
Merge pull request #627 from Sonicadvance1/disable_visual_debugger
Disables visual debugger by default
2021-01-11 11:00:16 +02:00
Ryan Houdek
c2b1d68ed1 Disables visual debugger by default
This is currently broken and going to be broken more soon
2021-01-10 02:19:39 -08:00
Stefanos Kornilios Mitsis Poiitidis
278e156a8a Tests: Move timeout to ctest from python + timeout 2021-01-09 19:26:15 +02:00
Ryan Houdek
9f5a507f67 Disables lower 32bit mapping check when ASAN is compiled in
LLVM ASAN sticks some things in the upper range of the 32bit memory
range.
So we have to just allow it when using LLVM asan
2020-12-14 03:59:04 -08:00
Ryan Houdek
1b1edda72d Adds an environment variable for installation directly
This will allow us to look for a global application profile in our
install location.
Once we have things to install there.
2020-12-05 21:17:52 -08:00
Ryan Houdek
a28df9f5c1 Moves SonicUtils in to FEXCore
Removes the extraneous and dead VM CPU backend
2020-11-29 00:30:28 -08:00
Ryan Houdek
06482600e9 Remove annoying vixl warnings 2020-11-20 01:58:58 -08:00
Ryan Houdek
551f6b49cd Enables C++20 feature level
There are a few nice features in C++20 that can make our life easier.
This isn't requiring the full C++20 suite of features, but instead
should allow us to start bringing in features that were at least in
Clang 10.

LLVM 11 came out yesterday (2020-10-12) so it would be a shame to have
that as a minimum requirement.
2020-10-17 16:03:12 -07:00
Ryan Houdek
4adadaba6b Adds support for cmake IWYU option
Only adds the option to enable the Include-What-You-Use program.
This will be useful for cleaning up includes
2020-10-13 17:39:52 -07:00
Ryan Houdek
c0ce5a3101 Ensures architeecture define is defined in the root cmake 2020-09-22 13:05:42 -07:00
Ryan Houdek
74a310eeb2 Enables assertions option from cmake 2020-08-29 23:35:26 -07:00
Scott Mansell
e5c27be7e1 GuestLibs: Allow configuring compiler via cmake 2020-08-21 00:38:25 +12:00
Ryan Houdek
7205ac56cd Throw an error in CMake if someone attempts to compile with GCC
FEX doesn't support GCC.
2020-08-19 23:25:29 -07:00
Stefanos Kornilios Mitsis Poiitidis
2ee277d1c8
Merge pull request #293 from Sonicadvance1/auto_ccache
Automatically enables ccache if the program is found
2020-08-12 19:47:59 +03:00
Stefanos Kornilios Mitsis Poiitidis
cb34056f18
Merge pull request #294 from Sonicadvance1/aarch64_signals
Signals for AArch64
2020-08-12 19:47:10 +03:00
Ryan Houdek
448516882c Implements signal handling in the AArch64 JIT
Also removes the simulator for running on x86-64, which we can no longer
support.
2020-08-11 00:33:50 +01:00
Ryan Houdek
b4893b10db Automatically enables ccache if the program is found
This makes it easier to not forget to use this
2020-08-10 19:31:36 +01:00
Stefanos Kornilios Mitsis Poiitidis
db633b8394 Thunklibs: Add partial X11, SDL, GL, EGL, asound, cmake integration 2020-08-08 14:48:20 +03:00