fatal error: ffi.h: No such file or directory despite libffi being enabled

Andrew Haley aph@redhat.com
Mon May 16 12:01:24 GMT 2022


On 5/16/22 02:06, Zopolis0 via Gcc-help wrote:
> While attempting to compile gcj on my mster branch (
> https://github.com/Zopolis4/gcj/tree/mster) , the compilation fails because
> several files within libjava are unable to include ffi.h because they
> cannot find it.
> In file included from ../../../../gcj/libjava/defineclass.cc:24:
> ../../../../gcj/libjava/include/java-interp.h:40:10: fatal error: ffi.h: No
> such file or directory
>     40 | #include <ffi.h>
>        |          ^~~~~~~
> This is despite, as far as I can tell, the compilation of libffi being
> enabled as part of libjava in makefile.def.

We only ever built libjava as part of a whole-GCC build. The libjava
directory isn't intended to be built on its own. Please build the whole
GCC tree using the top-level makefile and it'll work, then you can
extract whatever built pieces you need.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Gcc-help mailing list