MaskRay marked an inline comment as done.
MaskRay added inline comments.

================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:243
+if(${CMAKE_SYSTEM_NAME} MATCHES 
"DragonFly|FreeBSD|Fuchsia|Linux|NetBSD|OpenBSD")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} 
-Wl,-Bsymbolic-functions")
+endif()
----------------
phosek wrote:
> MaskRay wrote:
> > phosek wrote:
> > > I'd really like to avoid modifying `CMAKE_SHARED_LINKER_FLAGS`, modifying 
> > > these global variables is an antipattern in modern CMake. We should 
> > > always set these directly on the targets that need them. What's the 
> > > problem with the approach you used in the first patch?
> > With this, we can make libLLVM*.so libclang*.so (-DBUILD_SHARED_LIBS=on) 
> > and other lib*.so faster as well.
> I'd prefer to setting that flag inside `add_llvm_library` and 
> `add_clang_library` when `SHARED` is set. `HandleLLVMOptions` is also used 
> from runtimes where setting this flag is really undesirable (that's why using 
> global variables is really problematic).
`add_llvm_library` and `add_clang_library` may be used by downstream projects 
which don't want -Bsymbolic-functions.

Switched back. I'll just not touch -DBUILD_SHARED_LIBS=on for now.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102090/new/

https://reviews.llvm.org/D102090

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to