public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* fatal error: ffi.h: No such file or directory despite libffi being enabled
@ 2022-05-16  1:06 Zopolis0
  2022-05-16 12:01 ` Andrew Haley
  2022-05-17  6:12 ` Zopolis0
  0 siblings, 2 replies; 6+ messages in thread
From: Zopolis0 @ 2022-05-16  1:06 UTC (permalink / raw)
  To: gcc-help

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal error: ffi.h: No such file or directory despite libffi being enabled
  2022-05-16  1:06 fatal error: ffi.h: No such file or directory despite libffi being enabled Zopolis0
@ 2022-05-16 12:01 ` Andrew Haley
  2022-05-17  6:12 ` Zopolis0
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2022-05-16 12:01 UTC (permalink / raw)
  To: gcc-help

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal error: ffi.h: No such file or directory despite libffi being enabled
  2022-05-16  1:06 fatal error: ffi.h: No such file or directory despite libffi being enabled Zopolis0
  2022-05-16 12:01 ` Andrew Haley
@ 2022-05-17  6:12 ` Zopolis0
  2022-05-17  8:27   ` Andrew Haley
  2022-05-17 12:29   ` Zopolis0
  1 sibling, 2 replies; 6+ messages in thread
From: Zopolis0 @ 2022-05-17  6:12 UTC (permalink / raw)
  To: gcc-help

That's what I was doing, with --enable-languages=java.

On Mon, May 16, 2022 at 11:06 AM Zopolis0 <creatorsmithmdt@gmail.com> 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.
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal error: ffi.h: No such file or directory despite libffi being enabled
  2022-05-17  6:12 ` Zopolis0
@ 2022-05-17  8:27   ` Andrew Haley
  2022-05-17 12:29   ` Zopolis0
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2022-05-17  8:27 UTC (permalink / raw)
  To: gcc-help

On 5/17/22 07:12, Zopolis0 via Gcc-help wrote:
> That's what I was doing, with --enable-languages=java.
> 
> On Mon, May 16, 2022 at 11:06 AM Zopolis0 <creatorsmithmdt@gmail.com> 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.

So look at the output of the compilation, look at the include paths in the
compile command that failed, and see what's wrong. We can't tell from this
tiny snippet.

-- 
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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal error: ffi.h: No such file or directory despite libffi being enabled
  2022-05-17  6:12 ` Zopolis0
  2022-05-17  8:27   ` Andrew Haley
@ 2022-05-17 12:29   ` Zopolis0
  2022-05-17 12:31     ` Zopolis0
  1 sibling, 1 reply; 6+ messages in thread
From: Zopolis0 @ 2022-05-17 12:29 UTC (permalink / raw)
  To: gcc-help

Alright so looking at the include paths passed to it via the command line,
it uses -I../../../../gcj/libjava/../libffi/include, which seems to be
correct from what I can tell, it's definitely the right path to libjava,
and looks to be the right path to libffi. However, in the build directory,
grepping for libffi only reveals results in documentation and makefiles,
and I cannot find any libffi directory. I presume this is because it is
compiling libjava before libffi for some reason? In the libffi include
directory there's no ffi.h, only a ffi.h.in, so it looks like it needs to
be generated first. Is there anywhere within the sources that sets what
order things are compiled in?

On Tue, May 17, 2022 at 4:12 PM Zopolis0 <creatorsmithmdt@gmail.com> wrote:

> That's what I was doing, with --enable-languages=java.
>
> On Mon, May 16, 2022 at 11:06 AM Zopolis0 <creatorsmithmdt@gmail.com>
> 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.
>>
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: fatal error: ffi.h: No such file or directory despite libffi being enabled
  2022-05-17 12:29   ` Zopolis0
@ 2022-05-17 12:31     ` Zopolis0
  0 siblings, 0 replies; 6+ messages in thread
From: Zopolis0 @ 2022-05-17 12:31 UTC (permalink / raw)
  To: gcc-help

Ah. On further inspection, the reason libffi is not compiled is most likely
because it is disabled in the initial configure:

*** This configuration is not supported in the following subdirectories:
     gnattools gotools target-libada target-libphobos target-zlib
target-libbacktrace target-libgfortran target-libgo target-libffi
target-libobjc target-liboffloadmic
    (Any other directories should still work fine.)

On Tue, May 17, 2022 at 10:29 PM Zopolis0 <creatorsmithmdt@gmail.com> wrote:

> Alright so looking at the include paths passed to it via the command line,
> it uses -I../../../../gcj/libjava/../libffi/include, which seems to be
> correct from what I can tell, it's definitely the right path to libjava,
> and looks to be the right path to libffi. However, in the build directory,
> grepping for libffi only reveals results in documentation and makefiles,
> and I cannot find any libffi directory. I presume this is because it is
> compiling libjava before libffi for some reason? In the libffi include
> directory there's no ffi.h, only a ffi.h.in, so it looks like it needs to
> be generated first. Is there anywhere within the sources that sets what
> order things are compiled in?
>
> On Tue, May 17, 2022 at 4:12 PM Zopolis0 <creatorsmithmdt@gmail.com>
> wrote:
>
>> That's what I was doing, with --enable-languages=java.
>>
>> On Mon, May 16, 2022 at 11:06 AM Zopolis0 <creatorsmithmdt@gmail.com>
>> 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.
>>>
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-17 12:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16  1:06 fatal error: ffi.h: No such file or directory despite libffi being enabled Zopolis0
2022-05-16 12:01 ` Andrew Haley
2022-05-17  6:12 ` Zopolis0
2022-05-17  8:27   ` Andrew Haley
2022-05-17 12:29   ` Zopolis0
2022-05-17 12:31     ` Zopolis0

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).