This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/67114] [MinGW64] build failure with POSIX threads enabled


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

--- Comment #7 from Cezary Åliwa <sliwa at ifpan dot edu.pl> ---

1. After applying the patch to GCC 5.2.0, the build fails (I do not see
PTW32_VERSION defined):

Making all in c++11
make[5]: Entering directory
`/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11'
/bin/sh ../../libtool --tag CXX --tag disable-shared   --mode=compile
/home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc/xgcc -shared-libgcc
-B/home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc -nostdinc++
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/opt/mingw64/x86_64-w64-mingw32/lib -L/opt/mingw64/mingw/lib -isystem
/opt/mingw64/x86_64-w64-mingw32/include -isystem /opt/mingw64/mingw/include
-B/opt/mingw64/x86_64-w64-mingw32/bin/ -B/opt/mingw64/x86_64-w64-mingw32/lib/
-isystem /opt/mingw64/x86_64-w64-mingw32/include -isystem
/opt/mingw64/x86_64-w64-mingw32/sys-include   
-I/home/czarek/src/nowe/build-pthreads/gcc-5.2.0/libstdc++-v3/../libgcc
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include
-I/home/czarek/src/nowe/build-pthreads/gcc-5.2.0/libstdc++-v3/libsupc++ 
-std=gnu++11 -prefer-pic -D_GLIBCXX_SHARED -fno-implicit-templates  -Wall
-Wextra -Wwrite-strings -Wcast-qual -Wabi  -fdiagnostics-show-location=once  
-ffunction-sections -fdata-sections  -frandom-seed=functexcept.lo -g -O2  -c -o
functexcept.lo ../../../../../gcc-5.2.0/libstdc++-v3/src/c++11/functexcept.cc
libtool: compile:  /home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc/xgcc
-shared-libgcc -B/home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc
-nostdinc++
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/opt/mingw64/x86_64-w64-mingw32/lib -L/opt/mingw64/mingw/lib -isystem
/opt/mingw64/x86_64-w64-mingw32/include -isystem /opt/mingw64/mingw/include
-B/opt/mingw64/x86_64-w64-mingw32/bin/ -B/opt/mingw64/x86_64-w64-mingw32/lib/
-isystem /opt/mingw64/x86_64-w64-mingw32/include -isystem
/opt/mingw64/x86_64-w64-mingw32/sys-include
-I/home/czarek/src/nowe/build-pthreads/gcc-5.2.0/libstdc++-v3/../libgcc
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include
-I/home/czarek/src/nowe/build-pthreads/gcc-5.2.0/libstdc++-v3/libsupc++
-std=gnu++11 -D_GLIBCXX_SHARED -fno-implicit-templates -Wall -Wextra
-Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once
-ffunction-sections -fdata-sections -frandom-seed=functexcept.lo -g -O2 -c
../../../../../gcc-5.2.0/libstdc++-v3/src/c++11/functexcept.cc -o functexcept.o
In file included from
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/future:40:0,
                 from
../../../../../gcc-5.2.0/libstdc++-v3/src/c++11/functexcept.cc:34:
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/thread:
In instantiation of âstatic bool std::thread::id::__less<_Tp,
<template-parameter-1-2> >::_S_less(const _Tp&, const _Tp&) [with _Tp =
ptw32_handle_t; <template-parameter-1-2> = void]â:
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/thread:106:37:
  required from here
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/thread:91:36:
error: â_GLIBCXX_THREAD_ID_LESSâ was not declared in this scope
    { return _GLIBCXX_THREAD_ID_LESS(__x, __y); }
                                    ^
make[5]: *** [functexcept.lo] Error 1
make[5]: Leaving directory
`/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11'
make[5]: Entering directory
`/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src'
/bin/sh ../libtool --tag CXX   --mode=compile
/home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc/xgcc -shared-libgcc
-B/home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc -nostdinc++
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/opt/mingw64/x86_64-w64-mingw32/lib -L/opt/mingw64/mingw/lib -isystem
/opt/mingw64/x86_64-w64-mingw32/include -isystem /opt/mingw64/mingw/include
-B/opt/mingw64/x86_64-w64-mingw32/bin/ -B/opt/mingw64/x86_64-w64-mingw32/lib/
-isystem /opt/mingw64/x86_64-w64-mingw32/include -isystem
/opt/mingw64/x86_64-w64-mingw32/sys-include    
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include
-I/home/czarek/src/nowe/build-pthreads/gcc-5.2.0/libstdc++-v3/libsupc++ 
-DDLL_EXPORT -DPIC -fno-implicit-templates  -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi  -fdiagnostics-show-location=once   -ffunction-sections
-fdata-sections  -frandom-seed=compatibility-thread-c++0x.lo -g -O2 
-std=gnu++11 -c
../../../../gcc-5.2.0/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc
libtool: compile:  /home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc/xgcc
-shared-libgcc -B/home/czarek/src/nowe/build-pthreads/objdir-gcc/./gcc
-nostdinc++
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src/.libs
-L/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs
-L/opt/mingw64/x86_64-w64-mingw32/lib -L/opt/mingw64/mingw/lib -isystem
/opt/mingw64/x86_64-w64-mingw32/include -isystem /opt/mingw64/mingw/include
-B/opt/mingw64/x86_64-w64-mingw32/bin/ -B/opt/mingw64/x86_64-w64-mingw32/lib/
-isystem /opt/mingw64/x86_64-w64-mingw32/include -isystem
/opt/mingw64/x86_64-w64-mingw32/sys-include
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32
-I/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include
-I/home/czarek/src/nowe/build-pthreads/gcc-5.2.0/libstdc++-v3/libsupc++
-DDLL_EXPORT -DPIC -fno-implicit-templates -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections
-fdata-sections -frandom-seed=compatibility-thread-c++0x.lo -g -O2 -std=gnu++11
-c ../../../../gcc-5.2.0/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc 
-DDLL_EXPORT -DPIC -D_GLIBCXX_SHARED -o .libs/compatibility-thread-c++0x.o
In file included from
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/future:40:0,
                 from
../../../../gcc-5.2.0/libstdc++-v3/src/c++11/compatibility-thread-c++0x.cc:30:
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/thread:
In instantiation of âstatic bool std::thread::id::__less<_Tp,
<template-parameter-1-2> >::_S_less(const _Tp&, const _Tp&) [with _Tp =
ptw32_handle_t; <template-parameter-1-2> = void]â:
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/thread:106:37:
  required from here
/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/include/thread:91:36:
error: â_GLIBCXX_THREAD_ID_LESSâ was not declared in this scope
    { return _GLIBCXX_THREAD_ID_LESS(__x, __y); }
                                    ^
make[5]: *** [compatibility-thread-c++0x.lo] Error 1
make[5]: Leaving directory
`/home/czarek/src/nowe/build-pthreads/objdir-gcc/x86_64-w64-mingw32/libstdc++-v3/src'



2. What is the appropriate test to verify the correctness of the order imposed?

3. My procedure is the following: I build GCC with Win32 threads, use it to
build the w32-pthreads library, and only then I build the compiler which uses
POSIX threads. Is there a better or simpler way? Building libgcc requires
pthreads, w32-pthreads compiled with gcc require libgcc. This looks like a
circular dependence.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]