Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update musl to v1.2.2 #13006

Merged
merged 1 commit into from
Nov 9, 2021
Merged

Update musl to v1.2.2 #13006

merged 1 commit into from
Nov 9, 2021

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Dec 10, 2020

The changes here mostly come from running the update_musl.py script
against the following commit:

https://github.com/emscripten-core/musl/tree/merge_v1.2.2

Notes:

  • weak is defined in musl-internal headers so some of our usage of
    __attribute__((weak)) was switched to __weak__ (which is a
    synonym).

  • Quite a few changes needed in library_pthread.js due to changes to
    the internal representation of __pthread struct in C.

    • removal of emscripten-specific threadStatus field. This can
      can be fully replaced with the updated detach_state that
      was added to musl (along with enum values for states!) along
      with the existing cancel bit.
    • attr is no longer stored on __pthread; it was only duplicating
      other fields anyway. We now include pthread_getattr_np.c which
      can pull those field out on demand into at attr structure.

Fixes: #8740

@sbc100 sbc100 force-pushed the update_musl_script branch 3 times, most recently from 7b7d0c6 to dbcfac4 Compare January 16, 2021 16:34
@sbc100 sbc100 force-pushed the update_musl branch 3 times, most recently from 870e53a to 8ad514f Compare January 19, 2021 01:15
@sbc100 sbc100 force-pushed the update_musl_script branch 2 times, most recently from 364a812 to 148de5a Compare January 20, 2021 19:21
Base automatically changed from update_musl_script to master January 20, 2021 23:13
@sbc100 sbc100 changed the title [WIP] Update musl to v1.2.1 [WIP] Update musl to v1.2.2 Feb 23, 2021
@sbc100 sbc100 force-pushed the update_musl branch 3 times, most recently from 9f8eb3a to d24d4e3 Compare February 24, 2021 16:21
@sbc100 sbc100 changed the title [WIP] Update musl to v1.2.2 Update musl to v1.2.2 Feb 24, 2021
@sbc100 sbc100 requested a review from kripken February 24, 2021 16:23
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Please update the changelog and the readme.

What is the cause of the code size regressions?

Base automatically changed from master to main March 8, 2021 23:49
@sbc100 sbc100 force-pushed the update_musl branch 3 times, most recently from b81af8a to e1bf2e6 Compare April 24, 2021 00:19
@sbc100
Copy link
Collaborator Author

sbc100 commented Apr 24, 2021

Updated with thread state management that matched more closely the the way musl does it. We now use musl's detach_state for in __pthread which now has an enum of different values.

@sbc100 sbc100 force-pushed the update_musl branch 2 times, most recently from ec6001f to 39bcb01 Compare April 24, 2021 01:56
@sbc100 sbc100 deleted the update_musl branch November 9, 2021 23:56
@kripken
Copy link
Member

kripken commented Nov 10, 2021

Excellent! Thanks for all the work here @sbc100 & @kleisauke !

