diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -243,7 +243,6 @@ check_symbol_exists(isatty unistd.h HAVE_ISATTY) check_symbol_exists(futimens sys/stat.h HAVE_FUTIMENS) check_symbol_exists(futimes sys/time.h HAVE_FUTIMES) -check_symbol_exists(posix_fallocate fcntl.h HAVE_POSIX_FALLOCATE) # AddressSanitizer conflicts with lib/Support/Unix/Signals.inc # Avoid sigaltstack on Apple platforms, where backtrace() cannot handle it # (rdar://7089625) and _Unwind_Backtrace is unusable because it cannot unwind diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -152,9 +152,6 @@ /* Define to 1 if you have the `malloc_zone_statistics' function. */ #cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS} -/* Define to 1 if you have the `posix_fallocate' function. */ -#cmakedefine HAVE_POSIX_FALLOCATE ${HAVE_POSIX_FALLOCATE} - /* Define to 1 if you have the `posix_spawn' function. */ #cmakedefine HAVE_POSIX_SPAWN ${HAVE_POSIX_SPAWN} diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -590,19 +590,6 @@ } std::error_code resize_file(int FD, uint64_t Size) { -#if defined(HAVE_POSIX_FALLOCATE) - // If we have posix_fallocate use it. Unlike ftruncate it always allocates - // space, so we get an error if the disk is full. - if (int Err = ::posix_fallocate(FD, 0, Size)) { -#ifdef _AIX - constexpr int NotSupportedError = ENOTSUP; -#else - constexpr int NotSupportedError = EOPNOTSUPP; -#endif - if (Err != EINVAL && Err != NotSupportedError) - return std::error_code(Err, std::generic_category()); - } -#endif // Use ftruncate as a fallback. It may or may not allocate space. At least on // OS X with HFS+ it does. if (::ftruncate(FD, Size) == -1) diff --git a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn --- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn +++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn @@ -143,7 +143,6 @@ "HAVE_LINK_H=1", "HAVE_LSEEK64=1", "HAVE_MALLINFO=1", - "HAVE_POSIX_FALLOCATE=1", "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", ] } else { @@ -152,7 +151,6 @@ "HAVE_LINK_H=", "HAVE_LSEEK64=", "HAVE_MALLINFO=", - "HAVE_POSIX_FALLOCATE=", "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=", ] } diff --git a/utils/bazel/llvm-project-overlay/llvm/config.bzl b/utils/bazel/llvm-project-overlay/llvm/config.bzl --- a/utils/bazel/llvm-project-overlay/llvm/config.bzl +++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl @@ -43,7 +43,6 @@ "HAVE_LINK_H=1", "HAVE_LSEEK64=1", "HAVE_MALLINFO=1", - "HAVE_POSIX_FALLOCATE=1", "HAVE_SBRK=1", "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", ] diff --git a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h --- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h +++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h @@ -165,9 +165,6 @@ /* Define to 1 if you have the `malloc_zone_statistics' function. */ /* HAVE_MALLOC_ZONE_STATISTICS defined in Bazel */ -/* Define to 1 if you have the `posix_fallocate' function. */ -/* HAVE_POSIX_FALLOCATE defined in Bazel */ - /* Define to 1 if you have the `posix_spawn' function. */ #define HAVE_POSIX_SPAWN 1 diff --git a/utils/bazel/llvm_configs/config.h.cmake b/utils/bazel/llvm_configs/config.h.cmake --- a/utils/bazel/llvm_configs/config.h.cmake +++ b/utils/bazel/llvm_configs/config.h.cmake @@ -152,9 +152,6 @@ /* Define to 1 if you have the `malloc_zone_statistics' function. */ #cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS} -/* Define to 1 if you have the `posix_fallocate' function. */ -#cmakedefine HAVE_POSIX_FALLOCATE ${HAVE_POSIX_FALLOCATE} - /* Define to 1 if you have the `posix_spawn' function. */ #cmakedefine HAVE_POSIX_SPAWN ${HAVE_POSIX_SPAWN}