Skip to content

Conversation

@12101111
Copy link

@12101111 12101111 commented Oct 5, 2025

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

The workaround of musl is only needed if musl is static linked, and don't work when musl is dynamically linked.

> readelf -s /usr/lib/libc.a | grep pthread_create
    47: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND pthread_create
    30: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND pthread_create
    24: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND pthread_create
File: /usr/lib/libc.a(pthread_create.lo)
     1: 0000000000000000     0 FILE    LOCAL  DEFAULT   ABS pthread_create.c
    12: 0000000000000000     0 SECTION LOCAL  DEFAULT    14 .text.__pthread_create
    57: 0000000000000000  1765 FUNC    GLOBAL HIDDEN     14 __pthread_create
    81: 0000000000000000  1765 FUNC    WEAK   DEFAULT    14 pthread_create
    12: 0000000000000000     0 NOTYPE  GLOBAL HIDDEN    UND __pthread_create
    28: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND pthread_create
> readelf -s /usr/lib/libc.so | grep pthread_create
  1507: 00000000000b29d0  1765 FUNC    WEAK   DEFAULT    11 pthread_create
  1811: 0000000000000000     0 FILE    LOCAL  DEFAULT   ABS pthread_create.c
  1822: 00000000000b29d0  1765 FUNC    LOCAL  HIDDEN     11 __pthread_create
  2217: 00000000000b29d0  1765 FUNC    WEAK   DEFAULT    11 pthread_create

Just use the dlsym path when musl is dynamically linked.

Related Issues

None

@12101111 12101111 requested a review from Jake-Shadle as a code owner October 5, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant