Hello.

I've finished a build with --enable-libstdcxx-debug, and this time I've
checked both the build tree and the install tree.

This is what I found on the build tree.
$ find . -name libstdc*.dll -exec ls -l {} \;
15,102,643 Sep 17 08:49
./prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs/libstdc++-6.dll
16,678,882 Sep 17 08:50
./prev-x86_64-w64-mingw32/libstdc++-v3/src/debug/.libs/libstdc++-6.dll
15,102,643 Sep 17 08:26
./stage1-x86_64-w64-mingw32/libstdc++-v3/src/.libs/libstdc++-6.dll
16,678,882 Sep 17 08:27
./stage1-x86_64-w64-mingw32/libstdc++-v3/src/debug/.libs/libstdc++-6.dll
15,102,643 Sep 17 09:08
./x86_64-w64-mingw32/libstdc++-v3/src/.libs/libstdc++-6.dll
16,678,882 Sep 17 09:08
./x86_64-w64-mingw32/libstdc++-v3/src/debug/.libs/libstdc++-6.dll

So, both versions of the DLL are being built. One is the optimized version
(the size is identical to the DLL built when configured with
--disable-libstdcxx-debug). The other must be the debug version.

This is on the install tree created by make install. The installed DLL is,
indeed, the debug one, unlike what happens on Linux.
$ find . -name libstdc*.dll -exec ls -l {} \;
16,678,882 Sep 17 09:16 ./gcc/bin/libstdc++-6.dll

I don't think the hypothesis put forward by koala01 is the cause of the
problem, and I'll explain why.

This is when the optimized DLL is installed:
make[5]: Entering directory
'/home/TestUser/source/gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src'
...
libtool: install:
      dlpath=`/bin/sh 2>&1 -c '. .libs/'libstdc++.la'i; echo
libstdc++-6.dll'`
libtool: install:

dldir=/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/`dirname
../../../../bin/libstdc++-6.dll`
libtool: install:
      test -d
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../bin
|| mkdir -p
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../bin
libtool: install:
      /usr/bin/install -c .libs/libstdc++-6.dll
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../bin/libstdc++-6.dll
libtool: install:
      chmod a+x
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../bin/libstdc++-6.dll
libtool: install:
      if test -n '' && test -n 'strip --strip-unneeded'; then
        eval 'strip --strip-unneeded
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../bin/libstdc++-6.dll'
|| exit 0;
      fi

It's installing the DLL from x86_64-w64-mingw32/libstdc++-v3/src (i.e., the
optimized DLL) to
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/../../../../bin/libstdc++-6.dll,
i.e., /opt/dbg_strip_default/gcc/bin/libstdc++-6.dll, as expected.

And, then, we get this:
make[8]: Entering directory
'/home/TestUser/source/gcc/src/build-x86_64-w64-mingw32/x86_64-w64-mingw32/libstdc++-v3/src/debug'
...
libtool: install:
      dlpath=`/bin/sh 2>&1 -c '. .libs/'libstdc++.la'i; echo
libstdc++-6.dll'`
libtool: install:

dldir=/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/`dirname
../../../../../bin/libstdc++-6.dll`
libtool: install:
      test -d
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/../../../../../bin
|| mkdir -p
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/../../../../../bin
libtool: install:
      /usr/bin/install -c .libs/libstdc++-6.dll
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/../../../../../bin/libstdc++-6.dll
libtool: install:
      chmod a+x
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/../../../../../bin/libstdc++-6.dll
libtool: install:
      if test -n '' && test -n 'strip --strip-unneeded'; then
        eval 'strip --strip-unneeded
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/../../../../../bin/libstdc++-6.dll'
|| exit 0;
      fi

It's overwriting the optimized DLL with the debug DLL, instead of
installing it on the debug directory.

BTW, immediately afterwards, we get this, correctly installing the static
lib on the debug directory:
libtool: install: /usr/bin/install -c .libs/libstdc++.lai
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/libstdc++.la
libtool: install: /usr/bin/install -c .libs/libstdc++.a
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/libstdc++.a
libtool: install: chmod 644
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/libstdc++.a
libtool: install: ranlib
/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/libstdc++.a
libtool: install: warning: remember to run `libtool --finish
/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug'

Getting back to the installation of the debug DLL, I'm assuming it comes
from the build tree, from ./x86_64-w64-mingw32/libstdc++-v3/libtool:
postinstall_cmds="base_file=\\\`basename \\\${file}\\\`~
      dlpath=\\\`\$SHELL 2>&1 -c '. \$dir/'\\\${base_file}'i; echo
\\\$dlname'\\\`~
      dldir=\$destdir/\\\`dirname \\\$dlpath\\\`~
      test -d \\\$dldir || mkdir -p \\\$dldir~
      \$install_prog \$dir/\$dlname \\\$dldir/\$dlname~
      chmod a+x \\\$dldir/\$dlname~
      if test -n '\$stripme' && test -n '\$striplib'; then
        eval '\$striplib \\\$dldir/\$dlname' || exit \\\$?;
      fi"

However, when I position in x86_64-w64-mingw32/libstdc++-v3/src/debug and
run this command:
echo `/bin/sh 2>&1 -c '. .libs/'libstdc++.la'i; echo libstdc++-6.dll'`

I get
libstdc++-6.dll

So, that means dlpath=libstdc++-6.dll. And the next line should be:
dldir=/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/`dirname
libstdc++-6.dll`

Instead, I'm getting this:
dldir=/opt/dbg_strip_default/gcc/lib/gcc/x86_64-w64-mingw32/5.2.0/debug/`dirname
../../../../../bin/libstdc++-6.dll`

And I can't understand where this ../../../../../bin/ "prefix" is coming
from.

As a workaround, I'll manually copy both DLLs to their respective dirs, but
I'm curious as to what could cause this. Anyone has any suggestion where I
could look next?

Thanks for your help.
---
Paulo Caetano
http://cidebycide.blogspot.pt/
------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to