Skip to content

Commit

Permalink
Re-enable _LARGEFILE64_SOURCE when _GNU_SOURCE is defined
Browse files Browse the repository at this point in the history
When we updated to the latest version of musl it broke some codebases
that were using LFS functions (e.g. `stat64`) and assuming those
functions would be defined when `_GNU_SOURCE` is defined.

See bminor/musl@25e6fee

This change effectively reverts the above one by defining
_LARGEFILE64_SOURCE whenever _GNU_SOURCE is defined.

This is what glibc does:

https://github.com/lattera/glibc/blob/895ef79e04a953cac1493863bcae29ad85657ee1/include/features.h#L206
  • Loading branch information
sbc100 committed Aug 24, 2023
1 parent f433bc3 commit 318a3aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions system/lib/libc/musl/include/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
#define _XOPEN_SOURCE 700
#endif

#if defined(_GNU_SOURCE)
#undef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE 1
#endif

#if __STDC_VERSION__ >= 199901L
#define __restrict restrict
#elif !defined(__GNUC__)
Expand Down

0 comments on commit 318a3aa

Please sign in to comment.