Skip to content

Commit 53cc24d

Browse files
authored
[libc] Disable hidden visibility for LIBC_NAMESPACE with GCC (#98549)
GCC emits a warning when using the visibility attribute which needs to be diagnosed and addressed, but this change should unbreak the GCC build as a temporary workaround. The issue is tracked as #98548.
1 parent 6cbea48 commit 53cc24d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libc/src/__support/macros/config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define LIBC_HAS_FEATURE(f) 0
2929
#endif
3030

31+
#ifdef __clang__
3132
// Declare a LIBC_NAMESPACE with hidden visibility. `namespace
3233
// LIBC_NAMESPACE_DECL {` should be used around all declarations and definitions
3334
// for libc internals as opposed to just `namespace LIBC_NAMESPACE {`. This
@@ -37,5 +38,10 @@
3738
// dynamic relocations. This does not affect the public C symbols which are
3839
// controlled independently via `LLVM_LIBC_FUNCTION_ATTR`.
3940
#define LIBC_NAMESPACE_DECL [[gnu::visibility("hidden")]] LIBC_NAMESPACE
41+
#else
42+
// TODO(#98548): GCC emits a warning when using the visibility attribute which
43+
// needs to be diagnosed and addressed.
44+
#define LIBC_NAMESPACE_DECL LIBC_NAMESPACE
45+
#endif
4046

4147
#endif // LLVM_LIBC_SRC___SUPPORT_MACROS_CONFIG_H

0 commit comments

Comments
 (0)