[clang] [llvm] [CMake] Add a linker test for -Bsymbolic-functions to AddLLVM (PR #79539)

Rainer Orth via cfe-commits cfe-commits at lists.llvm.org
Thu May 15 05:30:10 PDT 2025


================
@@ -355,6 +349,9 @@ function(add_link_opts target_name)
     set_property(TARGET ${target_name} APPEND_STRING PROPERTY
                  LINK_FLAGS " -Wl,-brtl")
   endif()
+
+  check_linker_flag(CXX "-Wl,-Bsymbolic-functions"
----------------
rorth wrote:

**Please** don't go this route: it makes feature tests completely unmaintainable.  Consider the Solaris case where initially only `/bin/ld` was supported which didn't accept `-Bsymbolic-functions`.  Only later when GNU `ld` became an alternative linker that one **would** support that option.  How on earth is one supposed to know that I now have to revise the cmake check to detect this if it were restricted to some platforms?

https://github.com/llvm/llvm-project/pull/79539


More information about the cfe-commits mailing list