From 4ad5ae6a8a66d419086cce253d3d2ce43e15f37e Mon Sep 17 00:00:00 2001 From: hubslave <29800872+hubslave@users.noreply.github.com> Date: Sat, 3 Mar 2018 19:17:32 +0200 Subject: [PATCH] Created Building for OpenBSD (markdown) --- Building-for-OpenBSD.md | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Building-for-OpenBSD.md diff --git a/Building-for-OpenBSD.md b/Building-for-OpenBSD.md new file mode 100644 index 0000000..9bada86 --- /dev/null +++ b/Building-for-OpenBSD.md @@ -0,0 +1,43 @@ +*OpenBSD is not officially supported. These instructions are not actively updated and represent what happened to work for one user on amd64 in March 2018.* + +*Games do not currently work on OpenBSD/amd64 due to [bug 10926][1]. Until/unless a better solution is devised, users can apply a patch like the following to get past the bug:* +``` +diff --git a/Source/Core/Common/MemArena.cpp b/Source/Core/Common/MemArena.cpp +index 750a240e19..da77328e03 100644 +--- a/Source/Core/Common/MemArena.cpp ++++ b/Source/Core/Common/MemArena.cpp +@@ -123,7 +123,7 @@ u8* MemArena::FindMemoryBase() + #if _ARCH_32 + const size_t memory_size = 0x31000000; + #else +- const size_t memory_size = 0x400000000; ++ const size_t memory_size = 0x100000000; + #endif + + #ifdef _WIN32 +``` +[1]: https://bugs.dolphin-emu.org/issues/10926 + +Install the required packages: (Please amend if some are missing, I did not test this on a clean installation!) +``` +pkg_add cmake pulseaudio qtbase +``` +To build, run the following in the repository root directory: +``` +mkdir build && cd build +export Qt5Gui_DIR=/usr/local/lib/qt5/cmake/Qt5Gui +export Qt5Widgets_DIR=/usr/local/lib/qt5/cmake/Qt5Widgets +cmake \ + -DCMAKE_EXE_LINKER_FLAGS='-L/usr/local/lib -lintl -z wxneeded' \ + -DENABLE_WX=OFF .. +make +``` +Rationale: ++ Setting `Qt5Gui_DIR` and `Qt5Widgets_DIR` is necessary because CMake does not know to look for them under `/usr/local/lib/qt5/cmake` by default. ++ PulseAudio wants to link with libintl, but it is not included in the default configuration. ++ Linking with `-z wxneeded` is needed to enable writable-executable memory on OpenBSD. The resulting binary still needs to be run a partition with `wxallowed` set in the mount flags; `/usr/local` is mounted like this by default. ++ wxWidgets needs to be disabled because wxWidgets3 has not been ported to OpenBSD yet. The experimental Qt interface is the only working GUI. + +Other considerations: ++ Dolphin needs a lot of memory to run - more than OpenBSD's default limits allow. Increase the `datasize` limits for your login class to at least 4G in `/etc/login.conf`, or (assuming your login class's `datasize-max` limit permits this) run `ulimit -d 4194304` before running Dolphin, e.g. in your `~/.profile` file or in a Dolphin startup script. ++ To improve performance, you may want to add `-DCMAKE_CXX_FLAGS=-Ofast` to the above CMake invocation when building. \ No newline at end of file