Closed tornaria closed 2 years ago
I take the oportunity to also note: a different workaround would be to use -D_GNU_SOURCE as a compile option
This is, IMO, the preferred option. It'd even be okay to set this in packaging scripts and for this project to not care about it at all.
The only issue is that you'd need to somehow solve the fdiv
conflict. Is the function exported to external users? If it's only internal, changing the name should hopefully be simple to do :)
Otherwise, we can explore better ways to avoid the conflict, though I should note that sharing a name with a function provided by libc (or well, libm in this case) can lead to weird issues in some edge cases.
It says it's a static function, imo the best thing would be renaming it, then.
Thanks!
In order to use cpu_set_t it is necessary to
#define _GNU_SOURCE
before includingsched.h
(in flint).However, in musl libc
sched.h
will be included frompthread.h
. This means by the time flint headers get to includesched.h
, it has already been included frompthread.h
so it won't work.The fix is easy: include flint headers before
#include <pthread.h>
. This is what this PR does.This together with wbhart/flint2#988 fixes the issue.
I take the oportunity to also note: a different workaround would be to use
-D_GNU_SOURCE
as a compile option. This actually causes a different issue: it turns out defining_GNU_SOURCE
before includingmath.h
makes the latter define a functionfdiv()
which then causes a conflict with a static function used inacb_elliptic/rj.c
. It might be wise to choose a different name for that function.