Skip to content

Commit 2047ee4

Browse files
Darko LulicDarko Lulic
authored andcommitted
RDKEMW-9893: set option to enable new dtags.
1 parent c96fb64 commit 2047ee4

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Source/cmake/OptionsCommon.cmake

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ else ()
7171
set(LD_SUPPORTS_THIN_ARCHIVES FALSE)
7272
set(LD_SUPPORTS_DISABLE_NEW_DTAGS FALSE)
7373
endif ()
74+
75+
if (LD_SUPPORTS_DISABLE_NEW_DTAGS)
76+
set(DISABLE_NEW_DTAGS_DEFAULT ON)
77+
else ()
78+
set(DISABLE_NEW_DTAGS_DEFAULT OFF)
79+
endif ()
80+
81+
option(DISABLE_NEW_DTAGS "Disable new dtags" ${DISABLE_NEW_DTAGS_DEFAULT})
82+
7483
unset(LD_VERSION)
7584
message(STATUS "Linker variant in use: ${LD_VARIANT} ")
7685
message(STATUS " Linker supports thin archives - ${LD_SUPPORTS_THIN_ARCHIVES}")
@@ -112,10 +121,14 @@ message(STATUS " Archiver supports thin archives - ${AR_SUPPORTS_THIN_ARCHIVES}
112121
# passing the option DT_RUNPATH is used, which can be overriden by the value
113122
# of LD_LIBRARY_PATH set in the environment, resulting in unexpected behaviour
114123
# for developers.
115-
if (LD_SUPPORTS_DISABLE_NEW_DTAGS)
124+
if (DISABLE_NEW_DTAGS)
116125
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--disable-new-dtags")
117126
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--disable-new-dtags")
118127
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,--disable-new-dtags")
128+
else ()
129+
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,--enable-new-dtags")
130+
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -Wl,--enable-new-dtags")
131+
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -Wl,--enable-new-dtags")
119132
endif ()
120133

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

0 commit comments

Comments
 (0)