Skip to content

Commit

Permalink
Disable microthread main thread for glibc
Browse files Browse the repository at this point in the history
  • Loading branch information
fwsGonzo committed Oct 22, 2023
1 parent 00dc50a commit ad1e7aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions binaries/barebones/libc/microthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ namespace microthread
__builtin_unreachable();
}

/* glibc sets up its own main thread, *required* by C++ exceptions */
#ifndef __GLIBC__
__attribute__((constructor, used))
static void init_threads()
{
microthread_set_tp(&main_thread);
}
#endif
}

asm(".section .text\n"
Expand Down

0 comments on commit ad1e7aa

Please sign in to comment.