https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90770

            Bug ID: 90770
           Summary: Building with --enable-libstdcxx-debug and make
                    profiledbootstrap fails with mv: cannot stat
                    'Makefile': No such file or directory
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tadeus.prastowo at unitn dot it
  Target Milestone: ---

Created attachment 46456
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46456&action=edit
Complete terminal output during the non-parallel build

This issue is initially reported in gcc-help (see
https://gcc.gnu.org/ml/gcc-help/2019-05/msg00137.html) and has been confirmed
by one other person (see
https://gcc.gnu.org/ml/gcc-help/2019-06/msg00014.html).  The issue is
reproducible by unpacking the release tarball of GCC 9.1.0 (see
https://gcc.gnu.org/ml/gcc/2019-05/msg00024.html) and then building it by
configuring using configure switch `--enable-libstdcxx-debug' (e.g.,
../gcc-9/configure --prefix=$HOME/gcc-9 --enable-languages=c,c++
--enable-libstdcxx-debug --disable-multilib) and making using `make
profiledbootstrap'.  The build will fail with the following message (the
complete terminal output during the non-parallel build is attached; feel free
to request additional log files) whose solution is described at the end:

libtool: link: x86_64-linux-gnu-ranlib .libs/libstdc++convenience.a
libtool: link: rm -fr .libs/libstdc++convenience.lax
.libs/libstdc++convenience.lax
libtool: link: ( cd ".libs" && rm -f "libstdc++convenience.la" && ln -s
"../libstdc++convenience.la" "libstdc++convenience.la" )
if test ! -d
/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug; then \
  mkdir -p
/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug; \
  for d in c++98 c++11 c++17 filesystem; do mkdir -p 
/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug/$d;
done; \
  (cd /home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug;
\
  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 . c++98 c++11 c++17 filesystem; 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;
(cd /home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug; \
  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='-gdwarf-4 -g3 -O0 -D_GLIBCXX_ASSERTIONS' \
  toolexeclibdir=/home/eus/gcc-9/lib/../lib64/debug all) ;
mv: cannot stat 'Makefile': No such file or directory
/bin/bash: line 2: Makefile.tmp: No such file or directory
make[7]: Entering directory
'/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug'
make[7]: *** No rule to make target 'all'.  Stop.
make[7]: Leaving directory
'/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src/debug'
Makefile:1074: recipe for target 'build-debug' failed
make[6]: *** [build-debug] Error 2
make[6]: Leaving directory
'/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src'
Makefile:730: recipe for target 'all-recursive' failed
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory
'/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3/src'
Makefile:562: recipe for target 'all-recursive' failed
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory
'/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3'
Makefile:487: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory
'/home/eus/buildzone/gcc-9-build/x86_64-linux-gnu/libstdc++-v3'
Makefile:15380: recipe for target 'all-stagefeedback-target-libstdc++-v3'
failed
make[2]: *** [all-stagefeedback-target-libstdc++-v3] Error 2
make[2]: Leaving directory '/home/eus/buildzone/gcc-9-build'
Makefile:22998: recipe for target 'stagefeedback-bubble' failed
make[1]: *** [stagefeedback-bubble] Error 2
make[1]: Leaving directory '/home/eus/buildzone/gcc-9-build'
Makefile:23017: recipe for target 'profiledbootstrap' failed
make: *** [profiledbootstrap] Error 2

[Solution] The Ubuntu PPA at
http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu has been successful at
building GCC 9.1.0 despite using `--enable-libstdcxx-debug' and `make
profiledbootstrap-lean' by applying the patch that was proposed at
https://gcc.gnu.org/ml/libstdc++/2015-11/msg00164.html, which is stored in the
DEB source package as `debian/patches/skip-bootstrap-multilib.diff'.  If I
apply the patch as follows in the source directory that is extracted from the
GCC 9.1.0 release tarball mentioned in the beginning, GCC 9.1.0 can be built
successfully using `--enable-libstdcxx-debug' and `make profiledbootstrap':
1. patch -p2 < /tmp/skip-bootstrap-multilib.diff
2. cd libstdc++-v3
3. autoreconf

[Question] Can this build failure be fixed upstream, please?  Note that the
patch file has never been intended to fix this build problem but only to speed
up the build process.  Hence, the build process should have worked without the
patch despite using `--enable-libstdcxx-debug' and `make profiledbootstrap'. 
Thank you.

Reply via email to