Skip to content

libcxx-22.1.0_rc2 fails to compile with: ../work/libcxx/src/filesystem/operations.cpp:254:18: error: no member named 'copy_file_range' in the global namespace #181543

Description

@stefson

hello everyone,

got this compile error in libcxx-22.1.0_rc2

[1776/1919] /usr/lib/llvm/22/bin/wasm32-wasip1-clang++-22 --target=wasm32-wasip1 --sysroot=/usr/wasm32-wasip1 -DLIBCXX_BUILDING_LIBCXXABI -DLIBC_NAMESPACE=__llvm_libc_common_utils -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION=2 -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/src -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/runtimes_build-.default/include/c++/v1 -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/runtimes_build-.default/libcxx/private-abi-headers -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/cmake/Modules/../../libc  -O2 -pipe -fomit-frame-pointer -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 -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++23 -fPIC -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wzero-length-array -Wdeprecated-redundant-constexpr-static-def -Wno-nullability-completeness -Wmissing-prototypes -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-error -fno-exceptions -fdebug-prefix-map=/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/runtimes_build-.default/include/c++/v1=/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/include -MD -MT libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o -MF libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o.d -o libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o -c /usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/src/filesystem/operations.cpp
FAILED: [code=1] libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o 
/usr/lib/llvm/22/bin/wasm32-wasip1-clang++-22 --target=wasm32-wasip1 --sysroot=/usr/wasm32-wasip1 -DLIBCXX_BUILDING_LIBCXXABI -DLIBC_NAMESPACE=__llvm_libc_common_utils -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LIBCPP_AVAILABILITY_MINIMUM_HEADER_VERSION=2 -D_LIBCPP_BUILDING_LIBRARY -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/src -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/runtimes_build-.default/include/c++/v1 -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/runtimes_build-.default/libcxx/private-abi-headers -I/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/cmake/Modules/../../libc  -O2 -pipe -fomit-frame-pointer -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 -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++23 -fPIC -faligned-allocation -nostdinc++ -fvisibility-inlines-hidden -fvisibility=hidden -fsized-deallocation -Wall -Wextra -Wnewline-eof -Wshadow -Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type -Wextra-semi -Wundef -Wunused-template -Wformat-nonliteral -Wzero-length-array -Wdeprecated-redundant-constexpr-static-def -Wno-nullability-completeness -Wmissing-prototypes -Wno-user-defined-literals -Wno-covered-switch-default -Wno-suggest-override -Wno-error -fno-exceptions -fdebug-prefix-map=/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/runtimes_build-.default/include/c++/v1=/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/include -MD -MT libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o -MF libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o.d -o libcxx/src/CMakeFiles/cxx_shared.dir/filesystem/operations.cpp.o -c /usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/src/filesystem/operations.cpp
/usr/wasm32-wasip1/tmp/portage/llvm-runtimes/libcxx-22.1.0_rc2/work/libcxx/src/filesystem/operations.cpp:254:18: error: no member named 'copy_file_range' in the global namespace
  254 |     if ((res = ::copy_file_range(read_fd.fd, &off_in, write_fd.fd, &off_out, count, 0)) == -1) {
      |                  ^~~~~~~~~~~~~~~
1 error generated.

full build log: build.log.gz

I reverted #169405 locally to fix it.

sadly I don't fully understand the pullrequest, but seems that my attempt to compile libcxx for a wasm32-wasip1 sysroot fails, because _LIBCPP_FILESYSTEM_USE_COPY_FILE_RANGE cannot be seen by the compiler.

I guess that extending the visibility by adding a defined for the wasm case should fully fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    build-problemlibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions