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

Christopher Bate via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 4 13:34:07 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"
----------------
christopherbate wrote:

Why was this `check_linker_flag` put inside `add_linker_opts` instead of at the call site where it is actually used in the `llvm-shlib` target? This function is called *every time LLVM creates a library*. Even after the first call when the cache variable is populated, this function seems to have significant overhead.

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


More information about the cfe-commits mailing list