public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
@ 2012-05-04 20:11 skunk at iskunk dot org
  2012-05-04 20:22 ` [Bug bootstrap/53238] " redi at gcc dot gnu.org
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-04 20:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

             Bug #: 53238
           Summary: Bootstrap failure: error: 'pthread_mutex_timedlock'
                    was not declared in this scope
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: skunk@iskunk.org
              Host: powerpc-ibm-aix4.3.2.0
            Target: powerpc-ibm-aix4.3.2.0
             Build: powerpc-ibm-aix4.3.2.0


Bootstrapping 4.7.0 on AIX 4.3...

[...]
gmake[9]: Entering directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include'
mkdir -p ./powerpc-ibm-aix4.3.2.0/bits/stdc++.h.gch
/tmp/gcc-build/./gcc/xgcc -shared-libgcc -B/tmp/gcc-build/./gcc -nostdinc++
-L/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/src
-L/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/src/.libs
-B/opt/tg/powerpc-ibm-aix4.3.2.0/bin/ -B/opt/tg/powerpc-ibm-aix4.3.2.0/lib/
-isystem /opt/tg/powerpc-ibm-aix4.3.2.0/include -isystem
/opt/tg/powerpc-ibm-aix4.3.2.0/sys-include  -pthread -x c++-header -nostdinc++
-g   -pthread
-I/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0
-I/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include
-I/home/src/gcc-4.7.0/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x
/home/src/gcc-4.7.0/libstdc++-v3/include/precompiled/stdc++.h \
-o powerpc-ibm-aix4.3.2.0/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr-default.h:30:0,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr.h:150,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/ext/atomicity.h:34,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/bits/ios_base.h:41,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/ios:43,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/istream:40,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/sstream:39,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/complex:47,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/ccomplex:42,
                 from
/home/src/gcc-4.7.0/libstdc++-v3/include/precompiled/stdc++.h:53:
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr-posix.h:
In function 'int __gthread_mutex_timedlock(__gthread_mutex_t*, const
__gthread_time_t*)':
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr-posix.h:789:69:
error: 'pthread_mutex_timedlock' was not declared in this scope
gmake[9]: *** [powerpc-ibm-aix4.3.2.0/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1
gmake[9]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include'
gmake[8]: *** [all-recursive] Error 1
gmake[8]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3'
gmake[7]: *** [all] Error 2
gmake[7]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3'
gmake[6]: *** [multi-do] Error 1
gmake[6]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[5]: *** [all-multi] Error 2
gmake[5]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[2]: *** [all-stage1-target-libstdc++-v3] Error 2
gmake[2]: Leaving directory `/tmp/gcc-build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/tmp/gcc-build'
gmake: *** [bootstrap-lean] Error 2


This system does not know about pthread_mutex_timedlock:

    $ find /usr/include -type f -exec grep -l pthread_mutex_timedlock {} \;
    $

However, a configure check appears to have determined otherwise. In

    /tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/config.log

, I see the following:

----
configure:65564: checking whether it can be safely assumed that mutex_timedlock
is available
configure:65583:  /tmp/gcc-build/./gcc/xgcc -shared-libgcc
-B/tmp/gcc-build/./gcc -nostdinc++
-L/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/src
-L/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs
-B/opt/tg/powerpc-ibm-aix4.3.2.0/bin/ -B/opt/tg/powerpc-ibm-aix4.3.2.0/lib/
-isystem /opt/tg/powerpc-ibm-aix4.3.2.0/include -isystem
/opt/tg/powerpc-ibm-aix4.3.2.0/sys-include    -c -g  -fno-exceptions        
-I/home/src/gcc-4.7.0/libstdc++-v3/../libgcc
-I/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/../libgcc  conftest.cpp
>&5
configure:65583: $? = 0
configure:65598: result: yes
----

This check causes _GTHREAD_USE_MUTEX_TIMEDLOCK to be #defined in

   
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/c++config.h

