/ Check-in [9c3a0dc2]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Look for pthread_mutexattr_init() instead of pthread_create() in autoconf scripts, to work around issues with ASAN.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9c3a0dc2e8bf202cd846841bd5d4ea67aa189c1a
User & Date: drh 2016-01-13 21:23:48
Context
2016-01-14
01:56
Fix the build so that it works for SQLITE_OMIT_WAL again. check-in: d55a557b user: drh tags: trunk
2016-01-13
21:23
Look for pthread_mutexattr_init() instead of pthread_create() in autoconf scripts, to work around issues with ASAN. check-in: 9c3a0dc2 user: drh tags: trunk
18:25
Add documentation for new API functions to the comments in fts5.h. check-in: 14d296fa user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to autoconf/configure.ac.

    69     69   #
    70     70   AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING(
    71     71     [--enable-threadsafe], [build a thread-safe library [default=yes]])], 
    72     72     [], [enable_threadsafe=yes])
    73     73   THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0
    74     74   if test x"$enable_threadsafe" != "xno"; then
    75     75     THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1"
    76         -  AC_SEARCH_LIBS(pthread_create, pthread)
           76  +  AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
    77     77   fi
    78     78   AC_SUBST(THREADSAFE_FLAGS)
    79     79   #-----------------------------------------------------------------------
    80     80   
    81     81   #-----------------------------------------------------------------------
    82     82   #   --enable-dynamic-extensions
    83     83   #

Changes to configure.

 10460  10460     SQLITE_THREADSAFE=1
 10461  10461     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 10462  10462   $as_echo "yes" >&6; }
 10463  10463   fi
 10464  10464   
 10465  10465   
 10466  10466   if test "$SQLITE_THREADSAFE" = "1"; then
 10467         -  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5
 10468         -$as_echo_n "checking for library containing pthread_create... " >&6; }
 10469         -if ${ac_cv_search_pthread_create+:} false; then :
        10467  +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutexattr_init" >&5
        10468  +$as_echo_n "checking for library containing pthread_mutexattr_init... " >&6; }
        10469  +if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
 10470  10470     $as_echo_n "(cached) " >&6
 10471  10471   else
 10472  10472     ac_func_search_save_LIBS=$LIBS
 10473  10473   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 10474  10474   /* end confdefs.h.  */
 10475  10475   
 10476  10476   /* Override any GCC internal prototype to avoid an error.
 10477  10477      Use char because int might match the return type of a GCC
 10478  10478      builtin and then its argument prototype would still apply.  */
 10479  10479   #ifdef __cplusplus
 10480  10480   extern "C"
 10481  10481   #endif
 10482         -char pthread_create ();
        10482  +char pthread_mutexattr_init ();
 10483  10483   int
 10484  10484   main ()
 10485  10485   {
 10486         -return pthread_create ();
        10486  +return pthread_mutexattr_init ();
 10487  10487     ;
 10488  10488     return 0;
 10489  10489   }
 10490  10490   _ACEOF
 10491  10491   for ac_lib in '' pthread; do
 10492  10492     if test -z "$ac_lib"; then
 10493  10493       ac_res="none required"
 10494  10494     else
 10495  10495       ac_res=-l$ac_lib
 10496  10496       LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
 10497  10497     fi
 10498  10498     if ac_fn_c_try_link "$LINENO"; then :
 10499         -  ac_cv_search_pthread_create=$ac_res
        10499  +  ac_cv_search_pthread_mutexattr_init=$ac_res
 10500  10500   fi
 10501  10501   rm -f core conftest.err conftest.$ac_objext \
 10502  10502       conftest$ac_exeext
 10503         -  if ${ac_cv_search_pthread_create+:} false; then :
        10503  +  if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
 10504  10504     break
 10505  10505   fi
 10506  10506   done
 10507         -if ${ac_cv_search_pthread_create+:} false; then :
        10507  +if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
 10508  10508   
 10509  10509   else
 10510         -  ac_cv_search_pthread_create=no
        10510  +  ac_cv_search_pthread_mutexattr_init=no
 10511  10511   fi
 10512  10512   rm conftest.$ac_ext
 10513  10513   LIBS=$ac_func_search_save_LIBS
 10514  10514   fi
 10515         -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_create" >&5
 10516         -$as_echo "$ac_cv_search_pthread_create" >&6; }
 10517         -ac_res=$ac_cv_search_pthread_create
        10515  +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutexattr_init" >&5
        10516  +$as_echo "$ac_cv_search_pthread_mutexattr_init" >&6; }
        10517  +ac_res=$ac_cv_search_pthread_mutexattr_init
 10518  10518   if test "$ac_res" != no; then :
 10519  10519     test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
 10520  10520   
 10521  10521   fi
 10522  10522   
 10523  10523   fi
 10524  10524   

Changes to configure.ac.

   190    190   else
   191    191     SQLITE_THREADSAFE=1
   192    192     AC_MSG_RESULT([yes])
   193    193   fi
   194    194   AC_SUBST(SQLITE_THREADSAFE)
   195    195   
   196    196   if test "$SQLITE_THREADSAFE" = "1"; then
   197         -  AC_SEARCH_LIBS(pthread_create, pthread)
          197  +  AC_SEARCH_LIBS(pthread_mutexattr_init, pthread)
   198    198   fi
   199    199   
   200    200   ##########
   201    201   # Do we want to support release
   202    202   #
   203    203   AC_ARG_ENABLE(releasemode, 
   204    204   AC_HELP_STRING([--enable-releasemode],[Support libtool link to release mode]),,enable_releasemode=no)