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.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils