https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86756

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Sun Jan  6 22:34:37 2019
New Revision: 267616

URL: https://gcc.gnu.org/viewcvs?rev=267616&root=gcc&view=rev
Log:
PR libstdc++/86756 Move rest of std::filesystem to libstdc++.so

Move std::filesystem directory iterators and operations from
libstdc++fs.a to main libstdc++ library. These components have many
dependencies on OS support, which is not available on all targets. Some
additional autoconf checks and conditional compilation is needed to
ensure the files will build for all targets. Previously this code was
not compiled without --enable-libstdcxx-filesystem-ts but the C++17
components should be available for all hosted builds.

The tests for these components no longer need to link to libstdc++fs.a,
but are not expected to pass on all targets. To avoid numerous failures
on targets which are not expected to pass the tests (due to missing OS
functionality) leave the dg-require-filesystem-ts directives in place
for now. This will ensure the tests only run for builds where the
filesystem-ts library is built, which presumably means some level of OS
support is present.

        PR libstdc++/86756
        * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for utime and
        lstat and define _GLIBCXX_USE_UTIME and _GLIBCXX_USE_LSTAT.
        * config.h.in: Regenerate.
        * config/abi/pre/gnu.ver (GLIBCXX_3.4.26): Export symbols for
        remaining std::filesystem types and functions.
        * configure: Regenerate.
        * src/c++17/Makefile.am: Add C++17 filesystem sources.
        * src/c++17/Makefile.in: Regenerate.
        * src/c++17/cow-fs_dir.cc: Move src/filesystem/cow-std-dir.cc to
        here, and change name of included file.
        * src/c++17/cow-fs_ops.cc: Move src/filesystem/cow-std-ops.cc to
        here, and change name of included file.
        * src/c++17/fs_dir.cc: Move src/filesystem/std-dir.cc to here. Change
        path to dir-common.h.
        * src/c++17/fs_ops.cc: Move src/filesystem/std-ops.cc to here. Change
        path to ops-common.h. Disable -Wunused-parameter warnings.
        (internal_file_clock): Define unconditionally.
        [!_GLIBCXX_HAVE_SYS_STAT_H] (internal_file_clock::from_stat): Do not
        define.
        (do_copy_file, do_space): Move definitions to ops.common.h.
        (copy, file_size, hard_link_count, last_write_time, space): Only
        perform operation when _GLIBCXX_HAVE_SYS_STAT_H is defined, otherwise
        report an error.
        (last_write_time, read_symlink): Remove unused attributes from
        parameters.
        * src/filesystem/Makefile.am: Remove C++17 filesystem sources.
        * src/filesystem/Makefile.in: Regenerate.
        * src/filesystem/cow-std-dir.cc: Move to src/c++17/cow-fs_dir.cc.
        * src/filesystem/cow-std-ops.cc: Move to src/c++17/cow-fs_ops.cc.
        * src/filesystem/std-dir.cc: Move to src/c++17/fs_dir.cc.
        * src/filesystem/std-ops.cc: Move to src/c++17/fs_ops.cc.
        * src/filesystem/dir-common.h [!_GLIBCXX_HAVE_DIRENT_H]: Define
        dummy types and functions instead of using #error.
        * src/filesystem/dir.cc [!_GLIBCXX_HAVE_DIRENT_H]: Use #error.
        * src/filesystem/ops-common.h [!_GLIBCXX_USE_LSTAT] (lstat): Define
        in terms of stat.
        [!_GLIBCXX_HAVE_UNISTD_H]: Define dummy types and functions.
        (do_copy_file, do_space): Move definitions here from std-ops.cc.
        * src/filesystem/ops.cc: Adjust calls to do_copy_file and do_space
        to account for new namespace.
        * testsuite/27_io/filesystem/directory_entry/86597.cc: Remove
        -lstdc++fs from dg-options.
        * testsuite/27_io/filesystem/directory_entry/lwg3171.cc: Likewise.
        * testsuite/27_io/filesystem/file_status/1.cc: Likewise.
        * testsuite/27_io/filesystem/filesystem_error/cons.cc: Likewise.
        * testsuite/27_io/filesystem/filesystem_error/copy.cc: Likewise.
        * testsuite/27_io/filesystem/iterators/directory_iterator.cc:
        Likewise.
        * testsuite/27_io/filesystem/iterators/pop.cc: Likewise.
        * testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc:
        Likewise.
        * testsuite/27_io/filesystem/operations/absolute.cc: Likewise.
        * testsuite/27_io/filesystem/operations/canonical.cc: Likewise.
        * testsuite/27_io/filesystem/operations/copy.cc: Likewise.
        * testsuite/27_io/filesystem/operations/copy_file.cc: Likewise.
        * testsuite/27_io/filesystem/operations/create_directories.cc:
        Likewise.
        * testsuite/27_io/filesystem/operations/create_directory.cc: Likewise.
        * testsuite/27_io/filesystem/operations/create_symlink.cc: Likewise.
        * testsuite/27_io/filesystem/operations/current_path.cc: Likewise.
        * testsuite/27_io/filesystem/operations/equivalent.cc: Likewise.
        * testsuite/27_io/filesystem/operations/exists.cc: Likewise.
        * testsuite/27_io/filesystem/operations/file_size.cc: Likewise.
        * testsuite/27_io/filesystem/operations/is_empty.cc: Likewise.
        * testsuite/27_io/filesystem/operations/last_write_time.cc: Likewise.
        * testsuite/27_io/filesystem/operations/permissions.cc: Likewise.
        * testsuite/27_io/filesystem/operations/proximate.cc: Likewise.
        * testsuite/27_io/filesystem/operations/read_symlink.cc: Likewise.
        * testsuite/27_io/filesystem/operations/relative.cc: Likewise.
        * testsuite/27_io/filesystem/operations/remove.cc: Likewise.
        * testsuite/27_io/filesystem/operations/remove_all.cc: Likewise.
        * testsuite/27_io/filesystem/operations/space.cc: Likewise.
        * testsuite/27_io/filesystem/operations/status.cc: Likewise.
        * testsuite/27_io/filesystem/operations/symlink_status.cc: Likewise.
        * testsuite/27_io/filesystem/operations/temp_directory_path.cc:
        Likewise.
        * testsuite/27_io/filesystem/operations/weakly_canonical.cc: Likewise.

