Commit Graph

10 Commits

Author SHA1 Message Date
Paula Toth be54ea52f1 [libc] Change minimum cmake requirement.
Summary: As per this thread: http://lists.llvm.org/pipermail/llvm-dev/2020-April/140744.html, changed the minimum requirement to reflect the decision made to upgrade to cmake 3.13.4.

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D77781
2020-04-09 20:42:55 -07:00
Siva Chandra Reddy f6ccb4fef2 [libc] Add a simple x86_64 linux loader.
This adds a very simple loader. This will be extended to a full loader
in future patches. A utility rule to add unittests has been added to
serve us while we are building out the full loader.

Reviewers: abrachet, phosek

Differential Revision: https://reviews.llvm.org/D76412
2020-03-25 10:12:35 -07:00
Alex Brachet a1762f9ceb [libc] Don't configure test and fuzzer when -DLLVM_INCLUDE_TESTS=OFF
Summary:  Fixes problem reported in D74397#1935863

Reviewers: nathanchance, gchatelet, sivachandra, MaskRay

Reviewed By: sivachandra, MaskRay

Subscribers: mgorny, MaskRay, tschuett

Differential Revision: https://reviews.llvm.org/D76577
2020-03-23 01:50:16 -04:00
Guillaume Chatelet 04a309dd0b [libc] Adding memcpy implementation for x86_64
Summary:
The patch is not ready yet and is here to discuss a few options:
 - How do we customize the implementation? (i.e. how to define `kRepMovsBSize`),
 - How do we specify custom compilation flags? (We'd need `-fno-builtin-memcpy` to be passed in),
 - How do we build? We may want to test in debug but build the libc with `-march=native` for instance,
 - Clang has a brand new builtin `__builtin_memcpy_inline` which makes the implementation easy and efficient, but:
   - If we compile with `gcc` or `msvc` we can't use it, resorting on less efficient code generation,
   - With gcc we can use `__builtin_memcpy` but then we'd need a postprocess step to check that the final assembly do not contain call to `memcpy` (unlikely but allowed),
   - For msvc we'd need to resort on the compiler optimization passes.

Reviewers: sivachandra, abrachet

Subscribers: mgorny, MaskRay, tschuett, libc-commits, courbet

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D74397
2020-03-18 17:43:21 +01:00
Paula Toth a4f45ee73a [libc] Lay out framework for fuzzing libc functions.
Summary:
Added fuzzing test for strcpy and some documentation related to fuzzing.
This will be the first step in integrating this with oss-fuzz.

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra, abrachet

Subscribers: gchatelet, abrachet, mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D74091
2020-02-21 19:15:46 -08:00
Siva Chandra Reddy c6bc10636c [libc] Add a library of standalone C++ utilities.
Some of the existing utils in utils/UnitTest/Test.h have been moved to
this new library.

Reviewers: abrachet, gchatelet

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D73530
2020-01-29 13:44:02 -08:00
Siva Chandra Reddy 5b24c08817 [libc] Move all tests to a top level `test` directory.
A toplevel target, `check-libc` has also been added.

Reviewers: abrachet, phosek

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D72177
2020-01-06 10:14:43 -08:00
Siva Chandra Reddy e5a743c4f6 Add implementations of POSIX mmap and munmap functions.
Summary:
A set of of linux x86_64 internal syscall helpers have also been added.

This change does not try to be perfect with respect to OS and machine
abstractions. A TODO note has been added at places where such abstractions
would help and make the arrangement scalable and cleaner. Addressing the
TODOs and building such abstractions is not in the scope of this change.
It is hoped that follow up changes cleaning up the problem areas and
addressing the TODOs will better illustrate the need for the changes.

This change also does not try to imitate mmap and munmap implementations
of other libcs. The idea here is to put in the bare minimum required to
obtain a working mmap and munmap, and then add the rest of the
functionality on an as needed basis.

Reviewers: abrachet, phosek, stanshebs, theraven

Subscribers: mgorny, MaskRay, jfb, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D71634
2019-12-23 14:04:02 -08:00
Siva Chandra Reddy b47f9eb55d [libc] Add a TableGen based header generator.
Summary:
* The Python header generator has been removed.
* Docs giving a highlevel overview of the header gen scheme have been
  added.

Reviewers: phosek, abrachet

Subscribers: mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D70197
2019-11-22 13:02:24 -08:00
Siva Chandra 4380647e79 Add few docs and implementation of strcpy and strcat.
Summary:
This patch illustrates some of the features like modularity we want
in the new libc. Few other ideas like different kinds of testing, redirectors
etc are not yet present.

Reviewers: dlj, hfinkel, theraven, jfb, alexshap, jdoerfert

Subscribers: mgorny, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67867

llvm-svn: 373764
2019-10-04 17:30:54 +00:00