This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add compile options to pthread_create target.
ClosedPublic

Authored by sivachandra on Jun 9 2022, 12:06 AM.

Details

Summary

The compile options now match that of thrd_create. Two compile options
are of importance:

  1. -O3 - This is required so that stack is not used between the clone syscall and the start function in the child thread.
  2. -fno-omit-frame-pointer - This is required so that we can sniff out the thread start args from the child thread's stack memory.

Without these two options, pthread_create will exhibit flaky behavior.

Diff Detail

Event Timeline

sivachandra created this revision.Jun 9 2022, 12:06 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 9 2022, 12:06 AM
sivachandra requested review of this revision.Jun 9 2022, 12:06 AM
lntue accepted this revision.Jun 9 2022, 7:50 AM
This revision is now accepted and ready to land.Jun 9 2022, 7:50 AM
This revision was automatically updated to reflect the committed changes.