Added:
    trunk/libstdc++-v3/src/c++17/cow-fs_dir.cc
      - copied, changed from r267615,
trunk/libstdc++-v3/src/filesystem/cow-std-dir.cc
    trunk/libstdc++-v3/src/c++17/cow-fs_ops.cc
      - copied, changed from r267615,
trunk/libstdc++-v3/src/filesystem/cow-std-ops.cc
    trunk/libstdc++-v3/src/c++17/fs_dir.cc
      - copied, changed from r267615,
trunk/libstdc++-v3/src/filesystem/std-dir.cc
    trunk/libstdc++-v3/src/c++17/fs_ops.cc
      - copied, changed from r267615,
trunk/libstdc++-v3/src/filesystem/std-ops.cc
Removed:
    trunk/libstdc++-v3/src/filesystem/cow-std-dir.cc
    trunk/libstdc++-v3/src/filesystem/cow-std-ops.cc
    trunk/libstdc++-v3/src/filesystem/std-dir.cc
    trunk/libstdc++-v3/src/filesystem/std-ops.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/acinclude.m4
    trunk/libstdc++-v3/config.h.in
    trunk/libstdc++-v3/config/abi/pre/gnu.ver
    trunk/libstdc++-v3/configure
    trunk/libstdc++-v3/src/c++17/Makefile.am
    trunk/libstdc++-v3/src/c++17/Makefile.in
    trunk/libstdc++-v3/src/filesystem/Makefile.am
    trunk/libstdc++-v3/src/filesystem/Makefile.in
    trunk/libstdc++-v3/src/filesystem/dir-common.h
    trunk/libstdc++-v3/src/filesystem/dir.cc
    trunk/libstdc++-v3/src/filesystem/ops-common.h
    trunk/libstdc++-v3/src/filesystem/ops.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/86597.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/directory_entry/lwg3171.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/file_status/1.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/cons.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/filesystem_error/copy.cc
   
trunk/libstdc++-v3/testsuite/27_io/filesystem/iterators/directory_iterator.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/iterators/pop.cc
   
trunk/libstdc++-v3/testsuite/27_io/filesystem/iterators/recursive_directory_iterator.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/absolute.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/canonical.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/copy.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/copy_file.cc
   
trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/create_directories.cc
   
trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/create_directory.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/create_symlink.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/current_path.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/equivalent.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/exists.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/file_size.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/is_empty.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/last_write_time.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/permissions.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/proximate.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/read_symlink.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/relative.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/remove.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/remove_all.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/space.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/status.cc
    trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/symlink_status.cc
   
trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/temp_directory_path.cc
   
trunk/libstdc++-v3/testsuite/27_io/filesystem/operations/weakly_canonical.cc

Reply via email to