[llvm] [LLVM][Cygwin] Define _GNU_SOURCE on Cygwin as well. (PR #138329)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri May 2 12:40:55 PDT 2025


mstorsjo wrote:

> @mstorsjo I'm not sure about the `_FILE_OFFSET_BITS` define - I don't see that Cygwin uses it to change the size of `off_t`, so I could add `LLVM_USING_GLIBC` to its `if`, but I also don't see how it would hurt anything, and 32-bit Cygwin is barely on life support at this point anyway.
> 
> (It's already unsupported upstream, I personally only plan to try to support it until Windows 10 end-of-support, and Git-for-Windows needs to support some tiny subset until 2029 IIRC. I'm sure llvm isn't part of that since it hasn't been usable up to now).

Yeah I don't have a very strong opinion either way. Theoretically, cygwin could start using it, but it's of course unlikely. Then again, it doesn't hurt keeping it like this either.

But perhaps we could split the if and just do the `_GNU_SOURCE` for cygwin anyway - that makes the intent clearer, so that future readers will see that we didn't expect `_FILE_OFFSET_BITS` to have any effect at the time and didn't need/intend for that to be defined.

https://github.com/llvm/llvm-project/pull/138329


More information about the llvm-commits mailing list