Open siteshwar opened 6 years ago
For the reference, test case should be pretty simple:
> cat test.c
#include <fts.h>
int main() {
}
> cc -D_FILE_OFFSET_BITS=64 test.c
In file included from test.c:1:0:
/usr/include/fts.h:41:3: error: #error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
#include <fts.h>
int main() {
}
See also: https://github.com/mesonbuild/meson/issues/3049. Unconditionally enabling this is broken on some platforms (Raspbian armhf) and hilariously broken on other platforms (Android 32-bit).
We do want to fix this properly, but no one has come along who is willing to investigate the edge cases involved. Would you like to work on this?
@nirbheek Is there a way to turn off this flag in builds ? If I am reading the docs correctly, it can not be turned off, so it should not be added to builds by default. I might look at it in my free time, but can not promise a fix at the moment.
@nirbheek Is there a way to turn off this flag in builds ?
Yes, if you pass -U_FILE_OFFSET_BITS
in add_project_arguments()
(or on the specific target with c_args:
) that should do it.
@nirbheek Thanks for the quick fix.
Notes:
Bumping this, it bit my ass when converting a program from a different build system to meson. I think there should be a toggle at least - no other build system enforces it like that.
Copying my comment from #1455.
Support for 64-bit operations in fts functions was added only a few years ago in glibc through this commit and there are systems that still ship older versions glibc (for e.g. opensuse). Unconditionally enabling this macro on all systems will cause compilation failures. There should be a feature test before this macro is enabled.