llvm / llvm/llvm-project

[libcxx][test] error unknown 'off64_t'/'fopen64' (32bit musl, LFS)

Open
#223,357 0 comments 0 reactions 0 assignees View on GitHub
libc++
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Testing on 32bit `musl` fails with errors due to 64bit types are unavailable on `musl` and the build doesn't account for 32bit `musl`:

```shell
FAIL: llvm-libc++-shared.cfg.in :: libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp (2680 of 11321)
******************** TEST 'llvm-libc++-shared.cfg.in :: libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# COMPILED WITH
/usr/lib/llvm/22/bin/armv7a-unknown-linux-musleabihf-clang++-22 /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp -pthread --target=armv7a-unknown-linux-musleabihf -nostdinc++ -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -flax-vector-conversions=none -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings -lc++experimental -nostdlib++ -L /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/lib -Wl,-rpath,/var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/lib -lc++ -latomic -o /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test/libcxx/input.output/iostream.format/print.fun/Output/vprint_unicode_windows.pass.cpp.dir/t.tmp.exe
# executed command: /usr/lib/llvm/22/bin/armv7a-unknown-linux-musleabihf-clang++-22 /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp -pthread --target=armv7a-unknown-linux-musleabihf -nostdinc++ -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -flax-vector-conversions=none -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings -lc++experimental -nostdlib++ -L /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/lib -Wl,-rpath,/var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test-suite-install/lib -lc++ -latomic -o /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.arm/libcxx/test/libcxx/input.output/iostream.format/print.fun/Output/vprint_unicode_windows.pass.cpp.dir/t.tmp.exe
# .---command stderr------------
# | In file included from /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp:43:
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:112:13: error: no member named 'off64_t' in the global namespace; did you mean 'off_t'?
# | 112 | using ::off64_t;
# | | ~~^~~~~~~
# | | off_t
# | /usr/include/bits/alltypes.h:155:16: note: 'off_t' declared here
# | 155 | typedef _Int64 off_t;
# | | ^
# | In file included from /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp:43:
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:121:16: error: no member named 'fopen64' in the global namespace; did you mean simply 'fopen64'?
# | 121 | return ::fopen64(pathname, mode);
# | | ^~~~~~~~~
# | | fopen64
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:115:18: note: 'fopen64' declared here
# | 115 | inline FILE* fopen64(const char* pathname, const char* mode) {
# | | ^
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:125:36: error: unknown type name 'off64_t'; did you mean 'off_t'?
# | 125 | inline int ftruncate64(int fd, off64_t length) {
# | | ^~~~~~~
# | | off_t
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:112:13: note: 'off_t' declared here
# | 112 | using ::off64_t;
# | | ^
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:132:16: error: no member named 'ftruncate64' in the global namespace; did you mean simply 'ftruncate64'?
# | 132 | return ::ftruncate64(fd, length);
# | | ^~~~~~~~~~~~~
# | | ftruncate64
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:125:16: note: 'ftruncate64' declared here
# | 125 | inline int ftruncate64(int fd, off64_t length) {
# | | ^
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:234:60: error: no member named 'off64_t' in namespace 'utils'; did you mean 'off_t'?
# | 234 | static_cast::type>(
# | | ^~~~~~~
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:112:13: note: 'off_t' declared here
# | 112 | using ::off64_t;
# | | ^
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:235:44: error: no member named 'off64_t' in namespace 'utils'; did you mean 'off_t'?
# | 235 | std::numeric_limits::max())) {
# | | ^~~~~~~
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:112:13: note: 'off_t' declared here
# | 112 | using ::off64_t;
# | | ^
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:254:50: error: no type named 'off64_t' in namespace 'utils'; did you mean 'off_t'?
# | 254 | fileno(file), static_cast(size)) == -1) {
# | | ~~~~~~~^~~~~~~
# | | off_t
# | /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support/filesystem_test_helper.h:112:13: note: 'off_t' declared here
# | 112 | using ::off64_t;
# | | ^
# | 7 errors generated.
# `-----------------------------
# error: command failed with exit status: 1

--

********************
```

Contributor guide

Open the contributing guide

Research direction

Start with libcxx/test/support/filesystem_test_helper.h, focusing on the off64_t, fopen64, and ftruncate64 references implicated by the diagnostic. Reproduce the failure with libcxx/input.output/iostream.format/print.fun/vprint_unicode_windows.pass.cpp on 32-bit musl; done means this test compiles and passes in that configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.