public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW
@ 2020-11-05 12:51 markus.boeck02 at gmail dot com
  2020-11-05 13:48 ` [Bug libstdc++/97729] " redi at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: markus.boeck02 at gmail dot com @ 2020-11-05 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97729
           Summary: Link failure due to basic_stringbuf and others when
                    building DLL on MinGW
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: markus.boeck02 at gmail dot com
  Target Milestone: ---

Current trunk of libstdc++ is not able to be built when building a shared
library on the i686-w64-mingw32 and x86_64-w64-mingw32 targets. Following
configure arguments were used:

../configure --target=x86_64-w64-mingw32 --disable-bootstrap
--with-sysroot=/mnt/c/GCC-Build/NewestLinux
--prefix=/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install
--disable-multilib --with-tune=znver1 --disable-libstdcxx-verbose --disable-nls
--enable-shared --with-gnu-ld --enable-threads=posix --enable-__cxa_atexit
--enable-libgomp --with-gnu-as
--with-as=/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-as
--with-ld=/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld
--enable-languages=c,c++,fortran,lto,objc,obj-c++ --with-cross-host

The last relevant lines of stdout are:

/bin/bash ../libtool --tag CXX   --mode=link
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc/xgcc -shared-libgcc
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc -nostdinc++
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/lib -isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/include
-isystem /mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/include
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/bin/
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib/
-isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/include
-isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/sys-include
    -Wl,-O1  -no-undefined -bindir
"/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib/../lib"
-Wl,--gc-sections  -std=gnu++98 -DDLL_EXPORT -DPIC -fno-implicit-templates 
-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi=2 
-fdiagnostics-show-location=once   -ffunction-sections -fdata-sections 
-frandom-seed=libstdc++.la  -o libstdc++.la -version-info 6:29:0
-Wl,--version-script=libstdc++-symbols.ver -lm -no-undefined -bindir
"/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib/../lib"
-rpath
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib/../lib
compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo 
compatibility-c++0x.lo compatibility-atomic-c++0x.lo
compatibility-thread-c++0x.lo compatibility-chrono.lo compatibility-condvar.lo 
../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la
../src/c++11/libc++11convenience.la ../src/c++17/libc++17convenience.la
../src/c++20/libc++20convenience.la 
make  all-am
make[3]: Entering directory
'/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libgfortran'
libtool: link: rm -fr  .libs/libstdc++.dll.a
libtool: link:  /mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc/xgcc
-shared-libgcc -B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc -nostdinc++
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/lib -isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/include
-isystem /mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/include
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/bin/
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib/
-isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/include
-isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/sys-include
   -shared -nostdlib /mnt/c/GCC-Build/NewestLinux/mingw/lib/../lib/dllcrt2.o
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc/crtbegin.o 
.libs/compatibility.o .libs/compatibility-debug_list.o
.libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o
.libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o
.libs/compatibility-chrono.o .libs/compatibility-condvar.o  -Wl,--whole-archive
../libsupc++/.libs/libsupc++convenience.a
../src/c++98/.libs/libc++98convenience.a
../src/c++11/.libs/libc++11convenience.a
../src/c++17/.libs/libc++17convenience.a
../src/c++20/.libs/libc++20convenience.a -Wl,--no-whole-archive 
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/lib
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc
-L/mnt/c/GCC-Build/NewestLinux/mingw/lib/../lib
-L/mnt/c/GCC-Build/NewestLinux/mingw/lib -lmingw32 -lgcc_s -lgcc -lmoldname
-lmingwex -lmsvcrt -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32
-lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lkernel32
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc/crtend.o  -Wl,-O1
-Wl,--gc-sections -Wl,--version-script=libstdc++-symbols.ver   -o
.libs/libstdc++-6.dll -Wl,--enable-auto-image-base -Xlinker --out-implib
-Xlinker .libs/libstdc++.dll.a
:
:
:
true  DO=all multi-do # make
make[3]: Leaving directory
'/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libgfortran'
make[2]: Leaving directory
'/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libgfortran'
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../libsupc++/.libs/libsupc++convenience.a(nested_exception.o): in function
`std::__exception_ptr::exception_ptr::~exception_ptr()':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:194:
multiple definition of `std::__exception_ptr::exception_ptr::~exception_ptr()';
../libsupc++/.libs/libsupc++convenience.a(eh_ptr.o):C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:194:
first defined here
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../src/c++11/.libs/libc++11convenience.a(future.o): in function
`std::__exception_ptr::exception_ptr::exception_ptr()':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++11/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/std_mutex.h:105:
multiple definition of `std::__exception_ptr::exception_ptr::exception_ptr()';
../libsupc++/.libs/libsupc++convenience.a(eh_ptr.o):C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:176:
first defined here
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../src/c++20/.libs/libc++20convenience.a(sstream-inst.o): in function
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::basic_stringbuf(std::__cxx11::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char> >&&, std::allocator<char>
const&)':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++20/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/sstream:210:
undefined reference to `std::__cxx11::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char>
>::basic_stringbuf(std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >&&, std::allocator<char> const&,
std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::__xfer_bufptrs&&)'
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../src/c++20/.libs/libc++20convenience.a(sstream-inst.o): in function
`std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::basic_stringbuf(std::__cxx11::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char> >&&, std::allocator<char>
const&)':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++20/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/sstream:210:
undefined reference to `std::__cxx11::basic_stringbuf<char,
std::char_traits<char>, std::allocator<char>
>::basic_stringbuf(std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >&&, std::allocator<char> const&,
std::__cxx11::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::__xfer_bufptrs&&)'
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../src/c++20/.libs/libc++20convenience.a(sstream-inst.o): in function
`std::__cxx11::basic_stringbuf<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t>
>::basic_stringbuf(std::__cxx11::basic_stringbuf<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >&&, std::allocator<wchar_t>
const&)':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++20/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/sstream:210:
undefined reference to `std::__cxx11::basic_stringbuf<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::basic_stringbuf(std::__cxx11::basic_stringbuf<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >&&, std::allocator<wchar_t>
const&, std::__cxx11::basic_stringbuf<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::__xfer_bufptrs&&)'
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../src/c++20/.libs/libc++20convenience.a(sstream-inst.o): in function
`std::__cxx11::basic_stringbuf<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t>
>::basic_stringbuf(std::__cxx11::basic_stringbuf<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >&&, std::allocator<wchar_t>
const&)':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++20/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/sstream:210:
undefined reference to `std::__cxx11::basic_stringbuf<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t>
>::basic_stringbuf(std::__cxx11::basic_stringbuf<wchar_t,
std::char_traits<wchar_t>, std::allocator<wchar_t> >&&, std::allocator<wchar_t>
const&, std::__cxx11::basic_stringbuf<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::__xfer_bufptrs&&)'
collect2: error: ld returned 1 exit status
make[5]: *** [libstdc++.la] Error 1

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

