Added libc functionalities#26
Open
scratch-er wants to merge 4 commits into
Open
Conversation
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 PR introduces many standard libc functionalities, including:
ctypesupportstdlibfeatures (excludingmallocandfree)printffunctionality, except for floating-point formattingputcharandputsAdditionally, it addresses the following issue:
memcmphad a signature that did not conform to the standard.The added libc functions are sourced from Sonnet libc. I also replaced the original
printfin the ECOS SDK with theprintffrom Sonnet libc, which supports all standard format specifiers except floating-point numbers. I am the author of Sonnet libc. By submitting this PR, I license all contributed code under the Apache License, as used by the ECOS SDK.I planned to include
mallocsupport, but it requires both the start and the end of the heap. Currently, the SDK’s linker script provides only a symbol for the heap’s beginning. We may also want to discuss which allocation algorithm to adopt.Please note that I am currently unable to test this code using the ECOS SDK build system. I could not build any target with it, as the build system appears to be broken. And I failed to figure out how to use
testdirto develop this SDK. Furthermore, I do not have all the boards supported by this SDK. I have, however, tested the code on my own setup and on the Starry Sky C1 board, compiling with Clang under the Sonnet SDK build system.