[llvm] [libc][bazel] Prevent LIBC_NAMESPACE leakeage (PR #70455)

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 01:34:07 PST 2023


================
@@ -48,7 +48,7 @@ def _libc_library(name, hidden, copts = [], deps = [], **kwargs):
 # Any library which does not define a public function should be listed with
 # libc_support_library.
 def libc_support_library(name, **kwargs):
-    _libc_library(name = name, hidden = True, **kwargs)
+    _libc_library(name = name, hidden = False, **kwargs)
----------------
gchatelet wrote:

Hiding the symbols results in internal fuzzers complaining about different visibility between modules:
```
default visibility for functions and variables [-fvisibility] differs in PCH file vs. current file
module file __redacted__/stl/_objs/stl_cc_library/stl_cc_library.pic.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

`hidden = False` is actually coherent with how it worked before this patch. I wanted to straighten up the visibility but it has consequences for downstream.

Now that I think about it, it makes sense that both internal targets and libc_support_library are compiled with the same visibility. I'll fix it by using `libc_support_library` in lieu of `_libc_library` in `libc_function` below.

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


More information about the llvm-commits mailing list