File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,14 @@ endif ()
104104if (LD_USAGE MATCHES "--gc-sections" )
105105 set (LD_SUPPORTS_GC_SECTIONS TRUE )
106106endif ()
107+
108+ if (LD_SUPPORTS_DISABLE_NEW_DTAGS)
109+ set (DISABLE_NEW_DTAGS_DEFAULT ON )
110+ else ()
111+ set (DISABLE_NEW_DTAGS_DEFAULT OFF )
112+ endif ()
113+
114+ option (DISABLE_NEW_DTAGS "Disable new dtags" ${DISABLE_NEW_DTAGS_DEFAULT} )
107115unset (LD_USAGE)
108116
109117message (STATUS "Linker variant in use: ${LD_VARIANT} " )
@@ -155,10 +163,14 @@ endif ()
155163# passing the option DT_RUNPATH is used, which can be overriden by the value
156164# of LD_LIBRARY_PATH set in the environment, resulting in unexpected behaviour
157165# for developers.
158- if (LD_SUPPORTS_DISABLE_NEW_DTAGS )
166+ if (DISABLE_NEW_DTAGS )
159167 string (APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--disable-new-dtags" )
160168 string (APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--disable-new-dtags" )
161169 string (APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,--disable-new-dtags" )
170+ else ()
171+ string (APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--enable-new-dtags" )
172+ string (APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--enable-new-dtags" )
173+ string (APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,--enable-new-dtags" )
162174endif ()
163175
164176# Prefer thin archives by default if they can be both created by the
You can’t perform that action at this time.
0 commit comments