* [Bug libstdc++/97729] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
@ 2020-11-05 13:48 ` redi at gcc dot gnu.org
  2020-11-05 13:49 ` [Bug libstdc++/97729] [11 Regression] " redi at gcc dot gnu.org
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 13:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-11-05

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 49505
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49505&action=edit
Instantiate and export missing constructor

I can't reproduce this with a x86_64-w64-mingw32 cross-compiler built on linux,
nor with a native linux compiler. But this patch should fix it, could you test
it please?

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
  2020-11-05 13:48 ` [Bug libstdc++/97729] " redi at gcc dot gnu.org
@ 2020-11-05 13:49 ` redi at gcc dot gnu.org
  2020-11-05 14:00 ` markus.boeck02 at gmail dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build
            Summary|Link failure due to         |[11 Regression] Link
                   |basic_stringbuf and others  |failure due to
                   |when building DLL on MinGW  |basic_stringbuf and others
                   |                            |when building DLL on MinGW
      Known to work|                            |10.2.1
      Known to fail|                            |11.0
           Priority|P3                          |P1
   Target Milestone|---                         |11.0

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
  2020-11-05 13:48 ` [Bug libstdc++/97729] " redi at gcc dot gnu.org
  2020-11-05 13:49 ` [Bug libstdc++/97729] [11 Regression] " redi at gcc dot gnu.org
@ 2020-11-05 14:00 ` markus.boeck02 at gmail dot com
  2020-11-05 14:05 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: markus.boeck02 at gmail dot com @ 2020-11-05 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Markus Böck <markus.boeck02 at gmail dot com> ---