If I comment out that #define, then compilation of O2ggnu++0x.gch succeeds.


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
@ 2012-05-04 20:22 ` redi at gcc dot gnu.org
  2012-05-04 20:34 ` skunk at iskunk dot org
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-04 20:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-04 20:21:32 UTC ---
You'll need to figure out why the configure test passes, most of us who work on
that bit of code don't have access to AIX


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
  2012-05-04 20:22 ` [Bug bootstrap/53238] " redi at gcc dot gnu.org
@ 2012-05-04 20:34 ` skunk at iskunk dot org
  2012-05-04 20:58 ` redi at gcc dot gnu.org
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-04 20:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #2 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-04 20:33:46 UTC ---
(In reply to comment #1)
> You'll need to figure out why the configure test passes, most of us who work on
> that bit of code don't have access to AIX

Below is the relevant excerpt from gcc-4.7.0/libstdc++-v3/acinclude.m4:

----8<----
  AC_MSG_CHECKING([whether it can be safely assumed that mutex_timedlock is
available])

  AC_TRY_COMPILE([#include <unistd.h>],
    [
      // In case of POSIX threads check _POSIX_TIMEOUTS.
      #if (defined(_PTHREADS) \
      && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
      #error
      #endif
    ], [ac_gthread_use_mutex_timedlock=1], [ac_gthread_use_mutex_timedlock=0])

  AC_DEFINE_UNQUOTED(_GTHREAD_USE_MUTEX_TIMEDLOCK,
$ac_gthread_use_mutex_timedlock,
             [Define to 1 if mutex_timedlock is available.])

  if test $ac_gthread_use_mutex_timedlock = 1 ; then res_mutex_timedlock=yes ;
  else res_mutex_timedlock=no ; fi
  AC_MSG_RESULT([$res_mutex_timedlock])
---->8----

Neither _PTHREADS nor _POSIX_TIMEOUTS appear anywhere in /usr/include/.

I'm a little mystified as to why this test is relying entirely on feature test
macros, instead of checking for the existence of pthread_mutex_timedlock
directly...


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
  2012-05-04 20:22 ` [Bug bootstrap/53238] " redi at gcc dot gnu.org
  2012-05-04 20:34 ` skunk at iskunk dot org
@ 2012-05-04 20:58 ` redi at gcc dot gnu.org
  2012-05-05 16:21 ` skunk at iskunk dot org
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-04 20:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-04 20:57:34 UTC ---
_PTHREADS gets defined immediately above that test:

  target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
  case $target_thread_file in
    posix)
      CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
  esac

If you're using --enable-thread=posix then it should be defined.

pthread_mutex_timedlock is part of the POSIX Threads and Timeouts options, and
if that option is supported then _POSIX_TIMEOUTS must be defined.

http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_mutex_timedlock.html


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (2 preceding siblings ...)
  2012-05-04 20:58 ` redi at gcc dot gnu.org
@ 2012-05-05 16:21 ` skunk at iskunk dot org
  2012-05-05 17:43 ` redi at gcc dot gnu.org
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-05 16:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #4 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-05 16:05:30 UTC ---
(In reply to comment #3)
> If you're using --enable-thread=posix then it should be defined.

I haven't used --enable-thread=posix, and if I invoke ".../xgcc -v", I see
"Thread model: aix". So it seems the test passes because _PTHREADS is not
defined.

Shouldn't the cpp conditional in the test be written as

    #if !defined(_PTHREADS) || !defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <=
0

?


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (3 preceding siblings ...)
  2012-05-05 16:21 ` skunk at iskunk dot org
@ 2012-05-05 17:43 ` redi at gcc dot gnu.org
  2012-05-05 18:57 ` redi at gcc dot gnu.org
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-05 17:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-05-05
         AssignedTo|unassigned at gcc dot       |redi at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-05 17:40:29 UTC ---
Created attachment 27319
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27319
handle aix thread model

Ah, I see.  gthr-aix.h just does:

#ifdef _THREAD_SAFE
#include "gthr-posix.h"
#else
#include "gthr-single.h"
#endif

So it has everything in the posix thread model except the timedlock functions,
but doesn't match the case statement that only looks for "posix".

Your suggestion would work for the posix and aix thread models, but would break
e.g. win32, where _PTHREADS won't be defined but mutexes always support
timeouts (not that anyone has actually added __ghtread_mutex_timedlock to
gthr-win32.h yet, but they should do)

I think the right thing to do is define _PTHREADS for the aix thread model,
could you test this patch?  I've assumed that _THREAD_SAFE might be needed to
enable some thread-related features on AIX, I don't know if that's true.

An alternative patch would simply change  the case statement to match
posix|aix)


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (4 preceding siblings ...)
  2012-05-05 17:43 ` redi at gcc dot gnu.org
@ 2012-05-05 18:57 ` redi at gcc dot gnu.org
  2012-05-07 21:10 ` skunk at iskunk dot org
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-05 18:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-05 18:13:57 UTC ---
Created attachment 27320
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27320
diff of regenerated configure

N.B. you'll either need to run autoreconf or apply this patch to configure


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (5 preceding siblings ...)
  2012-05-05 18:57 ` redi at gcc dot gnu.org
@ 2012-05-07 21:10 ` skunk at iskunk dot org
  2012-05-08 18:44 ` skunk at iskunk dot org
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-07 21:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #7 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-07 21:09:43 UTC ---
(In reply to comment #6)
> Created attachment 27320 [details]
> diff of regenerated configure

Jonathan, thank you for the patch, and the regen.

I'm starting a new build to test the patch. This AIX machine runs rather slow,
so I'll need a few days to get back to you; please hold tight!


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (6 preceding siblings ...)
  2012-05-07 21:10 ` skunk at iskunk dot org
@ 2012-05-08 18:44 ` skunk at iskunk dot org
  2012-05-09 16:54 ` redi at gcc dot gnu.org
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-08 18:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #8 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-08 18:18:04 UTC ---
I did a non-bootstrap build to speed things up a bit. (The system already has
GCC 4.5.2.)

First: Your patch needs a couple of ";;" sprinkled in there :-)

