On Fri, 28 Mar 2025, Jakub Jelinek wrote:

> On Fri, Mar 28, 2025 at 01:51:23PM +0100, Richard Biener wrote:
> > This adds gcc/cobol/parse.o to compare_exclusions and makes sure to
> > ignore errors when copying generated files, like it's done when
> > copying gengtype-lex.cc.
> > 
> > Bootstrapped on x86_64-unknown-linux-gnu.
> > 
> > OK?
> > 
> >     PR bootstrap/119513
> >     * configure.ac (compare_exclusions): Add gcc/cobol/parse\$(objext).
> >     * configure: Regenerated.
> > 
> > gcc/cobol/
> >     * Make-lang.in (cobol.srcextra): Use cp instead of ln, ignore
> >     errors.
> 
> IMHO sed would still be better, but because we don't do that for
> gengtype-lex.{l,cc} either, this is ok for now.
> 
> Looking at the gcc-14.2.0 tarball (which was rolled by me), I see
> /d/gcc-14.2.0/gcc-14.2.0
> paths (I use -d /d so that it is short where /d is just a symlink somewhere
> /else), the only place where
> /d/gcc-14.2.0/gcc-14.2.0
> appears in the tarball is 59x in gcc/gengtype-lex.cc
> all in
> #line NN "/d/gcc-14.2.0/gcc-14.2.0/gcc/gengtype-lex.l"
> So, changing that to
> #line NN "gengtype-lex.l"
> would be IMHO quite useful.
> For cobol/parse.cc perhaps go with
> #line NN "cobol/parse.y"
> and similarly for cobol/cdf.cc and cobol/scan.cc.
> 
> Maybe best to do that in the
> gcc.srcextra: gengtype-lex.cc
>       -cp -p $^ $(srcdir)
> and
> cobol.srcextra: cobol/parse.cc cobol/cdf.cc cobol/scan.cc
>       -cp -p $^ cobol/parse.h cobol/cdf.h $(srcdir)/cobol/
> rules?

Note I have not tried to figure where the different relative path
comes from since it is for libgcobol/exceptl.h.  There's

#include "../../libgcobol/exceptl.h"

in the generated sources, maybe we should use -I to pick up
libgcobol headers rather than using relative paths in the cobol/ sources.

> The relative or absolute paths from build directories to source directories
> perhaps make sense in the build directories, but certainly not in the source
> directories.

I've pushed the patch for now and will try generating a release
tarball again now.

Richard.

Reply via email to