Created attachment 49507
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49507&action=edit
config.h

Applied the patch and it fixed the issue regarding the undefined references.
Still getting the multiple definitions of exception_ptr:

/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../libsupc++/.libs/libsupc++convenience.a(nested_exception.o): in function
`std::__exception_ptr::exception_ptr::~exception_ptr()':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:194:
multiple definition of `std::__exception_ptr::exception_ptr::~exception_ptr()';
../libsupc++/.libs/libsupc++convenience.a(eh_ptr.o):C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:194:
first defined here
/mnt/c/GCC-Build/NewestLinux/bin/x86_64-w64-mingw32-ld:
../src/c++11/.libs/libc++11convenience.a(future.o): in function
`std::__exception_ptr::exception_ptr::exception_ptr()':
C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++11/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/std_mutex.h:105:
multiple definition of `std::__exception_ptr::exception_ptr::exception_ptr()';
../libsupc++/.libs/libsupc++convenience.a(eh_ptr.o):C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/C:/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:176:
first defined here

I am using a cross compiler setup (though in WSL 1) as well so I'd be curious
what leads to the differences in reproducability as this is not the first time
this has happened. I'll attach my config.h if that helps. The MinGW version I
use is current trunk.

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (2 preceding siblings ...)
  2020-11-05 14:00 ` markus.boeck02 at gmail dot com
@ 2020-11-05 14:05 ` redi at gcc dot gnu.org
  2020-11-05 14:20 ` markus.boeck02 at gmail dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 14:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It could be a difference in the linker. I'm using the mingw cross-binutils that
comes with Fedora:

$ /usr/bin/x86_64-w64-mingw32-ld --version
GNU ld version 2.32-%{release}
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.


The exception_ptr symbols should get suppressed with:

--- a/libstdc++-v3/src/c++11/future.cc
+++ b/libstdc++-v3/src/c++11/future.cc
@@ -22,6 +22,9 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.

+// Prevent multiple definitions of exception_ptr inline members (PR 97729)
+#define _GLIBCXX_EH_PTR_COMPAT
+
 #include <future>
 #include <bits/functexcept.h>

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (3 preceding siblings ...)
  2020-11-05 14:05 ` redi at gcc dot gnu.org
@ 2020-11-05 14:20 ` markus.boeck02 at gmail dot com
  2020-11-05 14:37 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: markus.boeck02 at gmail dot com @ 2020-11-05 14:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Markus Böck <markus.boeck02 at gmail dot com> ---
Indeed that sounds like it might be the issue. I am currently on a very recent
version of binutils:

$ ./x86_64-w64-mingw32-ld --version                            GNU ld (GNU
Binutils) 2.35.50.20200709                                                     
                            Copyright (C) 2020 Free Software Foundation, Inc.  
                                                                    This
program is free software; you may redistribute it under the terms of           
                                   the GNU General Public License version 3 or
(at your option) a later version.                                          
This program has absolutely no warranty.

Changing the lines you posted above yields me a compiler error now:

libtool: compile:  /mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc/xgcc
-shared-libgcc -B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/./gcc -nostdinc++
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib
-L/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/lib -isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/include
-isystem /mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/mingw/include
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/bin/
-B/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/lib/
-isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/include
-isystem
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/x86_64-w64-mingw32/sys-include
-I/mnt/c/GCC-Build-Array/gcc/libstdc++-v3/../libgcc
-I/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32
-I/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include
-I/mnt/c/GCC-Build-Array/gcc/libstdc++-v3/libsupc++
-I/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/install/include -std=gnu++11
-D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi=2 -fdiagnostics-show-location=once -ffunction-sections
-fdata-sections -frandom-seed=future.lo -Wno-error=format-extra-args
-Wno-error=format -g1 -fdebug-prefix-map=/mnt/c=C: -c
../../../../../libstdc++-v3/src/c++11/future.cc -o future.o
In file included from ../../../../../libstdc++-v3/src/c++11/future.cc:29:
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/future:
In member function 'std::__future_base::_Result<_Res>&
std::__basic_future<_Res>::_M_get_result() const':
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/future:712:30:
error: ambiguous overload for 'operator==' (operand types are
'std::__exception_ptr::exception_ptr' and 'int')
  712 |         if (!(__res._M_error == 0))
      |               ~~~~~~~~~~~~~~ ^~ ~
      |                     |           |
      |                     |           int
      |                     std::__exception_ptr::exception_ptr
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/future:712:30:
note: candidate: 'operator==(std::__exception_ptr::exception_ptr::__safe_bool
{aka void (std::__exception_ptr::exception_ptr::*)()},
std::__exception_ptr::exception_ptr::__safe_bool {aka void
(std::__exception_ptr::exception_ptr::*)()})' (built-in)
  712 |         if (!(__res._M_error == 0))
      |               ~~~~~~~~~~~~~~~^~~~
In file included from
/mnt/c/GCC-Build-Array/gcc/libstdc++-v3/libsupc++/exception:147,
                 from
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/mutex:40,
                 from
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/future:38,
                 from ../../../../../libstdc++-v3/src/c++11/future.cc:29:
/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/include/bits/exception_ptr.h:223:5:
note: candidate: 'bool std::__exception_ptr::operator==(const
std::__exception_ptr::exception_ptr&, const
std::__exception_ptr::exception_ptr&)'
  223 |     operator==(const exception_ptr&, const exception_ptr&)
      |     ^~~~~~~~
Makefile:644: recipe for target 'future.lo' failed
make[5]: Leaving directory
'/mnt/c/GCC-Build-Array/gcc/build-host-x86_64/x86_64-w64-mingw32/libstdc++-v3/src/c++11'

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (4 preceding siblings ...)
  2020-11-05 14:20 ` markus.boeck02 at gmail dot com