Second: With the patch, after working around some unrelated integer-type
issues, I get the following error:

[...]
Making all in include
gmake[4]: Entering directory
`/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include'
mkdir -p ./powerpc-ibm-aix4.3.2.0/bits/stdc++.h.gch
/tmp/gcc-4.7.0/_build/./gcc/xgcc -shared-libgcc -B/tmp/gcc-4.7.0/_build/./gcc
-nostdinc++ -L/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/src
-L/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs
-B/opt/tg/powerpc-ibm-aix4.3.2.0/bin/ -B/opt/tg/powerpc-ibm-aix4.3.2.0/lib/
-isystem /opt/tg/powerpc-ibm-aix4.3.2.0/include -isystem
/opt/tg/powerpc-ibm-aix4.3.2.0/sys-include    -x c++-header -nostdinc++ -g -O2
-I/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0
-I/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include
-I/tmp/gcc-4.7.0/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x
/tmp/gcc-4.7.0/libstdc++-v3/include/precompiled/stdc++.h \
-o powerpc-ibm-aix4.3.2.0/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from
/tmp/gcc-4.7.0/libstdc++-v3/include/precompiled/stdc++.h:102:0:
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:62:13:
error: '__gthread_cond_t' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:67:5:
error: '__native_type' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:71:13:
error: '__native_type' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:141:5:
error: 'native_handle_type' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:
In member function 'std::cv_status
std::condition_variable::__wait_until_impl(std::unique_lock<std::mutex>&, const
std::chrono::time_point<_Clock, _Duration>&)':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:157:2:
error: '__gthread_time_t' was not declared in this scope
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:157:19:
error: expected ';' before '__ts'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:163:28:
error: '_M_cond' was not declared in this scope
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:164:7:
error: '__ts' was not declared in this scope
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:164:11:
error: there are no arguments to '__gthread_cond_timedwait' that depend on a
template parameter, so a declaration of '__gthread_cond_timedwait' must be
available [-fpermissive]
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/condition_variable:164:11:
note: (if you use '-fpermissive', G++ will accept your code, but allowing the
use of an undeclared name is deprecated)
In file included from
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/future:41:0,
                 from
/tmp/gcc-4.7.0/libstdc++-v3/include/precompiled/stdc++.h:104:
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: At
global scope:
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:63:13:
error: '__gthread_t' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:70:7:
error: 'native_handle_type' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:76:29:
error: expected ')' before '__id'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:174:5:
error: 'native_handle_type' does not name a type
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: In
constructor 'std::thread::id::id()':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:73:23:
error: class 'std::thread::id' does not have any field named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: In
function 'bool std::operator==(std::thread::id, std::thread::id)':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:84:36:
error: 'class std::thread::id' has no member named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:84:51:
error: 'class std::thread::id' has no member named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:84:60:
error: '__gthread_equal' was not declared in this scope
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: In
function 'bool std::operator<(std::thread::id, std::thread::id)':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:88:20:
error: 'class std::thread::id' has no member named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:88:36:
error: 'class std::thread::id' has no member named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: In
member function 'std::size_t std::hash<std::thread::id>::operator()(const
std::thread::id&) const':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:225:43:
error: 'const class std::thread::id' has no member named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: In
function 'std::basic_ostream<_CharT, _Traits>&
std::operator<<(std::basic_ostream<_CharT, _Traits>&, std::thread::id)':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:235:23:
error: 'class std::thread::id' has no member named '_M_thread'
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread: In
function 'std::thread::id std::this_thread::get_id()':
/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/thread:250:58:
error: '__gthread_self' was not declared in this scope
gmake[4]: *** [powerpc-ibm-aix4.3.2.0/bits/stdc++.h.gch/O2ggnu++0x.gch] Error 1
gmake[4]: Leaving directory
`/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3/include'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory
`/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/tmp/gcc-4.7.0/_build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[1]: *** [all-target-libstdc++-v3] Error 2
gmake[1]: Leaving directory `/tmp/gcc-4.7.0/_build'
gmake: *** [all] Error 2


