Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 44bc3a7d8e1f0eb5d93e9298f92790858cbc9b3e
Ticket: 217963ffffffffffffffffffffffffffffffffff
tcl & tk's configure fails to correctly detect pthread_mutex
User & Date: nobody on 2000-10-26 00:46:52
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 4360 Bug
    Version: 8.3
    SubmitDate: '2000-03-10'
    LastModified: '2000-03-10'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: ericm
    RelatedBugIDs: 4359
    OS: Digital Unix
    OSVersion: Tru64 Unix 4.0f with current patches
    Machine: alpha ev56-based workstation
    FixedDate: '2000-10-25'
    ClosedDate: '2000-03-10'
    
    
    Name:
    Tim Mooney
    
    ReproducibleScript:
    Tcl and Tk have autoconf tests that don't correctly detect how to get full POSIX thread support on
    Digital/Tru64 Unix.  The problem is that many of the functions in libpthread.so are named with a __
    prepended to the function name.  If you include `pthread.h', you get defines that map the
    expected names to the actual symbols in the library.  If you don't include pthread.h, you don't have
    those and the AC_CHECK_LIB(pthread,pthread_mutex_init,...) therefore doesn't detect that you
    only need that library.  It then checks for pthread_mutex_init in the older `libpthreads.so', which has
    a DECthreads/early POSIX interface.  It does find it in there,  and `-lpthreads' is then (incorrectly)
    added to the list of libraries.  Meanwhile, `-pthread' is added to CFLAGS and LDFLAGS, so `-lpthread' is automatically linked in.  This means that we're linking with both the newer `pthread' library and the
    earlier `pthreads' library, which may cause problems.
    
    The relevant output from configure for tcl:
    
    checking for building with threads... yes
    checking for pthread_mutex_init in -lpthread... no
    checking for pthread_mutex_init in -lpthreads... yes
    
    DesiredBehavior:
    Tcl & Tk's thread tests need to use AC_TRY_COMPILE to find pthread_mutex_init, since AC_TRY_COMPILE allows you to specify necessary includes.  This only needs to be attempted
    if we didn't find pthread_mutex_init in -lpthread with the AC_CHECK_LIB.
    
    I'm included a patch that fixes this for Tcl & Tk.
    
    Patch:
    The patches are at:
    
    ftp://dogbert.cc.ndsu.nodak.edu/pub/tcl-8.3.0-pthread-configure.patch
    ftp://dogbert.cc.ndsu.nodak.edu/pub/tk-8.3.0-pthread-configure.patch
    
    PatchFiles:
    tcl8.3.0/unix/tcl.m4
        tk8.3.0/unix/aclocal.m4
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.3"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to:
    tcl & tk's configure fails to correctly detect pthread_mutex
    
  11. type changed to: "Bug"