[ATfE] Cherrypick libc fixes for ATfE 22 release#693
Merged
voltur01 merged 5 commits intoarm:release/arm-software/22.xfrom Jan 22, 2026
Merged
[ATfE] Cherrypick libc fixes for ATfE 22 release#693voltur01 merged 5 commits intoarm:release/arm-software/22.xfrom
voltur01 merged 5 commits intoarm:release/arm-software/22.xfrom
Conversation
Semihosting SYS_READ call on stdin just returns immediately indicating no data was read, thus rendering stdin unusable with QEMU. SYS_READC blocks and waits for one symbol to be read from the terminal, however Enter key specifically is returned as '\r', thus the special case (that may not generalize well beyond QEMU). (cherry picked from commit b407fd6)
After llvm/llvm-project#174967 RUNTIMES_USE_LIBC=llvm-libc option provides all necessary defines for libcxx to work with LLVM libc. (cherry picked from commit 227f790)
…de (arm#678) LLVM libc does not provide a way to redefine abort(), thus the local abort() definition in LLVM libc semihosting has to be removed. Calls to abort() in LLVM libc crt0 replaced with __llvm_libc_exit() which is the LLVM libc defined platform specific exit handler. This prevents exception handlers from crashing because of the trap instruction in LLVM libc implementation of abort(). (cherry picked from commit 6859f67)
This removes the TODO comment to implement cleanup like calling cxa_finalize. It was confirmed and captured in the updated comment that this is already done by LLVM libc's exit() implementation. (cherry picked from commit 3872774)
Provide init and exit handlers for not hosted environments in llvm libc crt0. Update the documentation accordingly. Update the UART sample to make use of the symbols provided in crt0 and refine the comments for the remaining symbols related to IO retargeting. (cherry picked from commit ab657ec)
dcandler
approved these changes
Jan 22, 2026
HugoSilvaSantos
approved these changes
Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This applies the following changes to 22.x release branch:
#667
[ATfE] Use semihosting SYS_READC for stdin with llvm libc
#676
[ATfE] Remove LLVM_LIBC define workaround for libcxx
#678
[ATfE] Replace call to abort with __llvm_libc_exit in libc startup code
#679
[ATfE] Update comment about handling cleanup for exit()
#683
[ATfE] Provide nohost init and exit in llvmlibc startup code