[Modules TS] new libstdc++ weakref issue

Something recently introduced (~ past two weeks) is now causing the
following error when using Clang with libstdc++ on Linux:

$ cat <<EOF >std-core.mxx
export module std.core;
export
{
#include <stdexcept>
}
EOF

$ clang++-5.0 --version
clang version 5.0.0-svn308397-1~exp1 (trunk)

$ clang++-5.0 -std=c++1z -D__cpp_modules=201704 -fmodules-ts -o std.core.pcm --precompile -Xclang -fmodules-embed-all-files -Xclang -fmodules-codegen -Xclang -fmodules-debuginfo -x c++-module std-core.mxx
In file included from std-core.mxx:4:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/stdexcept:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/string:52:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/bits/basic_string.h:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/ext/atomicity.h:35:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/x86_64-linux-gnu/c++/6.2.0/bits/gthr.h:148:
/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/x86_64-linux-gnu/c++/6.2.0/bits/gthr-default.h:101:1: error: weakref declaration must have internal
      linkage
__gthrw(pthread_once)

A non-module program that uses the same header compiles fine.

Let me know if you need any extra information.

Boris

Something recently introduced (~ past two weeks) is now causing the
following error when using Clang with libstdc++ on Linux:

Can you file a bug for this a bugs.llvm.org.

-Tom

Tom Stellard <tstellar@redhat.com> writes:

Can you file a bug for this a bugs.llvm.org.

Done:

https://bugs.llvm.org/show_bug.cgi?id=33910

Boris