public inbox for gcc-regression@sourceware.org
help / color / mirror / Atom feed
* [TCWG CI] Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library
@ 2022-11-12 11:19 ci_notify
  0 siblings, 0 replies; 3+ messages in thread
From: ci_notify @ 2022-11-12 11:19 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-regression

[-- Attachment #1: Type: text/plain, Size: 14264 bytes --]

Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library:

Results changed to
-10
# true:
0
# build_abe binutils:
1
# build_abe bootstrap_O1:
# FAILED
# First few build errors in logs:
# 00:05:11 make[3]: [Makefile:1815: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:05:11 make[3]: [Makefile:1816: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:21:49 make[3]: [Makefile:1815: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:21:49 make[3]: [Makefile:1816: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:30:52 make[3]: [Makefile:1815: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:30:52 make[3]: [Makefile:1816: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:36:24 make[3]: [Makefile:100: man] Error 127 (ignored)
# 00:36:43 make[5]: *** [Makefile:1145: install-debug] Error 2
# 00:36:43 make[4]: *** [Makefile:888: install-am] Error 2
# 00:36:43 make[3]: *** [Makefile:783: install-recursive] Error 1

from
-10
# true:
0
# build_abe binutils:
1
# build_abe bootstrap_O1:
2

THIS IS THE END OF INTERESTING STUFF.  BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.

For latest status see comments in https://linaro.atlassian.net/browse/GNU-692 .
Status of basepoints/gcc-13-3918-gba7551485bc commit for tcwg_gcc_bootstrap:
commit ba7551485bc5760371462517ec05bc6ba20b3b35
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 23:00:49 2022 +0000

    libstdc++: Simplify build targets for debug library
    
    This rewrites the stamp-debug and build-debug targets in src/Makefile so
    that each generated Makefile in the debug/$(SUBDIRS) directories is a
    make target, instead of being created by a loop in the stamp-debug
    recipe. The final adjustments to debug/Makefile are done as part of the
    stamp-debug target instead of the build-debug target.
    
    The advantage is that each $(SUBDIRS)/debug/Makefile now has the
    corresponding $(SUBDIRS)/Makefile as a prerequisite, so they will be
    regenerated if needed. Generating those can also be parallelized by
    make, although those steps are very fast so that doesn't really matter.
    
    This also removes the duplication in the stamp-debug recipe, which was
    using exactly the same sed command for debug/Makefile and each
    debug/$(SUBDIRS)/Makefile. That is done by adding "." to the list of
    subdirectories to process. The recipes can also be simplified to use
    separate shell commands per line, instead of using backslashes to join
    the whole recipe into a single shell command.
    
    Also replace 'echo `date` > stamp-xxx' with just 'date > stamp-xxx'
    which is equivalent but simpler.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am: Simplify debug build targets.
            * src/Makefile.in: Regenerate.
* master-aarch64-bootstrap_O1
** Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library:
** https://ci.linaro.org/job/tcwg_gcc_bootstrap-build-master-aarch64-bootstrap_O1/494/

Bad  build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-build-master-aarch64-bootstrap_O1/494/artifact/artifacts
Good build: https://ci.linaro.org/job/tcwg_gcc_bootstrap-build-master-aarch64-bootstrap_O1/493/artifact/artifacts

Reproduce current build:
<cut>
mkdir -p investigate-gcc-ba7551485bc5760371462517ec05bc6ba20b3b35
cd investigate-gcc-ba7551485bc5760371462517ec05bc6ba20b3b35

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests for bad and good builds
mkdir -p bad/artifacts good/artifacts
curl -o bad/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-build-master-aarch64-bootstrap_O1/494/artifact/artifacts/manifest.sh --fail
curl -o good/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_gcc_bootstrap-build-master-aarch64-bootstrap_O1/493/artifact/artifacts/manifest.sh --fail

# Reproduce bad build
(cd bad; ../jenkins-scripts/tcwg_gnu-build.sh ^^ true %%rr[top_artifacts] artifacts)
# Reproduce good build
(cd good; ../jenkins-scripts/tcwg_gnu-build.sh ^^ true %%rr[top_artifacts] artifacts)
</cut>

Full commit (up to 1000 lines):
<cut>
commit ba7551485bc5760371462517ec05bc6ba20b3b35
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 23:00:49 2022 +0000

    libstdc++: Simplify build targets for debug library
    
    This rewrites the stamp-debug and build-debug targets in src/Makefile so
    that each generated Makefile in the debug/$(SUBDIRS) directories is a
    make target, instead of being created by a loop in the stamp-debug
    recipe. The final adjustments to debug/Makefile are done as part of the
    stamp-debug target instead of the build-debug target.
    
    The advantage is that each $(SUBDIRS)/debug/Makefile now has the
    corresponding $(SUBDIRS)/Makefile as a prerequisite, so they will be
    regenerated if needed. Generating those can also be parallelized by
    make, although those steps are very fast so that doesn't really matter.
    
    This also removes the duplication in the stamp-debug recipe, which was
    using exactly the same sed command for debug/Makefile and each
    debug/$(SUBDIRS)/Makefile. That is done by adding "." to the list of
    subdirectories to process. The recipes can also be simplified to use
    separate shell commands per line, instead of using backslashes to join
    the whole recipe into a single shell command.
    
    Also replace 'echo `date` > stamp-xxx' with just 'date > stamp-xxx'
    which is equivalent but simpler.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am: Simplify debug build targets.
            * src/Makefile.in: Regenerate.
---
 libstdc++-v3/src/Makefile.am | 65 +++++++++++++++++-----------------------
 libstdc++-v3/src/Makefile.in | 70 ++++++++++++++++++--------------------------
 2 files changed, 56 insertions(+), 79 deletions(-)

diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index b83c222d51d..b545ebf0dcf 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -30,10 +30,8 @@ endif
 
 if ENABLE_BACKTRACE
 backtrace_dir = libbacktrace
-backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 else
 backtrace_dir =
-backtrace_supported_h =
 endif
 
 ## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
@@ -370,7 +368,7 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	if test ! -f .libs/libstdc++.a; then \
 	  cp .libs/libstdc++convenience.a .libs/libstdc++.a; \
 	fi; \
-	echo `date` > stamp-libstdc++convenience;
+	date > stamp-libstdc++convenience;
 
 # Added rules.
 # 1 debug library
@@ -386,50 +384,41 @@ CLEAN_DEBUG =
 endif
 
 # Build a debug variant.
+
 # Take care to fix all possibly-relative paths.
-debugdir = ${glibcxx_builddir}/src/debug
-stamp-debug: Makefile $(foreach dir,$(SUBDIRS),$(dir)/Makefile)
-	if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \
-	  mkdir -p ${debugdir}; \
-	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$d; done; \
-	  (cd ${debugdir}; \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../Makefile > Makefile ; \
-	  for d in . $(SUBDIRS); do \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../$d/Makefile > $d/Makefile ; \
-	  done) ; \
-	fi; \
-	echo `date` > stamp-debug;
+debug/%/Makefile: %/Makefile
+	$(MKDIR_P) $(dir $@)
+	sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	    -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	    -e 's/srcdir = \.\./srcdir = ..\/../' \
+	    -e 's/VPATH = \.\./VPATH = ..\/../' \
+	    -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	    -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < $< > $@
+
+stamp-debug: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+	mv debug/Makefile debug/Makefile.tmp
+	sed -e 's,all-local: all-once,all-local:,' \
+	    -e 's,install-data-local: install-data-once,install-data-local:,' \
+	    -e '/vpath/!s,src/c,src/debug/c,' \
+	  < debug/Makefile.tmp > debug/Makefile
+	rm -f debug/Makefile.tmp
+	date > stamp-debug;
+
+.SECONDARY: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
 
 if ENABLE_BACKTRACE
-${debugdir}/$(backtrace_supported_h): $(backtrace_supported_h) stamp-debug
+backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
+debug_backtrace_supported_h = debug/$(backtrace_supported_h)
+$(debug_backtrace_supported_h): $(backtrace_supported_h) stamp-debug
 	cp $< $@
-debug_backtrace_supported_h = ${debugdir}/$(backtrace_supported_h)
 else
 debug_backtrace_supported_h =
 endif
 
 build-debug: stamp-debug $(debug_backtrace_supported_h)
-	  (cd ${debugdir}; \
-	  mv Makefile Makefile.tmp; \
-	  sed -e 's,all-local: all-once,all-local:,' \
-	      -e 's,install-data-local: install-data-once,install-data-local:,' \
-	      -e '/vpath/!s,src/c,src/debug/c,' \
-	  < Makefile.tmp > Makefile ; \
-	  rm -f Makefile.tmp ; \
-	  $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
-	  toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ;
+	  $(MAKE) -C debug CXXFLAGS='$(DEBUG_FLAGS)' \
+	    toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all
 
 # Install debug library.
 install-debug: build-debug
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 41a00f7b4ec..f54ee282fb0 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -485,8 +485,6 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS)
 @ENABLE_FILESYSTEM_TS_TRUE@filesystem_dir = filesystem
 @ENABLE_BACKTRACE_FALSE@backtrace_dir = 
 @ENABLE_BACKTRACE_TRUE@backtrace_dir = libbacktrace
-@ENABLE_BACKTRACE_FALSE@backtrace_supported_h = 
-@ENABLE_BACKTRACE_TRUE@backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 SUBDIRS = c++98 c++11 c++17 c++20 $(filesystem_dir) $(backtrace_dir)
 @VTV_CYGMIN_FALSE@toolexeclib_LTLIBRARIES = libstdc++.la
 
@@ -675,12 +673,9 @@ CXXLINK = \
 @GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_DEBUG = install-debug
 @GLIBCXX_BUILD_DEBUG_FALSE@CLEAN_DEBUG = 
 @GLIBCXX_BUILD_DEBUG_TRUE@CLEAN_DEBUG = debug
-
-# Build a debug variant.
-# Take care to fix all possibly-relative paths.
-debugdir = ${glibcxx_builddir}/src/debug
+@ENABLE_BACKTRACE_TRUE@backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 @ENABLE_BACKTRACE_FALSE@debug_backtrace_supported_h = 
-@ENABLE_BACKTRACE_TRUE@debug_backtrace_supported_h = ${debugdir}/$(backtrace_supported_h)
+@ENABLE_BACKTRACE_TRUE@debug_backtrace_supported_h = debug/$(backtrace_supported_h)
 all: all-recursive
 
 .SUFFIXES:
@@ -1113,44 +1108,37 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	if test ! -f .libs/libstdc++.a; then \
 	  cp .libs/libstdc++convenience.a .libs/libstdc++.a; \
 	fi; \
-	echo `date` > stamp-libstdc++convenience;
-stamp-debug: Makefile $(foreach dir,$(SUBDIRS),$(dir)/Makefile)
-	if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \
-	  mkdir -p ${debugdir}; \
-	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$d; done; \
-	  (cd ${debugdir}; \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../Makefile > Makefile ; \
-	  for d in . $(SUBDIRS); do \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../$d/Makefile > $d/Makefile ; \
-	  done) ; \
-	fi; \
-	echo `date` > stamp-debug;
+	date > stamp-libstdc++convenience;
+
+# Build a debug variant.
 
-@ENABLE_BACKTRACE_TRUE@${debugdir}/$(backtrace_supported_h): $(backtrace_supported_h) stamp-debug
+# Take care to fix all possibly-relative paths.
+debug/%/Makefile: %/Makefile
+	$(MKDIR_P) $(dir $@)
+	sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	    -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	    -e 's/srcdir = \.\./srcdir = ..\/../' \
+	    -e 's/VPATH = \.\./VPATH = ..\/../' \
+	    -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	    -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < $< > $@
+
+stamp-debug: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+	mv debug/Makefile debug/Makefile.tmp
+	sed -e 's,all-local: all-once,all-local:,' \
+	    -e 's,install-data-local: install-data-once,install-data-local:,' \
+	    -e '/vpath/!s,src/c,src/debug/c,' \
+	  < debug/Makefile.tmp > debug/Makefile
+	rm -f debug/Makefile.tmp
+	date > stamp-debug;
+
+.SECONDARY: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+@ENABLE_BACKTRACE_TRUE@$(debug_backtrace_supported_h): $(backtrace_supported_h) stamp-debug
 @ENABLE_BACKTRACE_TRUE@	cp $< $@
 
 build-debug: stamp-debug $(debug_backtrace_supported_h)
-	  (cd ${debugdir}; \
-	  mv Makefile Makefile.tmp; \
-	  sed -e 's,all-local: all-once,all-local:,' \
-	      -e 's,install-data-local: install-data-once,install-data-local:,' \
-	      -e '/vpath/!s,src/c,src/debug/c,' \
-	  < Makefile.tmp > Makefile ; \
-	  rm -f Makefile.tmp ; \
-	  $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
-	  toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ;
+	  $(MAKE) -C debug CXXFLAGS='$(DEBUG_FLAGS)' \
+	    toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all
 
 # Install debug library.
 install-debug: build-debug
</cut>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [TCWG CI] Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library
@ 2022-11-14  9:38 ci_notify
  0 siblings, 0 replies; 3+ messages in thread
From: ci_notify @ 2022-11-14  9:38 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-regression

[-- Attachment #1: Type: text/plain, Size: 14001 bytes --]

Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library:

Results changed to
-10
# true:
0
# build_abe binutils:
1
# build_abe stage1:
2
# build_abe linux:
3
# build_abe glibc:
4
# build_abe stage2:
# FAILED
# First few build errors in logs:
# 00:08:18 make[2]: [Makefile:1816: arm-linux-gnueabihf/bits/largefile-config.h] Error 1 (ignored)
# 00:14:36 make[3]: [Makefile:100: man] Error 127 (ignored)
# 00:15:11 make[5]: *** [Makefile:1145: install-debug] Error 2
# 00:15:11 make[4]: *** [Makefile:888: install-am] Error 2
# 00:15:11 make[3]: *** [Makefile:783: install-recursive] Error 1
# 00:15:11 make[2]: *** [Makefile:576: install-recursive] Error 1
# 00:15:11 make[1]: *** [Makefile:12180: install-target-libstdc++-v3] Error 2
# 00:15:11 make: *** [Makefile:2539: install] Error 2

from
-10
# true:
0
# build_abe binutils:
1
# build_abe stage1:
2
# build_abe linux:
3
# build_abe glibc:
4
# build_abe stage2:
5
# build_abe gdb:
6
# build_abe qemu:
7

THIS IS THE END OF INTERESTING STUFF.  BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.

For latest status see comments in https://linaro.atlassian.net/browse/GNU-692 .
Status of basepoints/gcc-13-3918-gba7551485bc commit for tcwg_gnu_cross_build:
commit ba7551485bc5760371462517ec05bc6ba20b3b35
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 23:00:49 2022 +0000

    libstdc++: Simplify build targets for debug library
    
    This rewrites the stamp-debug and build-debug targets in src/Makefile so
    that each generated Makefile in the debug/$(SUBDIRS) directories is a
    make target, instead of being created by a loop in the stamp-debug
    recipe. The final adjustments to debug/Makefile are done as part of the
    stamp-debug target instead of the build-debug target.
    
    The advantage is that each $(SUBDIRS)/debug/Makefile now has the
    corresponding $(SUBDIRS)/Makefile as a prerequisite, so they will be
    regenerated if needed. Generating those can also be parallelized by
    make, although those steps are very fast so that doesn't really matter.
    
    This also removes the duplication in the stamp-debug recipe, which was
    using exactly the same sed command for debug/Makefile and each
    debug/$(SUBDIRS)/Makefile. That is done by adding "." to the list of
    subdirectories to process. The recipes can also be simplified to use
    separate shell commands per line, instead of using backslashes to join
    the whole recipe into a single shell command.
    
    Also replace 'echo `date` > stamp-xxx' with just 'date > stamp-xxx'
    which is equivalent but simpler.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am: Simplify debug build targets.
            * src/Makefile.in: Regenerate.
* master-arm
** Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library:
** https://ci.linaro.org/job/tcwg_gnu_cross_build-build-master-arm/1854/

Bad  build: https://ci.linaro.org/job/tcwg_gnu_cross_build-build-master-arm/1854/artifact/artifacts
Good build: https://ci.linaro.org/job/tcwg_gnu_cross_build-build-master-arm/1853/artifact/artifacts

Reproduce current build:
<cut>
mkdir -p investigate-gcc-ba7551485bc5760371462517ec05bc6ba20b3b35
cd investigate-gcc-ba7551485bc5760371462517ec05bc6ba20b3b35

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests for bad and good builds
mkdir -p bad/artifacts good/artifacts
curl -o bad/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-build-master-arm/1854/artifact/artifacts/manifest.sh --fail
curl -o good/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-build-master-arm/1853/artifact/artifacts/manifest.sh --fail

# Reproduce bad build
(cd bad; ../jenkins-scripts/tcwg_gnu-build.sh ^^ true %%rr[top_artifacts] artifacts)
# Reproduce good build
(cd good; ../jenkins-scripts/tcwg_gnu-build.sh ^^ true %%rr[top_artifacts] artifacts)
</cut>

Full commit (up to 1000 lines):
<cut>
commit ba7551485bc5760371462517ec05bc6ba20b3b35
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 23:00:49 2022 +0000

    libstdc++: Simplify build targets for debug library
    
    This rewrites the stamp-debug and build-debug targets in src/Makefile so
    that each generated Makefile in the debug/$(SUBDIRS) directories is a
    make target, instead of being created by a loop in the stamp-debug
    recipe. The final adjustments to debug/Makefile are done as part of the
    stamp-debug target instead of the build-debug target.
    
    The advantage is that each $(SUBDIRS)/debug/Makefile now has the
    corresponding $(SUBDIRS)/Makefile as a prerequisite, so they will be
    regenerated if needed. Generating those can also be parallelized by
    make, although those steps are very fast so that doesn't really matter.
    
    This also removes the duplication in the stamp-debug recipe, which was
    using exactly the same sed command for debug/Makefile and each
    debug/$(SUBDIRS)/Makefile. That is done by adding "." to the list of
    subdirectories to process. The recipes can also be simplified to use
    separate shell commands per line, instead of using backslashes to join
    the whole recipe into a single shell command.
    
    Also replace 'echo `date` > stamp-xxx' with just 'date > stamp-xxx'
    which is equivalent but simpler.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am: Simplify debug build targets.
            * src/Makefile.in: Regenerate.
---
 libstdc++-v3/src/Makefile.am | 65 +++++++++++++++++-----------------------
 libstdc++-v3/src/Makefile.in | 70 ++++++++++++++++++--------------------------
 2 files changed, 56 insertions(+), 79 deletions(-)

diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index b83c222d51d..b545ebf0dcf 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -30,10 +30,8 @@ endif
 
 if ENABLE_BACKTRACE
 backtrace_dir = libbacktrace
-backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 else
 backtrace_dir =
-backtrace_supported_h =
 endif
 
 ## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
@@ -370,7 +368,7 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	if test ! -f .libs/libstdc++.a; then \
 	  cp .libs/libstdc++convenience.a .libs/libstdc++.a; \
 	fi; \
-	echo `date` > stamp-libstdc++convenience;
+	date > stamp-libstdc++convenience;
 
 # Added rules.
 # 1 debug library
@@ -386,50 +384,41 @@ CLEAN_DEBUG =
 endif
 
 # Build a debug variant.
+
 # Take care to fix all possibly-relative paths.
-debugdir = ${glibcxx_builddir}/src/debug
-stamp-debug: Makefile $(foreach dir,$(SUBDIRS),$(dir)/Makefile)
-	if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \
-	  mkdir -p ${debugdir}; \
-	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$d; done; \
-	  (cd ${debugdir}; \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../Makefile > Makefile ; \
-	  for d in . $(SUBDIRS); do \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../$d/Makefile > $d/Makefile ; \
-	  done) ; \
-	fi; \
-	echo `date` > stamp-debug;
+debug/%/Makefile: %/Makefile
+	$(MKDIR_P) $(dir $@)
+	sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	    -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	    -e 's/srcdir = \.\./srcdir = ..\/../' \
+	    -e 's/VPATH = \.\./VPATH = ..\/../' \
+	    -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	    -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < $< > $@
+
+stamp-debug: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+	mv debug/Makefile debug/Makefile.tmp
+	sed -e 's,all-local: all-once,all-local:,' \
+	    -e 's,install-data-local: install-data-once,install-data-local:,' \
+	    -e '/vpath/!s,src/c,src/debug/c,' \
+	  < debug/Makefile.tmp > debug/Makefile
+	rm -f debug/Makefile.tmp
+	date > stamp-debug;
+
+.SECONDARY: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
 
 if ENABLE_BACKTRACE
-${debugdir}/$(backtrace_supported_h): $(backtrace_supported_h) stamp-debug
+backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
+debug_backtrace_supported_h = debug/$(backtrace_supported_h)
+$(debug_backtrace_supported_h): $(backtrace_supported_h) stamp-debug
 	cp $< $@
-debug_backtrace_supported_h = ${debugdir}/$(backtrace_supported_h)
 else
 debug_backtrace_supported_h =
 endif
 
 build-debug: stamp-debug $(debug_backtrace_supported_h)
-	  (cd ${debugdir}; \
-	  mv Makefile Makefile.tmp; \
-	  sed -e 's,all-local: all-once,all-local:,' \
-	      -e 's,install-data-local: install-data-once,install-data-local:,' \
-	      -e '/vpath/!s,src/c,src/debug/c,' \
-	  < Makefile.tmp > Makefile ; \
-	  rm -f Makefile.tmp ; \
-	  $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
-	  toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ;
+	  $(MAKE) -C debug CXXFLAGS='$(DEBUG_FLAGS)' \
+	    toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all
 
 # Install debug library.
 install-debug: build-debug
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 41a00f7b4ec..f54ee282fb0 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -485,8 +485,6 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS)
 @ENABLE_FILESYSTEM_TS_TRUE@filesystem_dir = filesystem
 @ENABLE_BACKTRACE_FALSE@backtrace_dir = 
 @ENABLE_BACKTRACE_TRUE@backtrace_dir = libbacktrace
-@ENABLE_BACKTRACE_FALSE@backtrace_supported_h = 
-@ENABLE_BACKTRACE_TRUE@backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 SUBDIRS = c++98 c++11 c++17 c++20 $(filesystem_dir) $(backtrace_dir)
 @VTV_CYGMIN_FALSE@toolexeclib_LTLIBRARIES = libstdc++.la
 
@@ -675,12 +673,9 @@ CXXLINK = \
 @GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_DEBUG = install-debug
 @GLIBCXX_BUILD_DEBUG_FALSE@CLEAN_DEBUG = 
 @GLIBCXX_BUILD_DEBUG_TRUE@CLEAN_DEBUG = debug
-
-# Build a debug variant.
-# Take care to fix all possibly-relative paths.
-debugdir = ${glibcxx_builddir}/src/debug
+@ENABLE_BACKTRACE_TRUE@backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 @ENABLE_BACKTRACE_FALSE@debug_backtrace_supported_h = 
-@ENABLE_BACKTRACE_TRUE@debug_backtrace_supported_h = ${debugdir}/$(backtrace_supported_h)
+@ENABLE_BACKTRACE_TRUE@debug_backtrace_supported_h = debug/$(backtrace_supported_h)
 all: all-recursive
 
 .SUFFIXES:
@@ -1113,44 +1108,37 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	if test ! -f .libs/libstdc++.a; then \
 	  cp .libs/libstdc++convenience.a .libs/libstdc++.a; \
 	fi; \
-	echo `date` > stamp-libstdc++convenience;
-stamp-debug: Makefile $(foreach dir,$(SUBDIRS),$(dir)/Makefile)
-	if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \
-	  mkdir -p ${debugdir}; \
-	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$d; done; \
-	  (cd ${debugdir}; \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../Makefile > Makefile ; \
-	  for d in . $(SUBDIRS); do \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../$d/Makefile > $d/Makefile ; \
-	  done) ; \
-	fi; \
-	echo `date` > stamp-debug;
+	date > stamp-libstdc++convenience;
+
+# Build a debug variant.
 
-@ENABLE_BACKTRACE_TRUE@${debugdir}/$(backtrace_supported_h): $(backtrace_supported_h) stamp-debug
+# Take care to fix all possibly-relative paths.
+debug/%/Makefile: %/Makefile
+	$(MKDIR_P) $(dir $@)
+	sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	    -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	    -e 's/srcdir = \.\./srcdir = ..\/../' \
+	    -e 's/VPATH = \.\./VPATH = ..\/../' \
+	    -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	    -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < $< > $@
+
+stamp-debug: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+	mv debug/Makefile debug/Makefile.tmp
+	sed -e 's,all-local: all-once,all-local:,' \
+	    -e 's,install-data-local: install-data-once,install-data-local:,' \
+	    -e '/vpath/!s,src/c,src/debug/c,' \
+	  < debug/Makefile.tmp > debug/Makefile
+	rm -f debug/Makefile.tmp
+	date > stamp-debug;
+
+.SECONDARY: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+@ENABLE_BACKTRACE_TRUE@$(debug_backtrace_supported_h): $(backtrace_supported_h) stamp-debug
 @ENABLE_BACKTRACE_TRUE@	cp $< $@
 
 build-debug: stamp-debug $(debug_backtrace_supported_h)
-	  (cd ${debugdir}; \
-	  mv Makefile Makefile.tmp; \
-	  sed -e 's,all-local: all-once,all-local:,' \
-	      -e 's,install-data-local: install-data-once,install-data-local:,' \
-	      -e '/vpath/!s,src/c,src/debug/c,' \
-	  < Makefile.tmp > Makefile ; \
-	  rm -f Makefile.tmp ; \
-	  $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
-	  toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ;
+	  $(MAKE) -C debug CXXFLAGS='$(DEBUG_FLAGS)' \
+	    toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all
 
 # Install debug library.
 install-debug: build-debug
</cut>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [TCWG CI] Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library
@ 2022-11-12 15:42 ci_notify
  0 siblings, 0 replies; 3+ messages in thread
From: ci_notify @ 2022-11-12 15:42 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-regression

[-- Attachment #1: Type: text/plain, Size: 14084 bytes --]

Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library:

Results changed to
-10
# true:
0
# build_abe binutils:
1
# build_abe gcc:
# FAILED
# First few build errors in logs:
# 00:10:05 checking whether the target supports __atomic_fetch_add... make[2]: [Makefile:1815: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:10:05 make[2]: [Makefile:1816: aarch64-unknown-linux-gnu/bits/largefile-config.h] Error 1 (ignored)
# 00:15:18 make[3]: [Makefile:100: man] Error 127 (ignored)
# 00:15:52 make[5]: *** [Makefile:1145: install-debug] Error 2
# 00:15:52 make[4]: *** [Makefile:888: install-am] Error 2
# 00:15:52 make[3]: *** [Makefile:783: install-recursive] Error 1
# 00:15:52 make[2]: *** [Makefile:576: install-recursive] Error 1
# 00:15:52 make[1]: *** [Makefile:12180: install-target-libstdc++-v3] Error 2
# 00:15:52 make: *** [Makefile:2539: install] Error 2

from
-10
# true:
0
# build_abe binutils:
1
# build_abe gcc:
2
# build_abe linux:
4
# build_abe glibc:
5
# build_abe gdb:
6

THIS IS THE END OF INTERESTING STUFF.  BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.

For latest status see comments in https://linaro.atlassian.net/browse/GNU-692 .
Status of basepoints/gcc-13-3918-gba7551485bc commit for tcwg_gnu_native_build:
commit ba7551485bc5760371462517ec05bc6ba20b3b35
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 23:00:49 2022 +0000

    libstdc++: Simplify build targets for debug library
    
    This rewrites the stamp-debug and build-debug targets in src/Makefile so
    that each generated Makefile in the debug/$(SUBDIRS) directories is a
    make target, instead of being created by a loop in the stamp-debug
    recipe. The final adjustments to debug/Makefile are done as part of the
    stamp-debug target instead of the build-debug target.
    
    The advantage is that each $(SUBDIRS)/debug/Makefile now has the
    corresponding $(SUBDIRS)/Makefile as a prerequisite, so they will be
    regenerated if needed. Generating those can also be parallelized by
    make, although those steps are very fast so that doesn't really matter.
    
    This also removes the duplication in the stamp-debug recipe, which was
    using exactly the same sed command for debug/Makefile and each
    debug/$(SUBDIRS)/Makefile. That is done by adding "." to the list of
    subdirectories to process. The recipes can also be simplified to use
    separate shell commands per line, instead of using backslashes to join
    the whole recipe into a single shell command.
    
    Also replace 'echo `date` > stamp-xxx' with just 'date > stamp-xxx'
    which is equivalent but simpler.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am: Simplify debug build targets.
            * src/Makefile.in: Regenerate.
* master-aarch64
** Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library:
** https://ci.linaro.org/job/tcwg_gnu_native_build-build-master-aarch64/523/

Bad  build: https://ci.linaro.org/job/tcwg_gnu_native_build-build-master-aarch64/523/artifact/artifacts
Good build: https://ci.linaro.org/job/tcwg_gnu_native_build-build-master-aarch64/522/artifact/artifacts

Reproduce current build:
<cut>
mkdir -p investigate-gcc-ba7551485bc5760371462517ec05bc6ba20b3b35
cd investigate-gcc-ba7551485bc5760371462517ec05bc6ba20b3b35

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests for bad and good builds
mkdir -p bad/artifacts good/artifacts
curl -o bad/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_gnu_native_build-build-master-aarch64/523/artifact/artifacts/manifest.sh --fail
curl -o good/artifacts/manifest.sh https://ci.linaro.org/job/tcwg_gnu_native_build-build-master-aarch64/522/artifact/artifacts/manifest.sh --fail

# Reproduce bad build
(cd bad; ../jenkins-scripts/tcwg_gnu-build.sh ^^ true %%rr[top_artifacts] artifacts)
# Reproduce good build
(cd good; ../jenkins-scripts/tcwg_gnu-build.sh ^^ true %%rr[top_artifacts] artifacts)
</cut>

Full commit (up to 1000 lines):
<cut>
commit ba7551485bc5760371462517ec05bc6ba20b3b35
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 23:00:49 2022 +0000

    libstdc++: Simplify build targets for debug library
    
    This rewrites the stamp-debug and build-debug targets in src/Makefile so
    that each generated Makefile in the debug/$(SUBDIRS) directories is a
    make target, instead of being created by a loop in the stamp-debug
    recipe. The final adjustments to debug/Makefile are done as part of the
    stamp-debug target instead of the build-debug target.
    
    The advantage is that each $(SUBDIRS)/debug/Makefile now has the
    corresponding $(SUBDIRS)/Makefile as a prerequisite, so they will be
    regenerated if needed. Generating those can also be parallelized by
    make, although those steps are very fast so that doesn't really matter.
    
    This also removes the duplication in the stamp-debug recipe, which was
    using exactly the same sed command for debug/Makefile and each
    debug/$(SUBDIRS)/Makefile. That is done by adding "." to the list of
    subdirectories to process. The recipes can also be simplified to use
    separate shell commands per line, instead of using backslashes to join
    the whole recipe into a single shell command.
    
    Also replace 'echo `date` > stamp-xxx' with just 'date > stamp-xxx'
    which is equivalent but simpler.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am: Simplify debug build targets.
            * src/Makefile.in: Regenerate.
---
 libstdc++-v3/src/Makefile.am | 65 +++++++++++++++++-----------------------
 libstdc++-v3/src/Makefile.in | 70 ++++++++++++++++++--------------------------
 2 files changed, 56 insertions(+), 79 deletions(-)

diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index b83c222d51d..b545ebf0dcf 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -30,10 +30,8 @@ endif
 
 if ENABLE_BACKTRACE
 backtrace_dir = libbacktrace
-backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 else
 backtrace_dir =
-backtrace_supported_h =
 endif
 
 ## Keep this list sync'd with acinclude.m4:GLIBCXX_CONFIGURE.
@@ -370,7 +368,7 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	if test ! -f .libs/libstdc++.a; then \
 	  cp .libs/libstdc++convenience.a .libs/libstdc++.a; \
 	fi; \
-	echo `date` > stamp-libstdc++convenience;
+	date > stamp-libstdc++convenience;
 
 # Added rules.
 # 1 debug library
@@ -386,50 +384,41 @@ CLEAN_DEBUG =
 endif
 
 # Build a debug variant.
+
 # Take care to fix all possibly-relative paths.
-debugdir = ${glibcxx_builddir}/src/debug
-stamp-debug: Makefile $(foreach dir,$(SUBDIRS),$(dir)/Makefile)
-	if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \
-	  mkdir -p ${debugdir}; \
-	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$d; done; \
-	  (cd ${debugdir}; \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../Makefile > Makefile ; \
-	  for d in . $(SUBDIRS); do \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../$d/Makefile > $d/Makefile ; \
-	  done) ; \
-	fi; \
-	echo `date` > stamp-debug;
+debug/%/Makefile: %/Makefile
+	$(MKDIR_P) $(dir $@)
+	sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	    -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	    -e 's/srcdir = \.\./srcdir = ..\/../' \
+	    -e 's/VPATH = \.\./VPATH = ..\/../' \
+	    -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	    -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < $< > $@
+
+stamp-debug: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+	mv debug/Makefile debug/Makefile.tmp
+	sed -e 's,all-local: all-once,all-local:,' \
+	    -e 's,install-data-local: install-data-once,install-data-local:,' \
+	    -e '/vpath/!s,src/c,src/debug/c,' \
+	  < debug/Makefile.tmp > debug/Makefile
+	rm -f debug/Makefile.tmp
+	date > stamp-debug;
+
+.SECONDARY: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
 
 if ENABLE_BACKTRACE
-${debugdir}/$(backtrace_supported_h): $(backtrace_supported_h) stamp-debug
+backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
+debug_backtrace_supported_h = debug/$(backtrace_supported_h)
+$(debug_backtrace_supported_h): $(backtrace_supported_h) stamp-debug
 	cp $< $@
-debug_backtrace_supported_h = ${debugdir}/$(backtrace_supported_h)
 else
 debug_backtrace_supported_h =
 endif
 
 build-debug: stamp-debug $(debug_backtrace_supported_h)
-	  (cd ${debugdir}; \
-	  mv Makefile Makefile.tmp; \
-	  sed -e 's,all-local: all-once,all-local:,' \
-	      -e 's,install-data-local: install-data-once,install-data-local:,' \
-	      -e '/vpath/!s,src/c,src/debug/c,' \
-	  < Makefile.tmp > Makefile ; \
-	  rm -f Makefile.tmp ; \
-	  $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
-	  toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ;
+	  $(MAKE) -C debug CXXFLAGS='$(DEBUG_FLAGS)' \
+	    toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all
 
 # Install debug library.
 install-debug: build-debug
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 41a00f7b4ec..f54ee282fb0 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -485,8 +485,6 @@ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS)
 @ENABLE_FILESYSTEM_TS_TRUE@filesystem_dir = filesystem
 @ENABLE_BACKTRACE_FALSE@backtrace_dir = 
 @ENABLE_BACKTRACE_TRUE@backtrace_dir = libbacktrace
-@ENABLE_BACKTRACE_FALSE@backtrace_supported_h = 
-@ENABLE_BACKTRACE_TRUE@backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 SUBDIRS = c++98 c++11 c++17 c++20 $(filesystem_dir) $(backtrace_dir)
 @VTV_CYGMIN_FALSE@toolexeclib_LTLIBRARIES = libstdc++.la
 
@@ -675,12 +673,9 @@ CXXLINK = \
 @GLIBCXX_BUILD_DEBUG_TRUE@STAMP_INSTALL_DEBUG = install-debug
 @GLIBCXX_BUILD_DEBUG_FALSE@CLEAN_DEBUG = 
 @GLIBCXX_BUILD_DEBUG_TRUE@CLEAN_DEBUG = debug
-
-# Build a debug variant.
-# Take care to fix all possibly-relative paths.
-debugdir = ${glibcxx_builddir}/src/debug
+@ENABLE_BACKTRACE_TRUE@backtrace_supported_h = $(backtrace_dir)/backtrace-supported.h
 @ENABLE_BACKTRACE_FALSE@debug_backtrace_supported_h = 
-@ENABLE_BACKTRACE_TRUE@debug_backtrace_supported_h = ${debugdir}/$(backtrace_supported_h)
+@ENABLE_BACKTRACE_TRUE@debug_backtrace_supported_h = debug/$(backtrace_supported_h)
 all: all-recursive
 
 .SUFFIXES:
@@ -1113,44 +1108,37 @@ libstdc++convenience.la: $(toolexeclib_LTLIBRARIES)
 	if test ! -f .libs/libstdc++.a; then \
 	  cp .libs/libstdc++convenience.a .libs/libstdc++.a; \
 	fi; \
-	echo `date` > stamp-libstdc++convenience;
-stamp-debug: Makefile $(foreach dir,$(SUBDIRS),$(dir)/Makefile)
-	if test ! -d ${debugdir} || test ! -f ${debugdir}/Makefile ; then \
-	  mkdir -p ${debugdir}; \
-	  for d in $(SUBDIRS); do mkdir -p  ${debugdir}/$d; done; \
-	  (cd ${debugdir}; \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../Makefile > Makefile ; \
-	  for d in . $(SUBDIRS); do \
-	  sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
-	      -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
-	      -e 's/srcdir = \.\./srcdir = ..\/../' \
-	      -e 's/VPATH = \.\./VPATH = ..\/../' \
-	      -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
-	      -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
-	  < ../$d/Makefile > $d/Makefile ; \
-	  done) ; \
-	fi; \
-	echo `date` > stamp-debug;
+	date > stamp-libstdc++convenience;
+
+# Build a debug variant.
 
-@ENABLE_BACKTRACE_TRUE@${debugdir}/$(backtrace_supported_h): $(backtrace_supported_h) stamp-debug
+# Take care to fix all possibly-relative paths.
+debug/%/Makefile: %/Makefile
+	$(MKDIR_P) $(dir $@)
+	sed -e 's/top_builddir = \.\./top_builddir = ..\/../' \
+	    -e 's/top_build_prefix = \.\./top_build_prefix = ..\/../' \
+	    -e 's/srcdir = \.\./srcdir = ..\/../' \
+	    -e 's/VPATH = \.\./VPATH = ..\/../' \
+	    -e 's/glibcxx_basedir = \.\./glibcxx_basedir = ..\/../' \
+	    -e 's/MKDIR_P = \.\./MKDIR_P = ..\/../' \
+	  < $< > $@
+
+stamp-debug: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+	mv debug/Makefile debug/Makefile.tmp
+	sed -e 's,all-local: all-once,all-local:,' \
+	    -e 's,install-data-local: install-data-once,install-data-local:,' \
+	    -e '/vpath/!s,src/c,src/debug/c,' \
+	  < debug/Makefile.tmp > debug/Makefile
+	rm -f debug/Makefile.tmp
+	date > stamp-debug;
+
+.SECONDARY: $(foreach dir,. $(SUBDIRS),debug/$(dir)/Makefile)
+@ENABLE_BACKTRACE_TRUE@$(debug_backtrace_supported_h): $(backtrace_supported_h) stamp-debug
 @ENABLE_BACKTRACE_TRUE@	cp $< $@
 
 build-debug: stamp-debug $(debug_backtrace_supported_h)
-	  (cd ${debugdir}; \
-	  mv Makefile Makefile.tmp; \
-	  sed -e 's,all-local: all-once,all-local:,' \
-	      -e 's,install-data-local: install-data-once,install-data-local:,' \
-	      -e '/vpath/!s,src/c,src/debug/c,' \
-	  < Makefile.tmp > Makefile ; \
-	  rm -f Makefile.tmp ; \
-	  $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
-	  toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all) ;
+	  $(MAKE) -C debug CXXFLAGS='$(DEBUG_FLAGS)' \
+	    toolexeclibdir=$(glibcxx_toolexeclibdir)/debug all
 
 # Install debug library.
 install-debug: build-debug
</cut>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-14  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12 11:19 [TCWG CI] Failure after basepoints/gcc-13-3918-gba7551485bc: libstdc++: Simplify build targets for debug library ci_notify
2022-11-12 15:42 ci_notify
2022-11-14  9:38 ci_notify

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).