libsyscall: Fix os_alloc_table not being exported in the static build

I had to re-apply the old fix that I accidentally removed when I updated libsyscall
This commit is contained in:
Ariel Abreu 2020-07-02 11:54:16 -04:00
parent 884b195e31
commit 47f180dcca
No known key found for this signature in database
GPG Key ID: F4D43CC7053EA2B3

View File

@ -36,4 +36,10 @@ struct _os_alloc_once_s {
__attribute__((visibility("default")))
extern struct _os_alloc_once_s _os_alloc_once_table[];
#ifdef DARLING
// for some reason, the linker doesn't see uninitialized symbols in static libraries
// so we need to initialize this so dyld can use it
struct _os_alloc_once_s _os_alloc_once_table[OS_ALLOC_ONCE_KEY_MAX] = { 0 };
#else
struct _os_alloc_once_s _os_alloc_once_table[OS_ALLOC_ONCE_KEY_MAX];
#endif