Skip to content

Update llvm-libc from LLVM 21.1.8 to 22.1.8#27374

Open
aheejin wants to merge 13 commits into
emscripten-core:mainfrom
aheejin:update_llvm_libc_22
Open

Update llvm-libc from LLVM 21.1.8 to 22.1.8#27374
aheejin wants to merge 13 commits into
emscripten-core:mainfrom
aheejin:update_llvm_libc_22

Conversation

@aheejin

@aheejin aheejin commented Jul 17, 2026

Copy link
Copy Markdown
Member

This updates llvm-libc from 2l.1.8 to LLVM 22.1.8:
https://github.com/llvm/llvm-project/releases/tag/llvmorg-22.1.8

Additional changes:

  • Exclude more files using mbstate_t: 76f80f4
    We are already excluding some files because the overlay mode doesn't support mbstate_t. There are new files using this and also some file have moved to src/stdlib. This adds those files to the excludes list.

  • Exclude more files using locale_t: 90f338b
    We are already excluding some file patterns using locale_t in update_llvm_libc.py. This adds more new files to it.

  • Add llvmlibc test mode to runner.py: 58736a9
    We have llvmlibc test mode in test_core.py but not in runner.py. Adds this to misc_test_modes.

All tests pass with

./test/runner llvmlibc

aheejin added 6 commits July 17, 2026 20:50
We are already excluding some files because the overlay mode doesn't
support `mbstate_t`. There are new files using this and also some file
have moved to `src/stdlib`. This adds those files to the excludes list.
We are already excluding some file patterns using `locale_t` in
`update_llvm_libc.py`. This adds more new files to it.
We have `llvmlibc` test mode in `test_core.py` but not in `runner.py`.
Adds this to `misc_test_modes`.
@aheejin
aheejin marked this pull request as ready for review July 18, 2026 07:27
@aheejin
aheejin requested review from google-yfyang and sbc100 July 18, 2026 07:30
@aheejin

aheejin commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

One thing that's inconsistent is we have two different way of excluding files. float16 and locale_t-related files are excluded when copying files in update_llvm_libc.py,

libc_exclusion_patterns = [
# float16 is unsupported in Emscripten.
'src/complex/**/*f16*',
'src/math/generic/*f16*',
'src/setjmp/**/*', # setjmp in Emscripten is implemented by the clang backend.
'src/strings/str*casecmp_l*', # locale_t is unsupported in Overlay Mode.
]

while mbstate_t-related files are copied normally but excluded in build in system_libs.py:
# Overlay mode doesn't support mbstate_t which is used by these wchar sources.
files += glob_in_path('system/lib/llvm-libc/src/wchar', '*.cpp', excludes={'wcrtomb.cpp', 'mbrtowc.cpp', 'wctomb.cpp', 'mbtowc.cpp'})

I just followed the existing methods here, but in case you think it's better to be consistent, I can use one or the other in a followup.

Comment thread system/lib/llvm-libc/README.md Outdated
@@ -34,4 +34,4 @@ Modifications

For a list of changes from upstream see the libcxx files that are part of:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should probably say see the libc files?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed

@aheejin
aheejin enabled auto-merge (squash) July 20, 2026 00:34
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.

2 participants