aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2021-06-02 19:44:20 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2021-06-03 10:56:18 +0000
commitf9478b4f40b89897a8f44f766562123f14b79576 (patch)
tree07b3b6f90d71a69508c9dbef585c1abb21ccb00c /games
parent6c20c4906a3b0f805c932f4e74ef7f62086e704d (diff)
downloadports-f9478b4f40b89897a8f44f766562123f14b79576.tar.gz
ports-f9478b4f40b89897a8f44f766562123f14b79576.zip
games/minetest: fix link on aarch64
Diffstat (limited to 'games')
-rw-r--r--games/minetest/files/patch-src_CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/games/minetest/files/patch-src_CMakeLists.txt b/games/minetest/files/patch-src_CMakeLists.txt
new file mode 100644
index 000000000000..83617a6d4002
--- /dev/null
+++ b/games/minetest/files/patch-src_CMakeLists.txt
@@ -0,0 +1,20 @@
+diff --git src/CMakeLists.txt src/CMakeLists.txt
+index 9526e88f9..06cb0d604 100644
+--- src/CMakeLists.txt
++++ src/CMakeLists.txt
+@@ -758,7 +758,14 @@ else()
+ check_c_source_compiles("#ifndef __aarch64__\n#error\n#endif\nint main(){}" IS_AARCH64)
+ if(IS_AARCH64)
+ # Move text segment below LuaJIT's 47-bit limit (see issue #9367)
+- SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment=0x200000000")
++ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
++ # XXX: lld linke needs another option; not sure how to check for lld specifically,
++ # so just checking for FreeBSD (which uses lld) for now. I'm also not sure if its
++ # equivalent replacement and haven't runtested it, but it at least builds
++ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--image-base=0x200000000")
++ else()
++ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Ttext-segment=0x200000000")
++ endif()
+ endif()
+ endif()
+