aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2018-06-29 23:49:28 -0300
committerAlexandre Oliva <aoliva@redhat.com>2018-06-29 23:49:28 -0300
commit4119873a48042e532f7485b84cca83ea0bf1fcf6 (patch)
tree13d14ab0677255e09c2eada6b1f71015481cf965 /configure.ac
parentc0867626d277101afcead91e94f20cbe89a3aced (diff)
downloadgdb-4119873a48042e532f7485b84cca83ea0bf1fcf6.zip
gdb-4119873a48042e532f7485b84cca83ea0bf1fcf6.tar.gz
gdb-4119873a48042e532f7485b84cca83ea0bf1fcf6.tar.bz2
Introduce @unless/@endunless and postbootstrap Makefile targets
This patch turns dependencies of non-bootstrap targets on bootstrap targets for bootstrap builds into dependencies on stage_last. This arrangement gets stage1-bubble to run from stage_last if we haven't started a bootstrap yet, and to use the current stage otherwise. This was already the case of target libs, just not of non-bootstrapped host modules. In order to retain preexisting dependencies in non-bootstrap builds, or in gcc-less builds, this introduces support for @unless/@endunless pairs in Makefile.in. There is a remaining possibility of problem if activating, in a tree configured for bootstrap, a parallel build of two or more modules, at least one bootstrapped and one not. In this case, make might decide to build stage_current and stage_last in parallel, the latter will start a submake to build stage1 while the initial make, having satisfied stage_current, proceeds to build the bootstrapped module in non-bootstrapped configurations. The two builds will overlap and will likely conflict. This situation does NOT arise in normal settings, however: a post-bootstrap build of all-host all-target will indeed activate such targets concurrently, but only after building all bootstrapped modules successfully, and it will have both stage_last and stage_current targets already satisfied, so the potential race between builds will not arise. Another remaining problem, that is slightly expanded with this patch, is that of an interrupted build in a tree configured for bootstrap, continued with a non-bootstrapped target. Target modules that were not bootstrapped would already fail to complete the current stage when activated explicitly in the command line for a retry; host modules, however, would attempt to build their bootstrapped dependencies, which is what led to the problem of concurrent builds addressed with this patch. An interrupted or failed build might still recover correctly, if the non-bootstrapped target is activated in both builds, because then make will remove stage_last when its build command is interrupted, so that it will attempt to recreate it with stage1-bubble in the second try. A bootstrap build, however, will not be attempting to build stage_last, so the file will remain and the retry won't go through stage1-bubble. We have lived with that for target modules, so we can probably live with that for host modules too. Another undesirable consequence of this change is that non-boostrapped host modules, in a tree configured for bootstrap, when activated as make all-<module>, will build all of stage1 instead of only the module's usual dependencies. This is intentional and necessary to fix the parallel-build problem. If it's not desirable, disabling the unnecessary bootstrap configuration will suffice to restore the original set of dependencies. for ChangeLog * configure.ac: Introduce support for @unless/@endunless. * Makefile.tpl (dep-kind): Rewrite with cond; return postbootstrap in some cases. (make-postboot-dep, postboot-targets): New. (dependencies): Do not output postbootstrap dependencies at first. Output non-target ones changed for configure to depend on stage_last @if gcc-bootstrap, and the original deps @unless gcc-bootstrap. * configure.in, Makefile.in: Rebuilt.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 15 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index a638f69..99229d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2718,7 +2718,9 @@ INSTALL_GDB_TK=`echo ${GDB_TK} | sed s/-all-/-install-/g`
# extrasub-{build,host,target} not because there is any reason to split
# the substitutions up that way, but only to remain below the limit of
# 99 commands in a script, for HP-UX sed.
-# Do not nest @if/@endif pairs, because configure will not warn you at all.
+
+# Do not nest @if/@endif or @unless/@endunless pairs, because
+# configure will not warn you at all.
case "$enable_bootstrap:$ENABLE_GOLD: $configdirs :,$stage1_languages," in
yes:yes:*\ gold\ *:*,c++,*) ;;
@@ -2737,8 +2739,10 @@ for module in ${build_configdirs} ; do
extrasub_build="$extrasub_build
/^@if build-$module\$/d
/^@endif build-$module\$/d
+/^@unless build-$module\$/,/^@endunless build-$module\$/d
/^@if build-$module-$bootstrap_suffix\$/d
-/^@endif build-$module-$bootstrap_suffix\$/d"
+/^@endif build-$module-$bootstrap_suffix\$/d
+/^@unless build-$module-$bootstrap_suffix\$/,/^@endunless build-$module-$bootstrap_suffix\$/d"
done
extrasub_host=
for module in ${configdirs} ; do
@@ -2757,8 +2761,10 @@ for module in ${configdirs} ; do
extrasub_host="$extrasub_host
/^@if $module\$/d
/^@endif $module\$/d
+/^@unless $module\$/,/^@endunless $module\$/d
/^@if $module-$host_bootstrap_suffix\$/d
-/^@endif $module-$host_bootstrap_suffix\$/d"
+/^@endif $module-$host_bootstrap_suffix\$/d
+/^@unless $module-$host_bootstrap_suffix\$/,/^@endunless $module-$host_bootstrap_suffix\$/d"
done
extrasub_target=
for module in ${target_configdirs} ; do
@@ -2777,13 +2783,17 @@ for module in ${target_configdirs} ; do
extrasub_target="$extrasub_target
/^@if target-$module\$/d
/^@endif target-$module\$/d
+/^@unless target-$module\$/,/^@endunless target-$module\$/d
/^@if target-$module-$target_bootstrap_suffix\$/d
-/^@endif target-$module-$target_bootstrap_suffix\$/d"
+/^@endif target-$module-$target_bootstrap_suffix\$/d
+/^@unless target-$module-$target_bootstrap_suffix\$/,/^@endunless target-$module-$target_bootstrap_suffix\$/d"
done
# Do the final fixup along with target modules.
extrasub_target="$extrasub_target
-/^@if /,/^@endif /d"
+/^@if /,/^@endif /d
+/^@unless /d
+/^@endunless /d"
# Create the serialization dependencies. This uses a temporary file.