[libcxx-commits] [libcxx] [libc++] Encode the standard version in the ABI tag (PR #218527)
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Oct 4 13:39:49 PDT 2026
mstorsjo wrote:
This change broke some tests in mingw mode, when building with Clang 24 from a recent git version. (This doesn't happen with the slightly older release version of Clang used in CI - that's why this hasn't shown up in CI.)
The errors can be seen e.g. in my weekly test runs with the latest nightly Clang + corresponding version of libc++, which now fails a bunch of tests: https://github.com/mstorsjo/llvm-mingw/actions/runs/37221468433/job/111492558091
The failing tests hit errors like this:
```
# .---command stderr------------
# | ld.lld: error: undefined symbol: float std::__1::__locale::__str_to_float_c_locale[abi:n240000qe29]<float>(char const*, char**)
# | >>> referenced by C:/Users/RUNNER~1/AppData/Local/Temp/lit-tmp-xxlz5o90/user_defined_char_type-a1b703.o:(float std::__1::__num_get_float[abi:n240000qe29]<float>(char const*, char const*, unsigned int&))
# |
# | ld.lld: error: undefined symbol: long double std::__1::__locale::__str_to_float_c_locale[abi:n240000qe29]<long double>(char const*, char**)
# | >>> referenced by C:/Users/RUNNER~1/AppData/Local/Temp/lit-tmp-xxlz5o90/user_defined_char_type-a1b703.o:(long double std::__1::__num_get_float[abi:n240000qe29]<long double>(char const*, char const*, unsigned int&))
# | clang-24: error: linker command failed with exit code 1 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 1
```
The problem seems to be that the libc++ library exports these symbols, with an ABI tag. When the user code is compiled with a different version of C++ than used for building the libc++ library itself, we have undefined references.
This seems to appear with a newer version of Clang, where the tests are built with `-std=c++2d`, while the libc++ library itself was built with a different version. For the succeeding configuration in CI, the tests are built with `-std=c++26`, matching the library.
This change in itself should be unrelated to the root cause though - that the library shouldn't be exporting any symbols that include ABI tags, which we seem to have for `long double std::__1::__locale::__str_to_float_c_locale[abi:n240000qe29]<long double>(char const*, char**)`.
https://github.com/llvm/llvm-project/pull/218527
More information about the libcxx-commits
mailing list