[llvm-bugs] [Bug 27677] New: pthread refactor (r268734) broke threading on OpenIndiana (__sun__)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat May 7 09:40:21 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27677

            Bug ID: 27677
           Summary: pthread refactor (r268734) broke threading on
                    OpenIndiana (__sun__)
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mgorny at gentoo.org
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

The pthread refactor code in r268734 added the following conditional:

// Thread API
#ifndef _LIBCPP_HAS_NO_THREADS
# if defined(__FreeBSD__) || \
    defined(__NetBSD__) || \
    defined(__linux__) || \
    defined(__APPLE__) || \
    defined(__CloudABI__)
#  define _LIBCPP_THREAD_API_PTHREAD
# else
#  error "No thread API"
# endif // _LIBCPP_THREAD_API
#endif // _LIBCPP_HAS_NO_THREADS


This means that having threading support enabled results in build failure on
OpenIndiana (Solaris).

The easy way out would to be to add __sun__ to the above list of defines. I
think that would be fine if libc++ doesn't intend to support Solaris threads
anytime soon.

The hard way would probably be to use something like:

  (defined(__sun__) && defined(_PTHREADS))

which is the common indicator that POSIX threads are being requested. The
latter define is set by 'gcc -pthread' and 'pathcc -pthread'. However, in order
to have that working correctly you would have to actually pass '-pthread' to
the compiler rather than '-lpthread' that is being passed now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160507/ae9caf48/attachment.html>


More information about the llvm-bugs mailing list