Skip to content

Commit d422044

Browse files
compnerdrokhinip
authored andcommitted
build: remove unnecessary flag to control the linker
The `SWIFT_LINKER_FLAGS` allows the user to specify the linker that they want for Swift and C/C++ have their own flags which let you control flags which should permit control of the C/C+ linker. This removes the unnecessary logic for controlling the linker. This simplification always paves the way for migrating further to CMake 3.15+. Signed-off-by: Rokhini Prabhu <[email protected]>
1 parent 56dc31b commit d422044

File tree

3 files changed

+0
-48
lines changed

3 files changed

+0
-48
lines changed

CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ include(CheckLibraryExists)
3030
include(CheckSymbolExists)
3131
include(GNUInstallDirs)
3232
include(SwiftSupport)
33-
include(DispatchUtilities)
3433

3534
set(SWIFT_LIBDIR "lib" CACHE PATH "Library folder name, defined by swift main buildscript")
3635
set(INSTALL_LIBDIR "${SWIFT_LIBDIR}" CACHE PATH "Path where the libraries should be installed")
@@ -83,18 +82,6 @@ option(ENABLE_DTRACE "enable dtrace support" "")
8382

8483
option(ENABLE_TESTING "build libdispatch tests" ON)
8584

86-
option(USE_LLD_LINKER "use the lld linker" FALSE)
87-
88-
if(NOT USE_LLD_LINKER AND
89-
(CMAKE_SYSTEM_NAME STREQUAL Linux OR
90-
CMAKE_SYSTEM_NAME STREQUAL FreeBSD OR
91-
CMAKE_SYSTEM_NAME STREQUAL Android))
92-
set(USE_GOLD_LINKER_DEFAULT TRUE)
93-
else()
94-
set(USE_GOLD_LINKER_DEFAULT FALSE)
95-
endif()
96-
option(USE_GOLD_LINKER "use the gold linker" ${USE_GOLD_LINKER_DEFAULT})
97-
9885
option(ENABLE_THREAD_LOCAL_STORAGE "enable usage of thread local storage via _Thread_local" ON)
9986
set(DISPATCH_USE_THREAD_LOCAL_STORAGE ${ENABLE_THREAD_LOCAL_STORAGE})
10087

cmake/modules/DispatchUtilities.cmake

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,6 @@ if(ENABLE_SWIFT)
116116
PROPERTIES
117117
POSITION_INDEPENDENT_CODE YES)
118118

119-
if(USE_LLD_LINKER)
120-
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
121-
set(use_ld_flag -use-ld=lld.exe)
122-
else()
123-
set(use_ld_flag -use-ld=lld)
124-
endif()
125-
elseif(USE_GOLD_LINKER)
126-
if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
127-
set(use_ld_flag -use-ld=gold.exe)
128-
else()
129-
set(use_ld_flag -use-ld=gold)
130-
endif()
131-
endif()
132-
133119
add_swift_library(swiftDispatch
134120
CFLAGS
135121
-fblocks
@@ -138,7 +124,6 @@ if(ENABLE_SWIFT)
138124
module-maps
139125
DispatchStubs
140126
LINK_FLAGS
141-
${use_ld_flag}
142127
-lDispatchStubs
143128
-L $<TARGET_LINKER_FILE_DIR:BlocksRuntime>
144129
-lBlocksRuntime
@@ -260,7 +245,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
260245
"-Xlinker -dead_strip"
261246
"-Xlinker -alias_list -Xlinker ${PROJECT_SOURCE_DIR}/xcodeconfig/libdispatch.aliases")
262247
endif()
263-
dispatch_set_linker(dispatch)
264248

265249
install(TARGETS
266250
dispatch

0 commit comments

Comments
 (0)