<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60099>60099</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Recent regression: `symbol 'std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::id' used as both __thread and non-__thread`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc++,
            build-problem
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sylvestre
      </td>
    </tr>
</table>

<pre>
    On Debian arm64 trunk:
Started to regress recently with:

```

FAILED: /build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib/libc++.so.1.0 
: && "/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/./bin/clang++" --target=aarch64-unknown-linux-gnu -fPIC -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins=build-llvm/tools/clang/stage2-bins/runtimes/runtimes-bins -ffile-prefix-map=/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/= -no-canonical-prefixes -O2 -DNDEBUG -g1  -Wl,-z,relro -Wl,--build-id -L/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/lib -Wl,-z,defs -Wl,-z,nodelete -fuse-ld=gold -shared -Wl,-soname,libc++.so.1 -o "/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib/libc++.so.1.0" libcxx/src/CMakeFiles/cxx_shared.dir/algorithm.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/any.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/atomic.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/barrier.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/bind.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/charconv.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/chrono.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/condition_variable.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/condition_variable_destructor.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/exception.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/functional.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/future.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/hash.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/legacy_pointer_safety.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/memory.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/memory_resource.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/mutex.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/mutex_destructor.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/new.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/optional.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/random_shuffle.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/ryu/d2fixed.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/ryu/d2s.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/ryu/f2s.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/shared_mutex.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/stdexcept.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/string.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/system_error.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/thread.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/typeinfo.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/utility.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/valarray.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/variant.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/vector.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/verbose_abort.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/random.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/ios.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/ios.instantiations.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/iostream.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/regex.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/strstream.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/directory_iterator.cpp.o -Wl,-rpath,"/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib:" -nostdlib++  --unwindlib=none  -lpthread  -lc  -lm  -lrt "/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib/clang/16/lib/linux/libclang_rt.builtins-aarch64.a" "/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib/libc++abi.so.1.0" "/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib/libunwind.so.1.0" -lc "/build/llvm-toolchain-snapshot-16~++20230117093440+b332499a94df/build-llvm/tools/clang/stage2-bins/lib/clang/16/lib/linux/libclang_rt.builtins-aarch64.a" -ldl  -lpthread && :
/usr/bin/ld.gold: error: libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: symbol 'std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::id' used as both __thread and non-__thread
/usr/bin/ld.gold: libcxx/src/CMakeFiles/cxx_shared.dir/ios.instantiations.cpp.o: previous definition here
/usr/bin/ld.gold: error: libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: symbol 'std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::id' used as both __thread and non-__thread
/usr/bin/ld.gold: libcxx/src/CMakeFiles/cxx_shared.dir/ios.instantiations.cpp.o: previous definition here
/usr/bin/ld.gold: error: libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: symbol 'std::__1::num_put<char, std::__1::ostreambuf_iterator<char, std::__1::char_traits<char> > >::id' used as both __thread and non-__thread
/usr/bin/ld.gold: libcxx/src/CMakeFiles/cxx_shared.dir/ios.instantiations.cpp.o: previous definition here
/usr/bin/ld.gold: error: libcxx/src/CMakeFiles/cxx_shared.dir/locale.cpp.o: symbol 'std::__1::num_put<wchar_t, std::__1::ostreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::id' used as both __thread and non-__thread
/usr/bin/ld.gold: libcxx/src/CMakeFiles/cxx_shared.dir/ios.instantiations.cpp.o: previous definition here
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[9/29] Generating exported symbols for clang_rt.ubsan_standalone_cxx-aarch64
```



</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWd-P27jx_2u4LwQNmfI66wc_7K7jQ4D7flPkelj0SRiJI4kNRapD0mvfQ__2gpK9cdprimNy2BQ9wKuVSH6Gw_nFGRK8151F3LLbB3a7u4EYekdbfzIH9IHwpnbqtH1v-Q5rDZYDDesVDxTtR1bes2LHivufAlBAxYPjhB2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