title: Using C++ Modules TS with standard headers on linux
body: <p>I am testing a simple C++ module using the modules ts:</p>
  
  <pre><code>export module strings;
  #include &lt;string&gt;
  </code></pre>
  
  <p>When I try to compile that with clang (trunk) and GCC 7.2 headers on linux, I get this:</p>
  
  <pre><code>clang++ -std=c++2a -fmodules-ts -fprebuilt-module-path=. --precompile -x c++-module -o strings.pcm ../../src/base/strings.cc
  In file included from ../../src/base/strings.cc:2:
  In file included from /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/string:52:
  In file included from /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/bits/basic_string.h:39:
  In file included from /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/c++/7.2.0/ext/atomicity.h:35:
  In file included from /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0/bits/gthr.h:148:
  /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0/bits/gthr-default.h:101:1: error: weakref declaration must have internal linkage
  __gthrw(pthread_once)
  ^
  /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0/bits/gthr-default.h:99:23: note: expanded from macro '__gthrw'
  #define __gthrw(name) __gthrw2(__gthrw_ ## name,name,name)
                        ^
  /usr/lib/gcc/x86_64-linux-gnu/7.2.0/../../../../include/x86_64-linux-gnu/c++/7.2.0/bits/gthr-default.h:90:46: note: expanded from macro '__gthrw2'
    static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
                                               ^
  </code></pre>
  
  <p>I tried to pre-include <code>&lt;bits/gthr-default.h&gt;</code> (before the <code>export module</code>), but then I get errors regarding <code>time.h</code> and <code>sched.h</code>... </p>
  
  <p>Does anyone know a way to get this to compile?</p>
  
  <p>(For the complete error message, see here: <a href="https://godbolt.org/g/wfjmpW" rel="nofollow noreferrer">https://godbolt.org/g/wfjmpW</a>)</p>