Commit graph

249 commits

Author SHA1 Message Date
Jeff Guo cefc37a553
PPU LLVM arm64+macOS port (#12115)
* BufferUtils: use naive function pointer on Apple arm64

Use naive function pointer on Apple arm64 because ASLR breaks asmjit.
See BufferUtils.cpp comment for explanation on why this happens and how
to fix if you want to use asmjit.

* build-macos: fix source maps for Mac

Tell Qt not to strip debug symbols when we're in debug or relwithdebinfo
modes.

* LLVM PPU: fix aarch64 on macOS

Force MachO on macOS to fix LLVM being unable to patch relocations
during codegen. Adds Aarch64 NEON intrinsics for x86 intrinsics used by
PPUTranslator/Recompiler.

* virtual memory: use 16k pages on aarch64 macOS

Temporary hack to get things working by using 16k pages instead of 4k
pages in VM emulation.

* PPU/SPU: fix NEON intrinsics and compilation for arm64 macOS

Fixes some intrinsics usage and patches usages of asmjit to properly
emit absolute jmps so ASLR doesn't cause out of bounds rel jumps. Also
patches the SPU recompiler to properly work on arm64 by telling LLVM to
target arm64.

* virtual memory: fix W^X toggles on macOS aarch64

Fixes W^X on macOS aarch64 by setting all JIT mmap'd regions to default
to RW mode. For both SPU and PPU execution threads, when initialization
finishes we toggle to RX mode. This exploits Apple's per-thread setting
for RW/RX to let us be technically compliant with the OS's W^X
    enforcement while not needing to actually separate the memory
    allocated for code/data.

* PPU: implement aarch64 specific functions

Implements ppu_gateway for arm64 and patches LLVM initialization to use
the correct triple. Adds some fixes for macOS W^X JIT restrictions when
entering/exiting JITed code.

* PPU: Mark rpcs3 calls as non-tail

Strictly speaking, rpcs3 JIT -> C++ calls are not tail calls. If you
call a function inside e.g. an L2 syscall, it will clobber LR on arm64
and subtly break returns in emulated code. Only JIT -> JIT "calls"
should be tail.

* macOS/arm64: compatibility fixes

* vm: patch virtual memory for arm64 macOS

Tag mmap calls with MAP_JIT to allow W^X on macOS. Fix mmap calls to
existing mmap'd addresses that were tagged with MAP_JIT on macOS. Fix
memory unmapping on 16K page machines with a hack to mark "unmapped"
pages as RW.

* PPU: remove wrong comment

* PPU: fix a merge regression

* vm: remove 16k page hacks

* PPU: formatting fixes

* PPU: fix arm64 null function assembly

* ppu: clean up arch-specific instructions
2022-06-14 15:28:38 +03:00
RipleyTom 2010d697c8 feat: add boot test menu entry 2022-06-03 01:15:54 +02:00
C.W. Betts 39201e5042 Fix macdeployqt.
This is based off of the instructions found here: https://riptutorial.com/qt/example/24133/integrating-with-cmake
2022-03-18 13:19:36 +01:00
陈俊嘉 20cc2d7267 Add multi-config generator build support for Windows. 2022-01-02 23:59:54 +01:00
orbea 59f253ba24 cmake: Use GNUInstalldirs 2021-11-22 21:45:55 +01:00
Megamouse aff7d8a994 Qt: fix QSvg deployment 2021-10-28 23:54:56 +02:00
陈俊嘉 42e3add6a1
BUILD: a couple of cmake msvc compile fixes (#10799)
* cmake: a couple of msvc compile fixes

Throw error when using multi-config generators.
Add USE_MSVC_STATIC_CRT option for statically linking with CRT.
Set curl's CURL_STATIC_CRT aligned with USE_MSVC_STATIC_CRT.
Fix cmake configs of 7z and OpenAL in msvc build.
Remove unecessary hard coded compiling and linking flags.
Use debug option in windeployqt when configuring for a debug build.
Search for windeployqt tool in configure time.
Add vcpkg's Qt support.

* Fix some typos
2021-09-11 23:55:53 +02:00
Justin Lewis ae491f04a1
Fixes build issue with LLVM on Windows with cmake (#10776)
LLVM fails to build on Windows with C++ 20 standard.  When building LLVM
on Windows, we use C++ 14 already.  This commit changes the c++ standard
to be picked by each subdirectory rather than the standard being picked
by the root level cmake file.
2021-08-31 11:07:49 +01:00
Lctrs 0042f4e16e metainfo: move away from deprecated appdata 2021-05-19 19:55:58 +03:00
p01arst0rm 35ee550171 changed discord-rpc to discordRPC 2021-05-04 01:27:41 +02:00
David Carlier 0b9e4ffe54 Mac OS build update and simplification, recent releases of macOS has clock_gettime support. 2021-04-24 12:55:21 +03:00
p01arst0rm e9d785475e removed redundant cmake version check 2021-04-20 21:38:47 +03:00
p01arst0rm bcfae17219 unified missmatched indentation in CMake files 2021-04-20 21:38:47 +03:00
p01arst0rm b812ef2771 removed space between and its opening parentheses 2021-04-19 08:59:28 +03:00
Timothy Redaelli 826dc7d5a6 Fix linking with system curl 2021-03-04 12:22:19 +03:00
Megamouse b9a4abce0e DS4: inherit from hid_pad_handler 2021-02-22 10:45:40 +01:00
Nekotekina 25827c12a3 Make out of source builds get copy of /GuiConfigs/, /git/, etc.
Reduce quality of kot-bg.jpg.
2021-02-06 12:55:14 +03:00
Luke Barr cb8ef46ec7
Initial DualSense Support (#9308)
* Initial DualSense Support

* Add Vibration Support

* Add CRC32 Validation to Incoming Bluetooth Packets
Cleanup report sizes

* Consistency, remove button comments, add two buttons.

Co-authored-by: Ani <ani-leo@outlook.com>
2020-12-13 00:00:45 +01:00
RipleyTom 9e14d240a8 Implement ethernet address determination 2020-10-16 22:53:48 +03:00
RipleyTom 190822c2b2
RPCN Client (#8663) 2020-08-27 20:47:04 +01:00
scribam 20f53e65eb cmake: Add support for target_precompiled_headers if available 2020-04-14 23:00:51 +03:00
scribam a2bf0719ea
cmake: Fix windeployqt command line for release builds (#7871) 2020-03-27 00:33:07 +00:00
Nekotekina 491526b421 Add option USE_COTIRE=ON (by default)
Precompiled headers cause rebuild problems with ninja, for example.
2020-02-10 14:47:12 +03:00
linkmauve e9c5c6e6bf Move input to its own directory (#7126) 2019-12-22 17:39:42 +01:00
kd-11 fff1007d9a cmake: Fix vulkan on X11 2019-12-20 16:57:01 +03:00
Emmanuel Gil Peyrot e30173a835 rsx: Make X11 optional on Linux
This makes it possible to build rpcs3 on a pure Wayland system, without
the Xlib installed.
2019-12-20 10:48:03 +00:00
scribam f29709105f cmake: Add post-build commands for Windows 2019-11-25 23:08:37 +03:00
Alex James 3ad743ecaa Add option for preventing display sleep (#5783)
Adds support for preventing the display from sleeping while a game is
running. Supports Windows, Linux (with the org.freedesktop.ScreenSaver
D-Bus service), and macOS.
2019-10-12 15:40:47 +03:00
Megamouse 503d43889d rename rpcs3_app to headless_application 2019-08-14 23:54:09 +02:00
Nekotekina f63e89f9b4 Implement waitable atomics
Moved Atomic.h to util/atomic.hpp
List source files in CMakeLists.txt
2019-07-29 03:04:55 +03:00
RipleyTom f2aaad11bb Adds libusb 2019-03-18 19:05:02 +03:00
Alex James f5163cc4ff CMake: Use Info.plist template for macOS bundle
Define and use a template for Info.plist for the macOS bundle. The template
uses the previously defined RPCS3_GIT_TAG variable for automatically
generating the version strings, and also enables proper HiDPI support.
2019-02-26 21:09:18 +00:00
Alex James 923700a167 CMake: Refactor git-version.cmake
Refactor git-version.cmake to define the RPCS3_GIT_VERSION,
RPCS3_GIT_BRANCH, and RPCS3_GIT_TAG variables, and move the generation
of git-version.h to a function (gen_git_version).
2019-02-26 21:09:18 +00:00
vit9696 5a40c1802b Support macOS bundling for binary distribution 2018-12-16 18:17:21 +03:00
Nekotekina d98420fbc3 CMake: use CMAKE_SOURCE_DIR instead of .. in some places 2018-12-10 01:43:47 +03:00
vit9696 634a5fa31c Fix macOS compilation 2018-11-19 14:39:33 +03:00
Jan Beich 0da556e1f8 build/cmake: properly disable assert() globally for release builds
Assertion failed: (ObjectBufferMap.find(Key) == ObjectBufferMap.end() && "Second attempt to perform debug registration."), function NotifyObjectEmitted, file llvm/lib/ExecutionEngine/GDBRegistrationListener.cpp, line 168.
2018-09-22 10:35:45 +03:00
Jan Beich efb3b08f87 build/cmake: ADDITIONAL_LIBS satisfy dependency by other libraries
/usr/bin/ld: undefined reference to symbol `libiconv_open' (try adding -liconv)
2018-09-22 10:35:45 +03:00
Jan Beich 1c8fc6852a build/cmake: build everything with -pthread, not just GLEW
error: POSIX thread support was disabled in PCH file but is currently enabled
2018-09-22 10:35:45 +03:00
Lassi Hämäläinen 9a457400e7 CMake: Fix Qt resource files not included in build
- Move Qt resource initialization to rpcs3_qt target
2018-09-19 01:59:27 +03:00
Lassi Hämäläinen 7aef811ff7 CMake: Refactor CMake build (#5032)
* CMake: Refactor build to multiple libraries

- Refactor CMake build system by creating separate libraries for
  different components
- Create interface libraries for most dependencies and add 3rdparty::*
  ALIAS targets for ease of use and use them to try specifying correct
  dependencies for each target
- Prefer 3rdparty:: ALIAS when linking dependencies
- Exclude xxHash subdirectory from ALL build target
- Add USE_SYSTEM_ZLIB option to select between using included ZLib and
  the ZLib in CMake search path

* Add cstring include to Log.cpp

* CMake: Add 3rdparty::glew interface target

* Add Visual Studio CMakeSettings.json to gitignore

* CMake: Move building and finding LLVM to 3rdparty/llvm.cmake script

- LLVM is now built under 3rdparty/ directory in the binary directory

* CMake: Move finding Qt5 to 3rdparty/qt5.cmake script

- Script has to be included in rpcs3/CMakeLists.txt because it defines
  Qt5::moc target which isn't available in that folder if it is
  included in 3rdparty directory
- Set AUTOMOC and AUTOUIC properties for targets requiring them (rpcs3
  and rpcs3_ui) instead of setting CMAKE_AUTOMOC and CMAKE_AUTOUIC so
  those properties are not defined for all targets under rpcs3 dir

* CMake: Remove redundant code from rpcs3/CMakeLists.txt

* CMake: Add BUILD_LLVM_SUBMODULE option instead of hardcoded check

- Add BUILD_LLVM_SUBMODULE option (defaults to ON) to allow controlling
  usage of the LLVM submodule.
- Move option definitions to root CMakeLists

* CMake: Remove separate Emu subtargets

- Based on discussion in pull request #5032, I decided to combine
  subtargets under Emu folder back to a single rpcs3_emu target

* CMake: Remove utilities, loader and crypto targets: merge them to Emu

- Removed separate targets and merged them into rpcs3_emu target as
  recommended in pull request (#5032) conversations. Separating targets
  probably later in a separate pull request

* Fix relative includes in pad_thread.cpp

* Fix Travis-CI cloning all submodules needlessly
2018-09-18 13:07:33 +03:00
scribam 6c62d042c5 3rdparty: remove optional submodule 2018-08-31 20:13:54 +04:00
Ani 4357892081 Bump CMake Requirement to 3.8.2+
With older builds CMake will error out with `CXX_STANDARD is set to invalid value '17'`

CXX_STANDARD 17 was added on CMake 3.8.X as found in the 3.8.2 documentation: https://cmake.org/cmake/help/v3.8/prop_tgt/CXX_STANDARD.html

Also removes leftover from old VS2015/2017 mixed instructions, removes "Not GCC 6.1" since we require 7.3+ now and bumps Xcode to 10. Proper MacOS instructions will be added afterwards by someone else.
2018-08-29 22:01:57 +01:00
jmatich b5dbd44087 Compilation fixes for Mingw64 (MSYS2) (#4899)
fix compilation on mingw
2018-08-29 14:27:10 +03:00
Dzmitry Malyshau c452b43ebc Basic support for Vulkan Portability on OSX 2018-08-28 21:20:11 +03:00
Nekotekina 6bbec61856 VS: enable C++17 2018-08-25 01:15:47 +03:00
Nekotekina 5afd12e8a4 [CMake] Use C++17 2018-08-24 16:44:19 +03:00
Alex James 064d0619e8 VS: Fix QT deploy for paths with spaces 2018-07-18 15:32:01 +04:00
scribam e18e6576f3 cmake: remove duplicated directive used to include cmake_modules 2018-07-15 12:51:09 +04:00
scribam 1fdc070e4e cmake: remove obsolete command for glslang integration 2018-07-09 03:33:05 +04:00