__gthread_cond_t appears to be a typedef defined in gthr-posix.h. Re-running
the compiler invocation with -E shows that this header file isn't getting
pulled in anywhere.


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (7 preceding siblings ...)
  2012-05-08 18:44 ` skunk at iskunk dot org
@ 2012-05-09 16:54 ` redi at gcc dot gnu.org
  2012-05-12  8:35 ` skunk at iskunk dot org
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-09 16:54 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-09 16:44:07 UTC ---
Hmm, I guess this is for the case where gthr-aix.h includes gthr-single.h,
which doesn't define the C++11 interface.  The configure script determined that
_GLIBCXX_HAS_GTHREADS should be defined, but then that only works if
gthr-posix.h gets included.

A fix (maybe not the right one) would be to add the C++11 types and functions
to gthr-single.h and make it define __GTHREADS_CXX0X, so that <thread> can be
be compiled and the types found, even if the resulting classes can't actually
be used in single-threaded mode.  Another option would be for gthr-aix.h to
#undef _GLBCXX_HAS_GTHREADS in the non-_THREAD_SAFE case, but I think that
would be wrong, changing a property that should be fixed at configure time into
one that depends on switches being used or not when the user compiles code.

I won't be able to work on that until I'm back from holiday in two weeks, in
the meanwhile --disable-libstdcxx-threads should allow you to bootstrap, or
maybe just --disable-libstdcxx-pch


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (8 preceding siblings ...)
  2012-05-09 16:54 ` redi at gcc dot gnu.org
@ 2012-05-12  8:35 ` skunk at iskunk dot org
  2012-05-16  2:52 ` skunk at iskunk dot org
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-12  8:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #10 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-12 05:36:16 UTC ---
(In reply to comment #9)
> I won't be able to work on that until I'm back from holiday in two weeks, in
> the meanwhile --disable-libstdcxx-threads should allow you to bootstrap, or
> maybe just --disable-libstdcxx-pch

--disable-libstdcxx-pch isn't enough, alas:

[...]
libtool: compile:  /tmp/gcc-build/./gcc/xgcc -shared-libgcc
-B/tmp/gcc-build/./gcc -nostdinc++
-L/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/src
-L/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/src/.libs
-B/opt/tg/powerpc-ibm-aix4.3.2.0/bin/ -B/opt/tg/powerpc-ibm-aix4.3.2.0/lib/
-isystem /opt/tg/powerpc-ibm-aix4.3.2.0/include -isystem
/opt/tg/powerpc-ibm-aix4.3.2.0/sys-include -pthread
-I/home/src/gcc-4.7.0/libstdc++-v3/../libgcc
-I/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0
-I/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include
-I/home/src/gcc-4.7.0/libstdc++-v3/libsupc++ -Wall -Wextra -Wwrite-strings
-Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections
-fdata-sections -frandom-seed=eh_alloc.lo -g -pthread -c
/home/src/gcc-4.7.0/libstdc++-v3/libsupc++/eh_alloc.cc  -DPIC -o eh_alloc.o
In file included from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr-default.h:30:0,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr.h:150,
                 from
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/ext/concurrence.h:36,
                 from
/home/src/gcc-4.7.0/libstdc++-v3/libsupc++/eh_alloc.cc:37:
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr-posix.h:
In function 'int __gthread_mutex_timedlock(__gthread_mutex_t*, const
__gthread_time_t*)':
/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0/bits/gthr-posix.h:789:69:
error: 'pthread_mutex_timedlock' was not declared in this scope
gmake[9]: *** [eh_alloc.lo] Error 1
gmake[9]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3/libsupc++'
gmake[8]: *** [all-recursive] Error 1
gmake[8]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3'
gmake[7]: *** [all] Error 2
gmake[7]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/pthread/libstdc++-v3'
gmake[6]: *** [multi-do] Error 1
gmake[6]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[5]: *** [all-multi] Error 2
gmake[5]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[4]: *** [all-recursive] Error 1
gmake[4]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory
`/tmp/gcc-build/powerpc-ibm-aix4.3.2.0/libstdc++-v3'
gmake[2]: *** [all-stage1-target-libstdc++-v3] Error 2
gmake[2]: Leaving directory `/tmp/gcc-build'
gmake[1]: *** [stage1-bubble] Error 2
gmake[1]: Leaving directory `/tmp/gcc-build'
gmake: *** [bootstrap-lean] Error 2


Will try with --disable-libstdcxx-threads ...


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (9 preceding siblings ...)
  2012-05-12  8:35 ` skunk at iskunk dot org
