bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #57676] openjdk11 fails to build with make 4.3


From: Nitish Naik
Subject: [bug #57676] openjdk11 fails to build with make 4.3
Date: Mon, 21 Aug 2023 07:34:45 -0400 (EDT)

Follow-up Comment #13, bug #57676 (project make):

[comment #11 comment #11:]
> Dmitry,
> 
> [comment #9 comment #9:]
> > make should not claim "cannot make the included makefile" having
successfully read the makefile.
> > Here is a patch which fixes the issue.
> 
> I applied the patch to the source tree of make-4.3, and it does fix the
issue. I also tested the test-case:
> 
> 694 Tests in 125 Categories Complete ... No Failures :-)
> 
> Tested-by: Yann E. MORIN <yann.morin.1998@free.fr>
> 
> Thank you for the patch! :-)
> 
> Regards,
> Yann E. MORIN.
> 
> > regards, Dmitry
> > 
> > 
> > diff --git a/src/makeint.h b/src/makeint.h
> > index c428a36..327849b 100644
> > --- a/src/makeint.h
> > +++ b/src/makeint.h
> > @@ -566,6 +566,8 @@ void print_dir_data_base (void);
> >  void dir_setup_glob (glob_t *);
> >  void hash_init_directories (void);
> >  
> > +FILE_TIMESTAMP name_mtime (const char *name);
> > +
> >  void define_default_variables (void);
> >  void undefine_default_variables (void);
> >  void set_default_suffixes (void);
> > diff --git a/src/read.c b/src/read.c
> > index db52a55..84e9f97 100644
> > --- a/src/read.c
> > +++ b/src/read.c
> > @@ -417,6 +417,10 @@ eval_makefile (const char *filename, unsigned short
flags)
> >  
> >    /* Success; clear errno.  */
> >    deps->error = 0;
> > +  /* Managed to read the file. Update mtime, if needed.
> > +     https://savannah.gnu.org/bugs/?57676.  */
> > +  if (deps->file->last_mtime == NONEXISTENT_MTIME)
> > +    deps->file->last_mtime = name_mtime(deps->file->name);
> >  
> >    /* Avoid leaking the makefile to children.  */
> >    fd_noinherit (fileno (ebuf.fp));
> > diff --git a/src/remake.c b/src/remake.c
> > index fb237c5..956ca4c 100644
> > --- a/src/remake.c
> > +++ b/src/remake.c
> > @@ -67,7 +67,6 @@ static enum update_status check_dep (struct file *file,
unsigned int depth,
> >                                       FILE_TIMESTAMP this_mtime, int
*must_make);
> >  static enum update_status touch_file (struct file *file);
> >  static void remake_file (struct file *file);
> > -static FILE_TIMESTAMP name_mtime (const char *name);
> >  static const char *library_search (const char *lib, FILE_TIMESTAMP
*mtime_ptr);
> >  
> >  
> > @@ -1462,7 +1461,7 @@ f_mtime (struct file *file, int search)
> >     This causes one duplicate stat() when -L is being used, but the code
is
> >     much cleaner.  */
> >  
> > -static FILE_TIMESTAMP
> > +FILE_TIMESTAMP
> >  name_mtime (const char *name)
> >  {
> >    FILE_TIMESTAMP mtime;
> > 

[comment #7 comment #7:]
> We also triggered this bug in Buildroot, where our Makefile does something
that can be reduced to this simple Makefile:
> 

> -include foo
> $(shell echo 'VAR?=$(VAR)' >foo)
> include foo
> 
> all:
>       @echo 'VAR="$(VAR)"'


> 
> which allows us to memorise variables passed by the user so they don't have
to pass them over and over again.
> 
> This has worked great since the make 3.81 era up till now, but make 4.3
broke that.
> 
> We wrote it thusly because we wanted to avoid rescanning the Makefile to
generate the file, as the Makefile is not clean to rescan (there are side
effects, unfortunately...).


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57676>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]