From ef3db4fcab4a32cd8efff86b417b459d4d4fc1d5 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Tue, 7 Jun 2022 06:52:02 +0000 Subject: [PATCH] Replace Goals and Why section with Introduction Rewrite the introduction of the page to state clearly the goals of LLVM's libc project. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D127174 --- libc/docs/index.rst | 59 ++++++++++++++++++----------------------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/libc/docs/index.rst b/libc/docs/index.rst index 835e2fb..81e546b 100644 --- a/libc/docs/index.rst +++ b/libc/docs/index.rst @@ -1,6 +1,6 @@ -======================================================== -llvm-libc: An ISO C-conformant Standard Library for LLVM -======================================================== +=============================================== +llvm-libc: An ISO C-conformant Standard Library +=============================================== **llvm-libc library is not complete. If you need a fully functioning libc right now, you should continue to use your standard system libc.** @@ -9,45 +9,26 @@ now, you should continue to use your standard system libc.** :depth: 4 :local: -Goals -===== +Introduction +============ -- C17 and upwards conformant. -- A modular libc with individual pieces implemented in the "as a - library" philosophy of the LLVM project. -- Ability to layer this libc over the system libc if possible and desired - for a platform. -- Provide POSIX extensions on POSIX compliant platforms. -- Provide system-specific extensions as appropriate. For example, - provide the Linux API on Linux. -- Designed and developed from the start to work with LLVM tooling, fuzz testing - and sanitizer-supported testing. -- Use source based implementations as far possible rather than - assembly. Will try to *fix* the compiler rather than use assembly - language workarounds. -- Extensive unit testing and standards conformance testing. +The libc aspires to a unique place in the software ecosystem. The goals are: -Why a new C Standard Library? -============================= - -Implementing a libc is no small task and is not be taken lightly. A -natural question to ask is, "why a new implementation of the C -standard library?" Some of the major reasons are as follows: - -- Rather than being built as a single monolithic codebase, llvm-libc is designed - from the beginning to enable picking and choosing pieces. This allows using - it as a minimum overlay for e.g. faster math functions than might be - available on the system library. This is useful where an application may - need to access improved CPU support over what's available on the system, - or may need guarantees in performance across different installs. -- Explicit support for building llvm-libc and code with sanitizer compiler - options. +- Fully compliant with current C standards (C17 and upcoming C2x) and POSIX. +- Easily decomposed and embedded: Supplement or replace system C library + functionality easily. This is useful to get consistent math precision across + systems, or updated memory operations for newer microarchitectures. These + pieces will work on Linux, MacOS, Windows, and Fuchsia. +- The creation of fully static binaries without license implications. +- Increase whole program optimization opportunities for static binaries through + ability to inline math and memory operations. +- Reduce coding errors by coding in modern C++ through the use of lightweight + containers during coding that can be optimized away at runtime. +- Permit fuzzing and sanitizer instrumentation of user binaries including the + libc functions. +- A complete testsuite that tests both the public interface and internal + algorithms. - `Fuzzing`__ -- Be useful for research and review. By avoiding assembly language, using C++ - iterators, RAII and templates, llvm-libc aims to have clearly - readable code and to improve the compiler as needed to ensure that optimal - assembly is emitted. -- Enable fully static compiles. .. __: https://github.com/llvm/llvm-project/tree/main/libc/fuzzing -- 2.7.4