mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-05 18:23:39 -04:00
Fixed launch failures on NetBSD due to PaX MPROTECT restrictions
This commit is contained in:
parent
23393904e0
commit
118579adb3
5 changed files with 31 additions and 0 deletions
11
CMakeModules/DisablePaxMprotect.cmake
Normal file
11
CMakeModules/DisablePaxMprotect.cmake
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
function(disable_pax_mprotect target)
|
||||||
|
if (BSD STREQUAL "NetBSD")
|
||||||
|
add_custom_command(TARGET ${target} POST_BUILD
|
||||||
|
COMMAND paxctl +m "$<TARGET_FILE:${target}>"
|
||||||
|
COMMENT "Disabling PaX MPROTECT restrictions for '${target}'"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "disable_pax_mprotect only applies on NetBSD.")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
@ -31,6 +31,11 @@ add_library(azahar_libretro SHARED
|
||||||
|
|
||||||
create_target_directory_groups(azahar_libretro)
|
create_target_directory_groups(azahar_libretro)
|
||||||
|
|
||||||
|
if (BSD STREQUAL "NetBSD")
|
||||||
|
include(DisablePaxMprotect)
|
||||||
|
disable_pax_mprotect(azahar_libretro)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(citra_common PRIVATE libretro)
|
target_link_libraries(citra_common PRIVATE libretro)
|
||||||
target_link_libraries(citra_core PRIVATE libretro)
|
target_link_libraries(citra_core PRIVATE libretro)
|
||||||
target_link_libraries(video_core PRIVATE libretro)
|
target_link_libraries(video_core PRIVATE libretro)
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,11 @@ add_executable(citra_meta
|
||||||
|
|
||||||
set_target_properties(citra_meta PROPERTIES OUTPUT_NAME "azahar")
|
set_target_properties(citra_meta PROPERTIES OUTPUT_NAME "azahar")
|
||||||
|
|
||||||
|
if (BSD STREQUAL "NetBSD")
|
||||||
|
include(DisablePaxMprotect)
|
||||||
|
disable_pax_mprotect(citra_meta)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(DIST_DIR "../../dist/apple")
|
set(DIST_DIR "../../dist/apple")
|
||||||
set(APPLE_RESOURCES
|
set(APPLE_RESOURCES
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,11 @@ add_executable(citra_room_standalone
|
||||||
|
|
||||||
set_target_properties(citra_room_standalone PROPERTIES OUTPUT_NAME "azahar-room")
|
set_target_properties(citra_room_standalone PROPERTIES OUTPUT_NAME "azahar-room")
|
||||||
|
|
||||||
|
if (BSD STREQUAL "NetBSD")
|
||||||
|
include(DisablePaxMprotect)
|
||||||
|
disable_pax_mprotect(citra_room_standalone)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(citra_room_standalone PRIVATE citra_room)
|
target_link_libraries(citra_room_standalone PRIVATE citra_room)
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@ add_executable(tests
|
||||||
|
|
||||||
create_target_directory_groups(tests)
|
create_target_directory_groups(tests)
|
||||||
|
|
||||||
|
if (BSD STREQUAL "NetBSD")
|
||||||
|
include(DisablePaxMprotect)
|
||||||
|
disable_pax_mprotect(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(tests PRIVATE citra_common citra_core video_core audio_core)
|
target_link_libraries(tests PRIVATE citra_common citra_core video_core audio_core)
|
||||||
target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch2 nihstro-headers Threads::Threads)
|
target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch2 nihstro-headers Threads::Threads)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue