@@ -257,12 +257,6 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
257
257
set (LLVM_LINKER_DETECTED YES CACHE INTERNAL "" )
258
258
set (LLVM_LINKER_IS_GNULD YES CACHE INTERNAL "" )
259
259
message (STATUS "Linker detection: GNU ld" )
260
- elseif ("${stderr} " MATCHES "(illumos)" OR
261
- "${stdout} " MATCHES "(illumos)" )
262
- set (LLVM_LINKER_DETECTED YES CACHE INTERNAL "" )
263
- set (LLVM_LINKER_IS_SOLARISLD YES CACHE INTERNAL "" )
264
- set (LLVM_LINKER_IS_SOLARISLD_ILLUMOS YES CACHE INTERNAL "" )
265
- message (STATUS "Linker detection: Solaris ld (illumos)" )
266
260
elseif ("${stderr} " MATCHES "Solaris Link Editors" OR
267
261
"${stdout} " MATCHES "Solaris Link Editors" )
268
262
set (LLVM_LINKER_DETECTED YES CACHE INTERNAL "" )
@@ -296,6 +290,7 @@ if (NOT DEFINED LLVM_LINKER_DETECTED AND NOT WIN32)
296
290
endif ()
297
291
298
292
function (add_link_opts target_name)
293
+ include (CheckLinkerFlag)
299
294
get_llvm_distribution(${target_name} in_distribution in_distribution_var)
300
295
if (NOT in_distribution)
301
296
# Don't LTO optimize targets that aren't part of any distribution.
@@ -327,7 +322,6 @@ function(add_link_opts target_name)
327
322
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS" AND LLVM_LINKER_IS_SOLARISLD)
328
323
# Support for ld -z discard-unused=sections was only added in
329
324
# Solaris 11.4. GNU ld ignores it, but warns every time.
330
- include (CheckLinkerFlag)
331
325
check_linker_flag(CXX "-Wl,-z,discard-unused=sections" LINKER_SUPPORTS_Z_DISCARD_UNUSED)
332
326
if (LINKER_SUPPORTS_Z_DISCARD_UNUSED)
333
327
set_property (TARGET ${target_name} APPEND_STRING PROPERTY
@@ -355,6 +349,12 @@ function(add_link_opts target_name)
355
349
set_property (TARGET ${target_name} APPEND_STRING PROPERTY
356
350
LINK_FLAGS " -Wl,-brtl" )
357
351
endif ()
352
+
353
+ # Check for existence of symbolic functions flag. Not supported
354
+ # by the older BFD linker (such as on some OpenBSD archs), the
355
+ # MinGW driver for LLD, and the Solaris native linker.
356
+ check_linker_flag(CXX "-Wl,-Bsymbolic-functions"
357
+ LLVM_LINKER_SUPPORTS_B_SYMBOLIC_FUNCTIONS)
358
358
endfunction (add_link_opts)
359
359
360
360
# Set each output directory according to ${CMAKE_CONFIGURATION_TYPES}.
0 commit comments