@ 2012-05-16  2:52 ` skunk at iskunk dot org
  2012-05-16  3:11 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-05-16  2:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #11 from Daniel Richard G. <skunk at iskunk dot org> 2012-05-16 02:51:24 UTC ---
Okay, the bootstrap gets further this time. A couple of unrelated issues came
up which I was able to work around, but then I encountered this:

[...]
/tmp/gcc-build/./prev-gcc/g++ -B/tmp/gcc-build/./prev-gcc/
-B/opt/tg/powerpc-ibm-aix4.3.2.0/bin/ -nostdinc++
-B/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs
-B/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/libsupc++/.libs
-I/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0
-I/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/include
-I/home/src/gcc-4.7.0/libstdc++-v3/libsupc++
-L/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs
-L/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/libsupc++/.libs   -g
-O2 -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-static-libstdc++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o cc1
c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o
c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o
c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o
c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o
c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o
default-c.o rs6000-c.o \
  cc1-checksum.o main.o  libbackend.a libcommon-target.a libcommon.a
../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a
../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   
-L/tg/freeport/arch/aix32/lib -L/tg/freeport/arch/aix32/lib
-L/tg/freeport/arch/aix32/lib -lmpc -lmpfr -lgmp   -L../zlib -lz
ld: 0711-317 ERROR: Undefined symbol: vtable for std::ctype<char>
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
gmake[3]: *** [cc1] Error 1
gmake[3]: Leaving directory `/tmp/gcc-build/gcc'
gmake[2]: *** [all-stage2-gcc] Error 2
gmake[2]: Leaving directory `/tmp/gcc-build'
gmake[1]: *** [stage2-bubble] Error 2
gmake[1]: Leaving directory `/tmp/gcc-build'
gmake: *** [bootstrap-lean] Error 2


If I add -Wl,-bnoquiet to that, I get

[...]
ld: 0711-318 ERROR: Undefined symbols were found.
        The following symbols are in error:
 Symbol                    Inpndx  TY CL Source-File(Object-File) OR
Import-File{Shared-object}
                              RLD: Address  Section  Rld-type Referencing
Symbol

----------------------------------------------------------------------------------------------
 vtable for std::ctype<char> [16]    ER PR
ctype_configure_char.cc(/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs/libstdc++.a[ctype_configure_char.o])
                                   000008a4 .data    R_POS    [775]  
<_ZTVSt5ctypeIcE.P8>
ER: The return code is 8.
ld: 0711-317 ERROR: Undefined symbol: vtable for std::ctype<char>
collect2: error: ld returned 8 exit status


Seems like another issue in the vein of bug 52887. I can't make heads or tails
of C++ at this level; would another instantiation do the trick here?


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (10 preceding siblings ...)
  2012-05-16  2:52 ` skunk at iskunk dot org
@ 2012-05-16  3:11 ` redi at gcc dot gnu.org
  2012-06-10 22:39 ` skunk at iskunk dot org
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-05-16  3:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-05-16 03:05:51 UTC ---
IIRC that should already be instantiated


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (11 preceding siblings ...)
  2012-05-16  3:11 ` redi at gcc dot gnu.org
@ 2012-06-10 22:39 ` skunk at iskunk dot org
  2012-07-16 21:34 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-06-10 22:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #13 from Daniel Richard G. <skunk at iskunk dot org> 2012-06-10 22:39:36 UTC ---
Hi Jonathan,

I've checked and double-checked this, and was hoping you could offer some
insight:

I get the "Undefined symbol: vtable for std::ctype<char>" error only when
bootstrapping. If I build 4.7.0 with a previously-built C-only 4.7.0 +
--disable-bootstrap, everything else the same, the build completes
successfully.

Can you make anything of that?


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (12 preceding siblings ...)
  2012-06-10 22:39 ` skunk at iskunk dot org
@ 2012-07-16 21:34 ` redi at gcc dot gnu.org
  2012-07-19 19:25 ` skunk at iskunk dot org
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-16 21:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
         AssignedTo|redi at gcc dot gnu.org     |unassigned at gcc dot
                   |                            |gnu.org

--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-16 21:33:34 UTC ---
I still don't think it's the right thing to do, but does this help?

--- a/libgcc/config/rs6000/gthr-aix.h
+++ b/libgcc/config/rs6000/gthr-aix.h
@@ -30,6 +30,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If
not, see
 #include "gthr-posix.h"
 #else
 #include "gthr-single.h"
