https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100358
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:84aa7065deec49bab9fb0b085cd0a0dcc42cc479 commit r15-6454-g84aa7065deec49bab9fb0b085cd0a0dcc42cc479 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Sat Dec 21 23:42:28 2024 +1100 c++/modules: Fallback to ftruncate if posix_fallocate fails [PR115008] Depending on the libc and filesystem, in cases where posix_fallocate cannot do an efficient preallocation it may return EINVAL. In such a case we should fall back to ftruncate instead. Apparently, depending on the system the use of posix_fallocate can have a noticeable speedup over ftruncate in general (depending on the system) so it probably isn't worth it to use ftruncate in all cases. PR c++/100358 PR c++/115008 gcc/cp/ChangeLog: * module.cc (elf_out::create_mapping): Fallback to ftruncate if posix_fallocate fails. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>