@kleisauke kleisauke restored the update_musl branch November 10, 2021 08:49
@kleisauke kleisauke deleted the update_musl branch November 10, 2021 08:49
sbc100 added a commit that referenced this pull request Nov 11, 2021
We had some reports of missing symbols in LTO builds after
the musl upgrade (#13006):
https://groups.google.com/g/emscripten-discuss/c/g_vkRRSCPUI/m/aT6fnUAtCQAJ?utm_medium=email&utm_source=footer

This change moves some of the new math-related source files
into the libc-mt library which is excluded from LTO (see comments
in in system_libs.py for background on this).

Verified that `lto2.test_float_builtinsTest` now passes with this
change but fails without (after musl upgrade).
sbc100 added a commit that referenced this pull request Nov 11, 2021
This test started failing after this line was added as part of #13006.
However it seems this change was unneeded.

See: #15498
sbc100 added a commit that referenced this pull request Nov 12, 2021
This test started failing after this line was added as part of #13006.
However it seems this change was unneeded.

See: #15498
sbc100 added a commit that referenced this pull request Nov 12, 2021
We have had reports of missing symbols in LTO builds after
the musl upgrade (#13006):
https://groups.google.com/g/emscripten-discuss/c/g_vkRRSCPUI/m/aT6fnUAtCQAJ?utm_medium=email&utm_source=footer

Also `lto2.test_float_builtinsTest` started failing on the
emscripten-releases FYI waterfall.

This change moves some of the new math-related source files
into the libc-mt library which is excluded from LTO (see comments
in in system_libs.py for background on this).

Fixes: #15506
sbc100 added a commit that referenced this pull request Nov 12, 2021
We have had reports of missing symbols in LTO builds after
the musl upgrade (#13006):
https://groups.google.com/g/emscripten-discuss/c/g_vkRRSCPUI/m/aT6fnUAtCQAJ?utm_medium=email&utm_source=footer

Also `lto2.test_float_builtinsTest` started failing on the
emscripten-releases FYI waterfall.

This change moves some of the new math-related source files
into the libc-mt library which is excluded from LTO (see comments
in in system_libs.py for background on this).

Fixes: #15506
aardappel added a commit to aardappel/emscripten that referenced this pull request Nov 15, 2021
Regression introduced here: emscripten-core#13006
We are relying on them having 10 elems thru the `_a_prio` field and also offsets in library_pthread.js
aardappel added a commit to aardappel/emscripten that referenced this pull request Nov 15, 2021
Regression introduced here: emscripten-core#13006
We are relying on them having 10 elems thru the `_a_prio` field (in wasm64) and also offsets in library_pthread.js
aardappel added a commit that referenced this pull request Nov 15, 2021
Regression introduced here: #13006
We are relying on them having 10 elems thru the `_a_prio` field (in wasm64) and also offsets in library_pthread.js
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
The changes here mostly come from running the update_musl.py script
against the following commit:

https://github.com/emscripten-core/musl/tree/merge_v1.2.2

Notes:

- `weak` is defined in musl-internal headers so some of our usage of
  `__attribute__((weak))` was switched to `__weak__` (which is a
  synonym).

- Quite a few changes needed in library_pthread.js due to changes to
  the internal representation of __pthread struct in C.
  - removal of emscripten-specific threadStatus field.  This can
    can be fully replaced with the updated `detach_state` that
    was added to musl (along with enum values for states!) along
    with the existing `cancel` bit.
  - `attr` is no longer stored on `__pthread`; it was only duplicating
    other fields anyway.  We now include `pthread_getattr_np.c` which
    can pull those field out on demand into at attr structure.
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
This test started failing after this line was added as part of emscripten-core#13006.
However it seems this change was unneeded.

See: emscripten-core#15498
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
We have had reports of missing symbols in LTO builds after
the musl upgrade (emscripten-core#13006):
https://groups.google.com/g/emscripten-discuss/c/g_vkRRSCPUI/m/aT6fnUAtCQAJ?utm_medium=email&utm_source=footer

Also `lto2.test_float_builtinsTest` started failing on the
emscripten-releases FYI waterfall.

This change moves some of the new math-related source files
into the libc-mt library which is excluded from LTO (see comments
in in system_libs.py for background on this).

Fixes: emscripten-core#15506
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
Regression introduced here: emscripten-core#13006
We are relying on them having 10 elems thru the `_a_prio` field (in wasm64) and also offsets in library_pthread.js
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 20, 2023
This mirrors an upstream change in musl
(emscripten-core/musl@7cc79d10) and should
really have been done as part of emscripten-core#13006.

With had report from a user who was injecting emscripten's
`sysroot/include` path explicitly putting it before the clang's builtin
include path which triggered `__LONG_MAX` to be undefined.
sbc100 added a commit to sbc100/emscripten that referenced this pull request Nov 20, 2023
This mirrors an upstream change in musl
(emscripten-core/musl@7cc79d10) and should
really have been done as part of emscripten-core#13006.

With had report from a user who was injecting emscripten's
`sysroot/include` path explicitly putting it before the clang's builtin
include path which triggered `__LONG_MAX` to be undefined.
sbc100 added a commit that referenced this pull request Nov 20, 2023
This mirrors an upstream change in musl
(emscripten-core/musl@7cc79d10) and should
really have been done as part of #13006.

With had report from a user who was injecting emscripten's
`sysroot/include` path explicitly putting it before the clang's builtin
include path which triggered `__LONG_MAX` to be undefined.
br0nk pushed a commit to br0nk/emscripten that referenced this pull request Nov 29, 2023
This mirrors an upstream change in musl
(emscripten-core/musl@7cc79d10) and should
really have been done as part of emscripten-core#13006.

With had report from a user who was injecting emscripten's
`sysroot/include` path explicitly putting it before the clang's builtin
include path which triggered `__LONG_MAX` to be undefined.
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.

Upgrade musl to latest release pthread_key_create does not initialize thread local variable with null
4 participants