Bug 43171 - build: target modules Makefiles have broken rebuild rules (multilib issue)
Summary: build: target modules Makefiles have broken rebuild rules (multilib issue)
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.5.0
: P4 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2010-02-24 22:07 UTC by Ralf Wildenhues
Modified: 2023-12-26 21:03 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2010-02-24 22:08:31


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Wildenhues 2010-02-24 22:07:47 UTC
This PR mainly exists as a reminder for myself, I have been bitten by
this a couple of times while testing an unrelated patch and getting
stumped by apparent major breakage.

Inside the build tree, for each $module and $MULTIDIR, the files
$target/$module/Makefile and probably also
$target/$MULTIDIR/$module/Makefile have broken rules for the 'Makefile'
target: when run, these rules just run './config.status Makefile',
whereas the right thing to do would be to also run the
'./config.status default-1' config commands.

FWIW, this is not important for a normal bootstrap, only for an
incremental rebuild in which the respective Makefile.in file has been
updated.  IOW, in practice it can only happen with
--enable-maintainer-mode or after a './contrib/gcc_update' which
happened to update the Makefile.in files but not the respective
configure files.

To reproduce: in an up to date build tree with --enable-multilib, do
  touch $srcdir/libgomp/Makefile.in
  make

and observe $target/libgomp/Makefile differences.  Fix by
  rm -f $target/*/Makefile
  make

I intend to eventually fix this, but it is low priority.
Comment 1 Eric Gallager 2014-12-22 21:23:02 UTC
(In reply to Ralf Wildenhues from comment #0)
> Inside the build tree, for each $module and $MULTIDIR, the files
> $target/$module/Makefile and probably also
> $target/$MULTIDIR/$module/Makefile have broken rules for the 'Makefile'
> target: when run, these rules just run './config.status Makefile',
> whereas the right thing to do would be to also run the
> './config.status default-1' config commands.

For modules that use automake, the rules that automake generates for the 'Makefile' target look like this:

.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
	@case '$?' in \
	  *config.status*) \
	    echo ' $(SHELL) ./config.status'; \
	    $(SHELL) ./config.status;; \
	  *) \
	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
	esac;

Checking 'am__depfiles_maybe', it seems that automake sets it empty by default, so maybe 'default-1' needs to be added to 'am__depfiles_maybe' in the Makefile.am of any module that uses automake? 

(or whatever 'default-1' is called, that is; in my tree, I renamed the corresponding AC_CONFIG_COMMANDS argument in config/multi.m4 to say 'multilib-default-1' instead, as I find that more descriptive, but that would be a separate topic...)