Skip to content

mseminatore/crtl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRTL

CMake

Welcome to CRTL! This project attempts to provide a basic and portable implementation of an ANSI C runtime library. It is not the intention of this project to provide 100% of the ANSCI C RTL. The primary focus will be the most commonly used C library functions. So for example, C locale support is not planned at this time.

CRTL is Self-hosting

The unit tests in this project are linked only against the CRTL library. So all unit tests run and report results using this library and not the host OS libc implementation.

Platform and Architectures supported

The CRTL project development and testing is mainly done on Windows and Mac OSX with Linux support as an additional goal. The primary architectures supported are x86, x64, and ARM64 but additional processors are candidates.

Configuration

The file config.h contains defines to configure how the library is built.

Project Goals and Non-Goals

This project has a small set of defined goals. These are:

  1. Provide implementations of the most common ANSI C runtime functions
  2. Prioritize correctness and portability
  3. Pursue performance where practical
  4. Support Windows, MacOS, Linux and bare CPU

There are also some explicit non-goals for the project. These are:

  1. Implement every single C runtime function
  2. Guarantee optimal performance, simple and small
  3. Support every OS / hardware configuration

Known Issues

There are several known/open issues at this time. Not all open issues are listed here, these are just some key examples.

  • varargs and therefore syscall() on OSX x64 are not yet working
  • Not all syscall() functions implemented
  • printf() does not yet support float (%f) and a few other formats

Testing

A very simple test harness and a range of unit tests are included with the library. This enables quick validation of implementation across various platforms. Unit test coverage is growing but not yet complete.

Why CRTL?

This is primarily an educational exercise. I find that you really come to understand the C programming language and its library functions in a deep and meaningful way when you've actually done the work to implement the core library of functions.

At some point I also hope to be able to use this library with tiny C compilers that I write for microcontrollers that I use.

Contributing

Contributions are welcome, particularly bug fixes and enhancements! Refer to our Contribution Guidelines for details.

Please note that Project owners reserve the right to accept or reject any PR for any reason.

Code of Conduct

Before contributing or participating to this community please be sure to familiarize yourself with our project CODE OF CONDUCT. These guidelines are intended to govern interactions with and within the community.

Warranty Disclaimer

You may use this library with the understanding that doing so is AT YOUR OWN RISK. No warranty, express or implied, is made with regards to the fitness or safety of this code for any purpose.

About

A small, portable ANSI C runtime library implementation

Topics

Resources

License

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Sponsor this project

 

Packages

 
 
 

Contributors

Languages