+#undef _GLIBCXX_HAS_GTHREADS
 #endif

 #endif /* GCC_GTHR_AIX_H */


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (13 preceding siblings ...)
  2012-07-16 21:34 ` redi at gcc dot gnu.org
@ 2012-07-19 19:25 ` skunk at iskunk dot org
  2012-07-19 21:11 ` skunk at iskunk dot org
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-07-19 19:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #15 from Daniel Richard G. <skunk at iskunk dot org> 2012-07-19 19:24:37 UTC ---
(In reply to comment #14)
> I still don't think it's the right thing to do, but does this help?

I'm trying this now, in conjunction with the patch posted at

    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53348#c7

So far, your change seems to address the O2ggnu++0x.gch error in the original
report above, as I encountered that before actually making the change.

(Bootstrap time on this system is measured in days, and I'll probably need to
do a second go-around, so let me get back to you...)


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (14 preceding siblings ...)
  2012-07-19 19:25 ` skunk at iskunk dot org
@ 2012-07-19 21:11 ` skunk at iskunk dot org
  2012-07-19 23:56 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-07-19 21:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #16 from Daniel Richard G. <skunk at iskunk dot org> 2012-07-19 21:10:28 UTC ---
Okay, spoke too soon; I encountered the same error later in the game, when
building the "pthread" variant of libstdc++-v3.

I'm going to try the build with a new patch, revisiting the code snippet in
comment #2:

--- libstdc++-v3/acinclude.m4    (revision 189681)
+++ libstdc++-v3/acinclude.m4    (working copy)
@@ -3282,13 +3282,18 @@

   AC_MSG_CHECKING([whether it can be safely assumed that mutex_timedlock is
available])

-  AC_TRY_COMPILE([#include <unistd.h>],
+  AC_TRY_COMPILE(
+    [
+      #include <stdlib.h>
+      #include <unistd.h>
+    ],
     [
       // In case of POSIX threads check _POSIX_TIMEOUTS.
       #if (defined(_PTHREADS) \
       && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
       #error
       #endif
+      return pthread_mutex_timedlock(NULL, NULL)
     ], [ac_gthread_use_mutex_timedlock=1], [ac_gthread_use_mutex_timedlock=0])

   AC_DEFINE_UNQUOTED(_GTHREAD_USE_MUTEX_TIMEDLOCK,
$ac_gthread_use_mutex_timedlock,


Since the code is being compiled as C++, linking is not necessary to get an
error in case the function is missing. Will this work any better as a solution
than my suggestion in comment #4? (Might an "#ifndef WIN32" in there be
helpful?)


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (15 preceding siblings ...)
  2012-07-19 21:11 ` skunk at iskunk dot org
@ 2012-07-19 23:56 ` redi at gcc dot gnu.org
  2012-07-20 17:44 ` skunk at iskunk dot org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-19 23:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-19 23:55:50 UTC ---
