Compile with large-file support (LFS)

This adds preprocessor defines for _LARGEFILE_SOURCE and
_FILE_OFFSET_BITS=64 and a few others, fixing a bug that was reported on
gitter. This prevents issues when running fish on 32 bit systems that
have filesystems with 64 bit inodes.
This commit is contained in:
ridiculousfish 2022-09-20 15:52:31 -07:00
parent 429534496a
commit ceafb65882
2 changed files with 7 additions and 0 deletions

View file

@ -76,6 +76,7 @@ Resolved in 3.6.0
- Fish calls external commands via the given path again instead of always making it absolute. This can be seen e.g. when you run a bash script and check ``$0`` (:issue:`9143`).
- ``printf`` no longer tries to interpret the first argument as an option (:issue:`9132`).
- ``string repeat`` no longer allocates the entire output at once, instead using chunks. This needs less memory and has less of a delay with long strings. Also it was possible to make fish crash by making it allocate more memory than the system had. (:issue:`9124`)
- On 32-bit systems, globs like ``*`` might fail to print certain files, due to missing large file support. This has been fixed by enabling large file support.
Completions
^^^^^^^^^^^

View file

@ -53,6 +53,12 @@ add_compile_options(-fno-exceptions)
# Undefine NDEBUG to keep assert() in release builds.
add_definitions(-UNDEBUG)
# Enable large files on GNU.
add_definitions(-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64
-D_ATFILE_SOURCE)
# Hide the CMake Rules directories in Xcode projects.
source_group("CMake Rules" REGULAR_EXPRESSION "^$")