]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix build for systems without POSIX truncate
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jan 2019 12:38:51 +0000 (12:38 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 7 Jan 2019 12:38:51 +0000 (12:38 +0000)
commit3f304b2dcec8bf3fe157818145e01194f5714d9f
treee97aa3a3f62308d35f617bfdfd0d7cc819e035dd
parentdf2148cfe86b20c02f11fac377021a410f491780
Fix build for systems without POSIX truncate

Older versions of newlib do not provide truncate so add a configure
check for it, and provide a fallback definition.

There were also some missing exports in the linker script, which went
unnoticed because there are no tests for some functions. A new link-only
test checks that every filesystem operation function is defined by the
library.

* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for truncate.
* config.h.in: Regenerate.
* config/abi/pre/gnu.ver: Order patterns for filesystem operations
alphabetically and add missing entries for copy_symlink,
hard_link_count, rename, and resize_file.
* configure: Regenerate.
* src/c++17/fs_ops.cc (resize_file): Remove #if so posix::truncate is
used unconditionally.
* src/filesystem/ops-common.h (__gnu_posix::truncate)
[!_GLIBCXX_HAVE_TRUNCATE]: Provide fallback definition that only
supports truncating to zero length.
* testsuite/27_io/filesystem/operations/all.cc: New test.
* testsuite/27_io/filesystem/operations/resize_file.cc: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267647 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/config.h.in
libstdc++-v3/config/abi/pre/gnu.ver
libstdc++-v3/configure
libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/src/filesystem/ops-common.h
libstdc++-v3/testsuite/27_io/filesystem/operations/all.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/resize_file.cc [new file with mode: 0644]