@ 2020-11-05 14:37 ` redi at gcc dot gnu.org
  2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 14:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes sorry, I get the same error. I should have tested it first! Working patch
on the way ...

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (5 preceding siblings ...)
  2020-11-05 14:37 ` redi at gcc dot gnu.org
@ 2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
  2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-05 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:50b840ac5e1d6534e345c3fee9a97ae45ced6bc7

commit r11-4748-g50b840ac5e1d6534e345c3fee9a97ae45ced6bc7
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 5 13:41:40 2020 +0000

    libstdc++: Export basic_stringbuf constructor [PR 97729]

    libstdc++-v3/ChangeLog:

            PR libstdc++/97729
            * config/abi/pre/gnu.ver (GLIBCXX_3.4.29): Add exports.
            * src/c++20/sstream-inst.cc (basic_stringbuf): Instantiate
            private constructor taking __xfer_bufptrs.

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (6 preceding siblings ...)
  2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
@ 2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
  2020-11-05 18:05 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-05 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:710508c7b1a2c8e1d75d4c4f1ac79473dbf2b2bb

commit r11-4749-g710508c7b1a2c8e1d75d4c4f1ac79473dbf2b2bb
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Nov 5 16:19:15 2020 +0000

    libstdc++: Fix multiple definitions of std::exception_ptr functions [PR
97729]

    This fixes some multiple definition errors caused by the changes for
    PR libstdc++/90295. The previous solution for inlining the members of
    std::exception_ptr but still exporting them from the library was to
    suppress the 'inline' keyword on those functions when compiling
    libsupc++/eh_ptr.cc, so they get defined in that file. That produces ODR
    violations though, because there are now both inline and non-inline
    definitions in the library, due to the use of std::exception_ptr in
    other files sucg as src/c++11/future.cc.

    The new solution is to define all the relevant members as 'inline'
    unconditionally, but use __attribute__((used)) to cause definitions to
    be emitted in libsupc++/eh_ptr.cc as before. This doesn't quite work
    however, because PR c++/67453 means the attribute is ignored on
    constructors and destructors. As a workaround, the old solution
    (conditionally inline) is still used for those members, but they are
    given the always_inline attribute so that they aren't emitted in
    src/c++11/future.o as inline definitions.

    libstdc++-v3/ChangeLog:

            PR libstdc++/97729
            * include/std/future (__basic_future::_M_get_result): Use
            nullptr for null pointer constant.
            * libsupc++/eh_ptr.cc (operator==, operator!=): Remove
            definitions.
            * libsupc++/exception_ptr.h (_GLIBCXX_EH_PTR_USED): Define
            macro to conditionally add __attribute__((__used__)).
            (operator==, operator!=, exception_ptr::exception_ptr())
            (exception_ptr::exception_ptr(const exception_ptr&))
            (exception_ptr::~exception_ptr())
            (exception_ptr::operator=(const exception_ptr&))
            (exception_ptr::swap(exception_ptr&)): Always define as
            inline. Add macro to be conditionally "used".

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (7 preceding siblings ...)
  2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
