[libcxx-commits] [libcxx] [libc++] Guard additional headers with _LIBCPP_HAS_LOCALIZATION (PR #131921)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 19 10:49:44 PDT 2025


ldionne wrote:

@mplatings @domin144 This patch is [failing in the CI](https://buildkite.com/llvm-project/libcxx-ci/builds/41359#0195ab32-521b-4d5e-bc9c-6036d5f2759c) with e.g.:

```
/usr/local/bin/c++ <...>/llvm-project/libcxx-ci/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp --sysroot=<...>/llvm-project/libcxx-ci/build/armv7m-picolibc/install --target=armv7m-none-eabi -nostdinc++ -I <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test-suite-install/include/c++/v1 -I <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test-suite-install/include/c++/v1 -I <...>/llvm-project/libcxx-ci/libcxx/test/support -Wno-atomic-alignment -include picolibc.h -std=c++26 -Werror -Wall -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM -lc++experimental -nostdlib -nostdlib++ -L <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test-suite-install/lib -lc++ -lc++abi -lc -lm -lclang_rt.builtins -lsemihost -lcrt0-semihost -T <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/install/lib/picolibcpp.ld -Wl,--defsym=__flash=0x0 -Wl,--defsym=__flash_size=0x400000 -Wl,--defsym=__ram=0x21000000 -Wl,--defsym=__ram_size=0x1000000 -Wl,--defsym=__stack_size=0x1000 -o <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/Output/overflow.pass.cpp.dir/t.tmp.exe
# .---command stderr------------
# | ld.lld: error: undefined symbol: std::__1::basic_streambuf<char, std::__1::char_traits<char>>::seekoff(long, std::__1::ios_base::seekdir, unsigned int)
# | >>> referenced by iostream.cpp
# | >>>               iostream.cpp.obj:(vtable for std::__1::__stdinbuf<char>) in archive <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test-suite-install/lib/libc++.a
# | >>> referenced by iostream.cpp
# | >>>               iostream.cpp.obj:(vtable for std::__1::__stdoutbuf<char>) in archive <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test-suite-install/lib/libc++.a
# | >>> did you mean: std::__1::basic_streambuf<char, std::__1::char_traits<char>>::seekoff(long long, std::__1::ios_base::seekdir, unsigned int)
# | >>> defined in: <...>/llvm-project/libcxx-ci/build/armv7m-picolibc/libcxx/test-suite-install/lib/libc++.a(ios.instantiations.cpp.obj)
# | clang++: error: ld.lld command failed with exit code 1 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 1
```

I tracked it down a bit and it looks like what might be happening is a mismatch in the definition of the `std::streamoff` type [here](https://github.com/ldionne/llvm-project/blob/b45ce4f3a86ace2da16d1d6f905ac7c4b21bb19d/libcxx/include/__fwd/ios.h#L34). This could result in `basic_streambuf::seekoff` being requested as `basic_streambuf::seekoff(long, ...)` but provided as `basic_streambuf::seekoff(long long, ...)`. Sadly, it's difficult for me to debug this further without having access to the platform. Can you please help out? I'm a bit puzzled as to why this patch is triggering this issue.


https://github.com/llvm/llvm-project/pull/131921


More information about the libcxx-commits mailing list