Commit Graph

11 Commits

Author SHA1 Message Date
Siva Chandra Reddy 6628387c9a [libc][NFC] Exclude few targets from the `all` target. 2021-02-24 08:59:55 -08:00
Michael Jones a0b65a7bcd [libc] Switch to use a macro which does not insert a section for every libc function.
Summary:
The new macro also inserts the C alias for the C++ implementations
without needing an objcopy based post processing step. The CMake
rules have been updated to reflect this. More CMake cleanup can be
taken up in future rounds and appropriate TODOs have been added for them.

Reviewers: mcgrathr, sivachandra

Subscribers:
2021-01-08 23:52:35 +00:00
Siva Chandra Reddy fd3295fb6f [libc] Skip entrypoints not present in the entrypoints list.
Summary:
If a test depends on a skipped entrypoint, then the test is also
skipped. This setup will be useful as we gradually add support for
more operating systems and target architectures.

Reviewers: asteinhauser

Differential Revision: https://reviews.llvm.org/D81489
2020-06-09 14:40:28 -07:00
Paula Toth b836ae24a9 [libc] Add integration tests.
Summary:
This patch aims to add integration tests to check the following:
1) Header files are generated as expected.
2) Libc functions have the correct public name.
3) Libc functions have the correct return type and parameter types.
4) Symbols are exposed in the public lib.a files.

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra

Subscribers: aheejin, ecnelises, dxf, mgorny, jfb, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D79192
2020-06-02 12:14:07 -07:00
Paula Toth 2a4c30985d [libc] Make clang-tidy use host compiler's resource dir.
Summary: When building llvm-libc with linting enabled, clang-tidy would use the resource dir of the monorepo rather then the host compiler's resource dir. This presented issues when including headers from the host compiler e.g. for sanitizers. Therefore this patch explicitly tells clang-tidy to use the host compiler's resource dir.

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: mgorny, tschuett, ecnelises, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D80265
2020-05-21 18:40:59 -07:00
Paula Toth b2a485e37e [libc] Fix accidental inclusion of system libc headers.
Summary:
I found that because `--system-headers` flag was not included when running clang-tidy, errors produced from compiler provided headers were being suppressed. After passing this flag I realized that by including headers like stdint.h we were indirectly including headers from the system libc. To prevent this we pass `-ffreestanding`.
We don't want to pass `--system-headers` for all checks just the `llvmlibc-restrict-system-libc-headers` therefore we do a separate invocation of clang-tidy for this check.

Reviewers: abrachet, sivachandra

Reviewed By: sivachandra

Subscribers: mgorny, aheejin, tschuett, ecnelises, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D80178
2020-05-21 01:21:37 -07:00
Siva Chandra Reddy 9ae2564396 [libc] Include object files from alias entrypoints also in entrypoint libraries.
Reviewers: abrachet

Differential Revision: https://reviews.llvm.org/D79185
2020-05-04 11:39:37 -07:00
Siva Chandra Reddy 7f12512db2 [libc][Take 2] Propagate entrypoint deps to downstream targets.
This reverts commit a8086ba4ac.
Setting couple of target properties to an empty string was missed in the
previous commit.
2020-04-21 10:29:09 -07:00
Siva Chandra Reddy a8086ba4ac [libc] Revert "Propagate entrypoint deps to downstream targets."
This reverts commit 20cb440ea2 as the
target llvmlibc seems to be failing on the bots.
2020-04-21 10:10:18 -07:00
Siva Chandra Reddy 20cb440ea2 [libc] Propagate entrypoint deps to downstream targets.
Deps are recrusively evaluated at the place they are needed. With this
change, one does not have to list recursive deps of entrypoints when
listing test targets. One will still have to explicitly list all
entrypoint objects when setting up an "add_entrypoint_library" target.

Reviewers: abrachet

Differential Revision: https://reviews.llvm.org/D78537
2020-04-21 09:58:55 -07:00
Siva Chandra Reddy 8c2e66226f [libc] [NFC] Split the CMake rules into multiple files.
Summary:
The single file was getting too long to be convenient to navigate. This
patch splits it up two into 4 files one each for header rules,
object rules, library rules, and test rules.

Reviewers: abrachet, alexshap

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D78536
2020-04-21 09:24:17 -07:00