Only work around libstdc++ when it is the library in use. libc++ has no
bits/c++config.h.

--- a/src/include/nccl_common.h
+++ b/src/include/nccl_common.h
@@ -8,7 +8,7 @@
 #ifndef NCCL_DEBUG_H_
 #define NCCL_DEBUG_H_
 
-#ifdef NCCL_OS_LINUX
+#if defined(NCCL_OS_LINUX) && !__has_include(<__config>)
 // Workaround for libstdc++ trying to force public visibility of std:: symbols.  We don't want to do that in libnccl.so.
 #include <bits/c++config.h>
 #undef _GLIBCXX_VISIBILITY
