From df994c006d443a8b40386da209a2aaed5b1b5c1f Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 7 Mar 2021 06:33:31 +0100 Subject: [PATCH] radiant: build netradiant as non-PIE binary on Linux to workaround a mime-type bug PIE executables were wrongly recognized as shared libraries on Linux because of a mistake in the mime-type library. Because of that it was not possible to launch such executables from the file browser. While the problem is fixed upstream, most distributions still ship with a faulty mime-type library and may do for a long time. See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11 --- radiant/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/radiant/CMakeLists.txt b/radiant/CMakeLists.txt index 93fedea4..aa52ef32 100644 --- a/radiant/CMakeLists.txt +++ b/radiant/CMakeLists.txt @@ -132,4 +132,15 @@ if (X11_LIBRARIES) target_link_libraries(${RADIANT_BASENAME} ${X11_LIBRARIES}) endif () +# PIE executables were wrongly recognized as shared libraries on Linux +# because of a mistake in the mime-type library. +# Because of that it was not possible to launch such executables from +# the file browser. +# While the problem is fixed upstream, most distributions still ship +# with a faulty mime-type library and may do for a long time. +# See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/11 +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") + target_link_libraries(${RADIANT_BASENAME} -no-pie) +endif() + copy_dlls(${RADIANT_BASENAME}) -- 2.39.2