@ 2020-11-05 18:05 ` redi at gcc dot gnu.org
  2020-11-05 18:05 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|10.2.1                      |
   Target Milestone|11.0                        |8.5

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It should be fixed now, could you check?

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (8 preceding siblings ...)
  2020-11-05 18:05 ` redi at gcc dot gnu.org
@ 2020-11-05 18:05 ` redi at gcc dot gnu.org
  2020-11-05 19:22 ` markus.boeck02 at gmail dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |11.0

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (9 preceding siblings ...)
  2020-11-05 18:05 ` redi at gcc dot gnu.org
@ 2020-11-05 19:22 ` markus.boeck02 at gmail dot com
  2020-11-05 19:32 ` redi at gcc dot gnu.org
  2020-11-09 14:29 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: markus.boeck02 at gmail dot com @ 2020-11-05 19:22 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Böck <markus.boeck02 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Markus Böck <markus.boeck02 at gmail dot com> ---
Can happily report that it links now! Thanks a lot

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (10 preceding siblings ...)
  2020-11-05 19:22 ` markus.boeck02 at gmail dot com
@ 2020-11-05 19:32 ` redi at gcc dot gnu.org
  2020-11-09 14:29 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2020-11-05 19:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Great, thanks for the report and testing the fix.

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

* [Bug libstdc++/97729] [11 Regression] Link failure due to basic_stringbuf and others when building DLL on MinGW
  2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
                   ` (11 preceding siblings ...)
  2020-11-05 19:32 ` redi at gcc dot gnu.org
@ 2020-11-09 14:29 ` cvs-commit at gcc dot gnu.org
  12 siblings, 0 replies; 14+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-11-09 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:0af3930a497e022597a08fa1bcef5e453bfa636f

commit r11-4839-g0af3930a497e022597a08fa1bcef5e453bfa636f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Nov 9 10:16:07 2020 +0000

    libstdc++: Use 'inline' consistently in std::exception_ptr [PR 97729]

    With PR c++/67453 fixed we can rely on the 'used' attribute to emit
    inline constructors and destructors in libsupc++/eh_ptr.cc. This means
    we don't need to suppress the 'inline' keyword on them in that file, and
    don't need to force 'always_inline' on them in other files.

    libstdc++-v3/ChangeLog:

            PR libstdc++/97729
            * libsupc++/exception_ptr.h (exception_ptr::exception_ptr())
            (exception_ptr::exception_ptr(const exception_ptr&))
            (exception_ptr::~exception_ptr()): Remove 'always_inline'
            attributes. Use 'inline' unconditionally.

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

end of thread, other threads:[~2020-11-09 14:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 12:51 [Bug libstdc++/97729] New: Link failure due to basic_stringbuf and others when building DLL on MinGW markus.boeck02 at gmail dot com
2020-11-05 13:48 ` [Bug libstdc++/97729] " redi at gcc dot gnu.org
2020-11-05 13:49 ` [Bug libstdc++/97729] [11 Regression] " redi at gcc dot gnu.org
2020-11-05 14:00 ` markus.boeck02 at gmail dot com
2020-11-05 14:05 ` redi at gcc dot gnu.org
2020-11-05 14:20 ` markus.boeck02 at gmail dot com
2020-11-05 14:37 ` redi at gcc dot gnu.org
2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
2020-11-05 18:01 ` cvs-commit at gcc dot gnu.org
2020-11-05 18:05 ` redi at gcc dot gnu.org
2020-11-05 18:05 ` redi at gcc dot gnu.org
2020-11-05 19:22 ` markus.boeck02 at gmail dot com
2020-11-05 19:32 ` redi at gcc dot gnu.org
2020-11-09 14:29 ` cvs-commit at gcc dot gnu.org

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).