Skip to content

Commit 2f0e26e

Browse files
authored
Merge pull request #1603 from lulicdarko/RDKEMW-9893_enable_new_dtags_2.46
RDKEMW-9893: added option to enable new dtags.
2 parents a055be7 + 05c2201 commit 2f0e26e

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

Source/cmake/OptionsCommon.cmake

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ endif ()
104104
if (LD_USAGE MATCHES "--gc-sections")
105105
set(LD_SUPPORTS_GC_SECTIONS TRUE)
106106
endif ()
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})
107115
unset(LD_USAGE)
108116

109117
message(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")
162174
endif ()
163175

164176
# Prefer thin archives by default if they can be both created by the

0 commit comments

Comments
 (0)