bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/23424] New: gold doesn't build on Darwin


From: harryf at gmx dot com
Subject: [Bug gold/23424] New: gold doesn't build on Darwin
Date: Tue, 17 Jul 2018 11:47:52 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23424

            Bug ID: 23424
           Summary: gold doesn't build on Darwin
           Product: binutils
           Version: 2.31
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: harryf at gmx dot com
                CC: ian at airs dot com
  Target Milestone: ---

Created attachment 11141
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11141&action=edit
Proposed patch

gold-thread.cc doesn't compile on latest macOS / Darwin:

gold-threads.cc:288:13: error: expected expression
    : once_(PTHREAD_ONCE_INIT)
            ^
/usr/include/pthread.h:210:27: note: expanded from macro 'PTHREAD_ONCE_INIT'
#define PTHREAD_ONCE_INIT {_PTHREAD_ONCE_SIG_init, {0}}


It seems that using PTHREAD_ONCE_INIT can only be used in a static context, as
documented in the man page (https://linux.die.net/man/3/pthread_once). Since
it's POD, doing a deep copy with a statically initialized dummy should be a
pragmatic workaround (see attached patch).


Side note - the man page says that "The behavior of pthread_once() is undefined
if once_control has automatic storage duration", which might happen when using
the Once class.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]