Those sources are for non-Darwin platforms. On Darwin platforms,
libdispatch uses libsystem_blocks instead.
Additionally, this was causing issues because both libdispatch and
libsystem_blocks were exporting the block class globals, but only one of
them could be exported by libSystem, and which one gets exported was
at the whim of whatever dyld decided at runtime.
Leaving it on would require us to use HAVE_PTHREAD_WORKQUEUE_QOS.
This fixes some crashes in LLDB. It still doesn't work 100% as it does on master, but at least it doesn't crash unexpectedly now.
This hack fixes crashes when the manager root queue is passed to a worker thread. (This was happening because of `_dispatch_kq_init` queuing up the manager thread).
Not sure if Apple's code was intentionally broken (i.e. maybe we're using an unsupported configuration) or if it was accidental, but either way, this most definitely feels like a hack (but it *does* prevent libdispatch from crashing, and I'm fairly limited in my debug capabilities at the moment to be able to tell if events are actually getting processed as they should).
Don't know what happened before; I had to enable pthread QoS to get it to build. Now, it works just fine with it disabled. It makes zero sense. I'm pretty sure I didn't change anything that should affect that. Whatever, I'll take the win.
In other news, I also fixed the build (failing with undefined symbols) by adding src/shims/yield.c and disabling an Objective-C class conditionally (that conditional really should be in the upstream sources as well, but it's not)
Note: this *builds* but I'm not sure if it *runs*. Especially because of I had to enable a feature that was previously disabled in order to make it compile: kevent QoS.
P.S. to Apple: Would you mind making sure your code compiles for each "supported" configuration? Or otherwise just remove them entirely? Thanks.
There was an issue where a symbol that was created as an alias was
present in the final dylib but not the first pass dylib. Some
inspection of the circular library function found that the issue is
those flags were not having an effect on the first pass dylib
because they should be passed in as a parameter of the function.