On Thu, May 12, 2022 at 11:23 AM Sören Tempel via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> The off64_t type is used for defining Offset_t:
>
>         
> https://github.com/golang/gofrontend/blob/4bdff733a0c2a9ddc3eff104b1be03df058a79c4/libgo/mksysinfo.sh#L406-L410
>
> On musl, _HAVE_OFF64_T is defined since autoconf doesn't mind it
> being defined as a macro but -fdump-go-spec does, hence you end up
> with the following compilation error (even with your patch applied):

Ah, thanks.


> Apart from off64_t stuff, there is only one minor issue (see below).
>
> > index 7e2b98ba6..487099a33 100644
> > --- a/libgo/configure.ac
> > +++ b/libgo/configure.ac
> > @@ -579,7 +579,7 @@ AC_C_BIGENDIAN
> > +
> > +CFLAGS_hold="$CFLAGS"
> > +CFLAGS="$OSCFLAGS $CFLAGS"
> >  AC_CHECK_TYPES([loff_t])
> > +CFLAGS="$CFLAGS_hold"
>
> The AC_CHECK_TYPES invocation is missing an include of fcntl.h (which
> defines loff_t in musl) and as such fails and causes libgo compilation
> to fail with "reference to undefined name '_libgo_loff_t_type'" as
> HAVE_LOFF_T is not defined. The invocation needs to be changed to:
>
>         AC_CHECK_TYPES([loff_t], [], [], [[#include <fcntl.h>]])
>
> and this needs to be adjusted accordingly in configure as well.

Hmmm, I added fcntl.h to AC_CHECK_HEADERS.  I thought that would be
enough to cause it to be included in future tests.  Perhaps not.

Ian

Reply via email to