hermit-os / hermit-playground

A playground to build C/C++/Go/Fortran applications on top of RustyHermit
https://hermitcore.org
Apache License 2.0
32 stars 13 forks source link

Fix Fortran support #29

Open CarlWachter opened 4 months ago

CarlWachter commented 4 months ago

Currently Fortran support is broken, due to an issue linking fcntl. This is due to the following implementation in gcc: https://github.com/hermit-os/gcc/blob/17f4b3f33eb235780db88692508c3bb13b3a32d0/libbacktrace/posix.c#L82C3-L82C8

mkroening commented 4 months ago

Why is this issue new?

Can't we undefine HAVE_FCNTL if that is a problem?

CarlWachter commented 4 months ago

It's related to the new kernel version. Set FD_CLOEXEC just in case the kernel does not support O_CLOEXEC, as far as i understand it O_CLOEXEC is now supported, as it is exported by cbindgen.

Can't we undefine HAVE_FCNTL if that is a problem? It is also used for a lot of other things, so removing it entirely may cause issues.

My suggestion would be to remove the previously referenced code and see if that solves it, but I don't have the time to deal with rebuilding the toolchain right now, so I'll just leave it for now.

mkroening commented 4 months ago

as far as i understand it O_CLOEXEC is now supported, as it is exported by cbindgen.

It's only a stub, so there is no meaningful functionality behind it.

My suggestion would be to remove the previously referenced code

Why not solve the linking issue instead, so the kernel stub gets called?