autoconf check for RTLD_GLOBAL brokenness



I don't think the test for RTLD_GLOBAL brokenness on Tru64 UNIX is
correct. The test is:
  #include <dlfcn.h>
  #ifndef RTLD_GLOBAL
  #  define RTLD_GLOBAL 0
  #endif
  #ifndef RTLD_LAZY
  #  define RTLD_LAZY 0
  #endif
  int pthread_create;
  int main () {
      void *handle, *global, *local;
      global = &pthread_create;
      handle = dlopen ("libpthread.so", RTLD_GLOBAL | RTLD_LAZY);
      if (!handle) return 0;
      local = dlsym (handle, "pthread_create");
      return global == local;
  }

The /usr/shlib/libpthread.so file doesn't have the symbol
pthread_create:
  $ nm /usr/shlib/libpthread.so | grep pthread_create
  __pthread_create                 | 0004395904808672 | T | 0000000000000008

This comes from a redefinition in <pthread.h>
  #ifdef _PTHREAD_USE_MANGLED_NAMES_
  # ifdef _PTHREAD_USE_PTDNAM_
  #  pragma extern_prefix "__"
  # else
  #  define pthread_create __pthread_create
  # endif
  #endif

So, should we replace "pthread_create" by "__pthread_create"?

-- 
albert chin (china thewrittenword com)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]