(In reply to comment #16)
> Will this work any better as a solution
> than my suggestion in comment #4?

No, it will fail on any non-posix platform, even if it provides a timed-lock
function on a mutex.

Just checking for _WIN32 doesn't help all the other platforms that are not
posix and are not win32

Between comment 5 (with missing ;;) and comment 14 it should work, I think.


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (16 preceding siblings ...)
  2012-07-19 23:56 ` redi at gcc dot gnu.org
@ 2012-07-20 17:44 ` skunk at iskunk dot org
  2012-07-23  4:21 ` skunk at iskunk dot org
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-07-20 17:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #18 from Daniel Richard G. <skunk at iskunk dot org> 2012-07-20 17:44:12 UTC ---
(In reply to comment #17)
> Between comment 5 (with missing ;;) and comment 14 it should work, I think.

Okay, I'm re-starting the build with those two changes (plus my omnibus patch)
applied to 4.7.1. Let's see where that goes over the weekend...


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (17 preceding siblings ...)
  2012-07-20 17:44 ` skunk at iskunk dot org
@ 2012-07-23  4:21 ` skunk at iskunk dot org
  2012-07-23  8:12 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-07-23  4:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #19 from Daniel Richard G. <skunk at iskunk dot org> 2012-07-23 04:20:33 UTC ---
The good news: The build gets past all of the pthreads-related errors described
here, so I think those two changes may be a workable solution.

The bad news: I'll still running up against this error:

/tmp/gcc-build/./prev-gcc/g++ -B/tmp/gcc-build/./prev-gcc/
-B/opt/tg/powerpc-ibm-aix4.3.2.0/bin/ -nostdinc++
-B/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs
-B/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/libsupc++/.libs
-I/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/include/powerpc-ibm-aix4.3.2.0
-I/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/include
-I/tg/freeport/src/gcc/gcc--4.7.1-tera/libstdc++-v3/libsupc++
-L/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/src/.libs
-L/tmp/gcc-build/prev-powerpc-ibm-aix4.3.2.0/libstdc++-v3/libsupc++/.libs   -g
-O2 -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing
-Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H
-static-libstdc++ -static-libgcc -Wl,-bbigtoc -Wl,-bmaxdata:0x40000000 -o cc1
c-lang.o c-family/stub-objc.o attribs.o c-errors.o c-decl.o c-typeck.o
c-convert.o c-aux-info.o c-objc-common.o c-parser.o tree-mudflap.o
c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o
c-family/c-format.o c-family/c-gimplify.o c-family/c-lex.o c-family/c-omp.o
c-family/c-opts.o c-family/c-pch.o c-family/c-ppoutput.o c-family/c-pragma.o
c-family/c-pretty-print.o c-family/c-semantics.o c-family/c-ada-spec.o
default-c.o rs6000-c.o \
  cc1-checksum.o main.o  libbackend.a libcommon-target.a libcommon.a
../libcpp/libcpp.a ../libdecnumber/libdecnumber.a libcommon.a
../libcpp/libcpp.a   ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a   
-L/tg/freeport/arch/aix32/lib -L/tg/freeport/arch/aix32/lib
-L/tg/freeport/arch/aix32/lib -lmpc -lmpfr -lgmp   -L../zlib -lz
ld: 0711-317 ERROR: Undefined symbol: vtable for std::ctype<char>
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
gmake[3]: *** [cc1] Error 1
gmake[3]: Leaving directory `/tmp/gcc-build/gcc'
gmake[2]: *** [all-stage2-gcc] Error 2
gmake[2]: Leaving directory `/tmp/gcc-build'
gmake[1]: *** [stage2-bubble] Error 2
gmake[1]: Leaving directory `/tmp/gcc-build'
gmake: *** [bootstrap-lean] Error 2


I really need help with this error---this seems to be along the lines of the
PatternCursor issue we saw the other day, only this one is more confusing. What
do you think is going on here?

(FWIW, the objects that want the missing symbol are the various instances of
ctype_configure_char.o, which appears to be built from
libstdc++-v3/config/os/aix/ctype_configure_char.cc. I *think* the std::ctype
template/class is defined in libstdc++-v3/include/bits/locale_facets.h.)


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (18 preceding siblings ...)
  2012-07-23  4:21 ` skunk at iskunk dot org
@ 2012-07-23  8:12 ` redi at gcc dot gnu.org
  2012-07-23 18:52 ` skunk at iskunk dot org
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-23  8:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #20 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-23 08:11:48 UTC ---
The vtable should be defined in the same file as ctype<char>::~ctype() i.e. in
libstdc++-v3/src/c++98/ctype.cc

You could try adding this to ctype.cc around line 54

  inline template class ctype<char>;

That's a GCC extension that explicitly instantiates the vtable.


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (19 preceding siblings ...)
  2012-07-23  8:12 ` redi at gcc dot gnu.org
@ 2012-07-23 18:52 ` skunk at iskunk dot org
  2015-02-06 17:33 ` dje at gcc dot gnu.org
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2012-07-23 18:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53238

--- Comment #21 from Daniel Richard G. <skunk at iskunk dot org> 2012-07-23 18:52:06 UTC ---
(In reply to comment #20)
> You could try adding this to ctype.cc around line 54

--- libstdc++-v3/src/c++98/ctype.cc.orig    2012-01-23 18:12:01.000000002 -0500
+++ libstdc++-v3/src/c++98/ctype.cc    2012-07-23 13:31:55.000000002 -0400
@@ -52,6 +52,8 @@

   const size_t ctype<char>::table_size;

+  inline template class ctype<char>;    // added by skunk
+
   ctype<char>::~ctype()
   { 
     _S_destroy_c_locale(_M_c_locale_ctype);


I rebuilt ctype.o and the libraries it goes into. Unfortunately, I still get
the link error. If I compare the output of "nm -A" on the old and new ctype.o
objects, I don't see a difference in the defined symbols.

The mangled form of "vtable for std::ctype<char>" is "_ZTVSt5ctypeIcE". If I
grep for that in "nm -A ctype.o", I see

    ctype.o:000017c0 d _ZTVSt5ctypeIcE.P8

but no instances without the ".P8" suffix. Looking through all the objects of
libstdc++, grep only turns up these:

    ctype_configure_char.o:         U _ZTVSt5ctypeIcE
    ctype_configure_char.o:000008a4 d _ZTVSt5ctypeIcE.P8

For comparison, I grepped for "_ZTVNSt6locale5facetE", the mangled form of
"vtable for std::locale::facet", and got the below:

    time_members.o:         U _ZTVNSt6locale5facetE
    time_members.o:00001778 d _ZTVNSt6locale5facetE.P8
    codecvt.o:         U _ZTVNSt6locale5facetE
    codecvt.o:000015d0 d _ZTVNSt6locale5facetE.P8
    locale-inst.o:         U _ZTVNSt6locale5facetE
    locale-inst.o:00023974 d _ZTVNSt6locale5facetE.P8
    wlocale-inst.o:         U _ZTVNSt6locale5facetE
    wlocale-inst.o:00023c2c d _ZTVNSt6locale5facetE.P8
    numeric_members.o:         U _ZTVNSt6locale5facetE
    numeric_members.o:00000e64 d _ZTVNSt6locale5facetE.P8
    ctype.o:         U _ZTVNSt6locale5facetE
    ctype.o:000017bc d _ZTVNSt6locale5facetE.P8
    monetary_members.o:         U _ZTVNSt6locale5facetE
    monetary_members.o:00001b80 d _ZTVNSt6locale5facetE.P8
    locale_init.o:         U _ZTVNSt6locale5facetE
    locale_init.o:00004a50 d _ZTVNSt6locale5facetE.P8
    ctype_configure_char.o:         U _ZTVNSt6locale5facetE
    ctype_configure_char.o:000008a0 d _ZTVNSt6locale5facetE.P8
    locale.o:00002b08 d _ZTVNSt6locale5facetE
    locale.o:00002b08 D _ZTVNSt6locale5facetE
    locale.o:00002b3c d _ZTVNSt6locale5facetE.P8


The fact of the symbol being a vtable for a template class appears to be
relevant. Maybe a different kind of explicit instantiation is needed?


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (20 preceding siblings ...)
  2012-07-23 18:52 ` skunk at iskunk dot org
@ 2015-02-06 17:33 ` dje at gcc dot gnu.org
  2015-02-06 19:02 ` skunk at iskunk dot org
  2021-07-18  7:19 ` pinskia at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2015-02-06 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (21 preceding siblings ...)
  2015-02-06 17:33 ` dje at gcc dot gnu.org
@ 2015-02-06 19:02 ` skunk at iskunk dot org
  2021-07-18  7:19 ` pinskia at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: skunk at iskunk dot org @ 2015-02-06 19:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Daniel Richard G. <skunk at iskunk dot org> ---
Still using AIX 4.3 here. The std::ctype<char> error has been particularly
nettlesome, as it's beyond my ken and I can't work around it.


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

* [Bug bootstrap/53238] Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope
  2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
                   ` (22 preceding siblings ...)
  2015-02-06 19:02 ` skunk at iskunk dot org
@ 2021-07-18  7:19 ` pinskia at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-18  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #23 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
aix4.3 is no longer supported so closing as won't fix.
The support was removed in GCC 7.

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

end of thread, other threads:[~2021-07-18  7:19 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-04 20:11 [Bug bootstrap/53238] New: Bootstrap failure: error: 'pthread_mutex_timedlock' was not declared in this scope skunk at iskunk dot org
2012-05-04 20:22 ` [Bug bootstrap/53238] " redi at gcc dot gnu.org
2012-05-04 20:34 ` skunk at iskunk dot org
2012-05-04 20:58 ` redi at gcc dot gnu.org
2012-05-05 16:21 ` skunk at iskunk dot org
2012-05-05 17:43 ` redi at gcc dot gnu.org
2012-05-05 18:57 ` redi at gcc dot gnu.org
2012-05-07 21:10 ` skunk at iskunk dot org
2012-05-08 18:44 ` skunk at iskunk dot org
2012-05-09 16:54 ` redi at gcc dot gnu.org
2012-05-12  8:35 ` skunk at iskunk dot org
2012-05-16  2:52 ` skunk at iskunk dot org
2012-05-16  3:11 ` redi at gcc dot gnu.org
2012-06-10 22:39 ` skunk at iskunk dot org
2012-07-16 21:34 ` redi at gcc dot gnu.org
2012-07-19 19:25 ` skunk at iskunk dot org
2012-07-19 21:11 ` skunk at iskunk dot org
2012-07-19 23:56 ` redi at gcc dot gnu.org
2012-07-20 17:44 ` skunk at iskunk dot org
2012-07-23  4:21 ` skunk at iskunk dot org
2012-07-23  8:12 ` redi at gcc dot gnu.org
2012-07-23 18:52 ` skunk at iskunk dot org
2015-02-06 17:33 ` dje at gcc dot gnu.org
2015-02-06 19:02 ` skunk at iskunk dot org
2021-07-18  7:19 ` pinskia 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).