On Mon, 22 Jul 2019 21:44:06 +0100, Stuart Henderson wrote:
> On 2019/07/22 22:05, Christian Weisgerber wrote:
> > Mark Patruck:
> > 
> > > lang/gcc always fails with the following error on amd64 -current (~6 
> > > hours old)
> > > 
> > > ------------------------
> > > Check for missing set procedures in body
> > >      OK
> > > 
> > > All tests completed successfully, no errors detected
> > > 
> > > raised ADA.IO_EXCEPTIONS.USE_ERROR : sinfo.h: No such file or directory
> > 
> > The problem is in libgnat and triggered by the recent change to
> > make realpath() POSIX-ly correct.
> > 
> > In libgnat/s-fileio.adb, the System.File_IO Open function calls
> > full_name() on all pathnames, including when creating files that
> > don't exist yet.
> > 
> > full_name() maps to __gnat_full_name().
> > 
> > In cstreams.c, __gnat_full_name() calls realpath().
> > 
> > Upstream doesn't notice because...
> > 
> >   /* Use realpath function which resolves links and references to . and ..
> >      on those Unix systems that support it. Note that GNU/Linux provides it 
> > but
> >      cannot handle more than 5 symbolic links in a full name, so we use the
> >      getcwd approach instead. */
> > 
> > ... Linux uses a different code path.
> > 
> > The trivial patch below makes us use that same codepath.  Unfortunately,
> > it also requires building a new adastrap (on a system without the
> > realpath change).
> > 
> > With the new adastrap, gcc/8 will then build fine on -current.
> 
> BTW I am building a new adastrap with this on i386. Will also need
> hppa/mips64/macppc.

I still have these machines before the realpath switch, I can do those.

> It might be worth adding a comment to the Makefile explaining what's
> needed in case someone wants to work on updating arches currently
> stuck with adastrap from old GCC versions later (building on 6.5
> will be easiest, I guess)
> 
> > RCS file: patches/patch-gcc_ada_cstreams_c
> > diff -N patches/patch-gcc_ada_cstreams_c
> > --- /dev/null       1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-gcc_ada_cstreams_c        22 Jul 2019 19:58:35 -0000
> > @@ -0,0 +1,17 @@
> > +$OpenBSD$
> > +
> > +System.File_IO.Open calls full_name() for Create.  Use getcwd() approach
> > +instead of realpath() since the latter fails if the file doesn't exist.
> > +
> > +Index: gcc/ada/cstreams.c
> > +--- gcc/ada/cstreams.c.orig
> > ++++ gcc/ada/cstreams.c
> > +@@ -190,7 +190,7 @@ __gnat_full_name (char *nam, char *buffer)
> > +     *p = '\\';
> > +     }
> > + 
> > +-#elif defined (__FreeBSD__) || defined (__DragonFly__) || defined 
> > (__OpenBSD__)
> > ++#elif defined (__FreeBSD__) || defined (__DragonFly__)
> > + 
> > +   /* Use realpath function which resolves links and references to . and ..
> > +      on those Unix systems that support it. Note that GNU/Linux provides 
> > it but
> > -- 
> > Christian "naddy" Weisgerber                          na...@mips.inka.de
> > 

Reply via email to