[libc-commits] [libc] [libc] Set default visibility for LLVM functions (PR #116686)

Petr Hosek via libc-commits libc-commits at lists.llvm.org
Mon Nov 18 13:48:21 PST 2024


petrhosek wrote:

I cannot think of a reason why we'd ever want to expose the internal symbols, hence the need for https://github.com/llvm/llvm-project/commit/665efe896746b1dd138773e6e4d300ec97de27c2 + https://github.com/llvm/llvm-project/commit/5ff3ff33ff930e4ec49da7910612d8a41eb068cb. The question is what should be the visibility for the symbols that are part of the public API, and I don't think there's one size fits all solution, it really depends on your use case. That's why we provide the `LLVM_LIBC_FUNCTION_ATTR` macro which lets libc users make their own decision based on their use case, see for example: https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/system/ulib/c/BUILD.gn;l=184;drc=4cd8bba05cb37d30da9eb365b369ed0a0bb43267. What remains is the default value and I don't have a strong preference either way, but I think that using the default visibility as is done in this change is more conventional. @frobtech do you have any additional thoughts?

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


More information about the libc-commits mailing list