aboutsummaryrefslogtreecommitdiff
path: root/libc/config/baremetal/riscv/entrypoints.txt
AgeCommit message (Collapse)AuthorFilesLines
2024-09-16[libc][c11] implement ctime (#107285)Зишан Мирза1-0/+2
This is an implementation of `ctime` and includes `ctime_r`. According to documentation, `ctime` and `ctime_r` are defined as the following: ```c char *ctime(const time_t *timep); char *ctime_r(const time_t *restrict timep, char buf[restrict 26]); ``` closes #86567
2024-08-08[libc][math] Add scalbln{,f,l,f128} math functions (#102219)aaryanshukla1-0/+3
Co-authored-by: OverMighty <its.overmighty@gmail.com>
2024-08-07[libc] Allow time conversions to compile on bare metal (#102014)Simon Tatham1-0/+5
The `<time.h>` functions `asctime`, `gmtime`, `mktime` and their `_r` variants are purely computational functions which convert between well defined time representations and/or strings. There's no reason these shouldn't be available in bare-metal builds of the library as well as hosted ones: even if the library has no way to find out the time in POSIX format, it might still see POSIX-style `time_t` values in input data (e.g. network protocols) and need to interpret them. The only obstacle to this was that the `out_of_range()` helper function set `errno` to `EOVERFLOW`, which fails in a bare-metal build because the extra POSIX error values aren't defined, including `EOVERFLOW`. So I've made that assignment conditional on `EOVERFLOW` being defined. Fixes #85556.
2024-08-05[libc] Include pow in baremetal entrypoints (#102021)Petr Hosek1-0/+1
2024-08-02[baremetal] Add atan2 to baremetal (#101767)PiJoules1-0/+1
Co-authored-by: Petr Hosek <phosek@google.com>
2024-08-01[libc] Implement vasprintf and asprintf (#98824)Tsz Chan1-0/+2
[libc] Implement vasprintf and asprintf --------- Co-authored-by: Izaak Schroeder <izaak.schroeder@gmail.com>
2024-07-22[libc] Include cbrt in baremetal targets (#99916)Petr Hosek1-0/+1
This is a follow up to #99262.
2024-07-13[libc] Include realloc in baremetal entrypoints (#98780)Petr Hosek1-0/+1
This is used in some embedded projects.
2024-07-09[libc] Provide isnan, isnanf and isnanl functions (#96008)Petr Hosek1-0/+3
While C99 defines type generic isnan macro, BSD provided isnan, isnanf and isnanl in prior C standards and existing code still relies on these.
2024-07-09[libc] Avoid the atexit and exit_handler dependency for exit (#98121)Petr Hosek1-0/+1
These are not required and without these dependencies, we would wound up with an unresolved reference to __cxa_finalize, which can be provided by the vendor making this compatible with baremetal.
2024-07-09[libc] Provide baremetal implementation of getchar (#98059)Petr Hosek1-0/+1
This introduces opaque type `struct __llvm_libc_stdin` and a symbol `__llvm_libc_stdin_read` that's intended to be provided by the vendor. `__llvm_libc_stdin_read` intentionally has the same signature as `cookie_read_function_t` so it can be used with `fopencookie` to represent `stdin` as `FILE *` in the future.
2024-07-08[libc] puts implementation for baremetal (#98051)Petr Hosek1-0/+1
This is a simple baremetal implementation of puts akin to putchar.
2024-07-08[libc] Include _Exit in the baremetal configuration (#98053)Petr Hosek1-0/+1
This is implemented using `__llvm_libc_exit` which should be provided by the vendor and thus available in baremetal configurations.
2024-07-08[libc] Include cbrtf in the baremetal configuration (#98052)Petr Hosek1-0/+1
This is available as of #97936.
2024-07-07[libc] Include tan in the baremetal configuration (#97921)Petr Hosek1-0/+1
This is available as of #97489.
2024-06-27[libc] Sort entrypoints alphabetically (#96955)Petr Hosek1-90/+88
This makes it easier to diff the different configurations.
2024-06-27[libc] Include additional math functions in baremetal config (#96926)Petr Hosek1-0/+55
These are all supported on arm32 and riscv32.
2024-06-21[libc][stdlib] Fix skipped libc.src.stdlib.freelist_malloc target for ↵lntue1-0/+1
baremetal. (#96372) Downstream build issue reported: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8744479865106393873/overview
2024-06-20[libc][config] Add malloc as baremetal arm entrypoint (#95827)PiJoules1-0/+4
2024-06-14Reapply "[libc] printf, putchar and vprintf in bareemetal entrypoints… ↵Haowei1-0/+3
(#95619) This reverts commit eca988aa4420f33810f9830c80ff9f149b7928ff. The underlying libc issue was fixed by PR#95576. The original PR is #95436 , which adds printf, putchar and vprintf in bareemetal entrypoints
2024-06-14Revert "[libc] printf, putchar and vprintf in bareemetal entrypoints (#95436)"Haowei Wu1-3/+0
This reverts commit b1de42a81d838bb0c6dea7d2436820a2456c730b, which breaks libc build for baremetal targets.
2024-06-13[libc] printf, putchar and vprintf in bareemetal entrypoints (#95436)Petr Hosek1-0/+3
We now have baremetal implementations of these entrypoints.
2024-05-21[libc] Provide __libc_{init,fini}_array for baremetal (#90828)Petr Hosek1-0/+4
These are provided by newlib and many baremetal projects assume they're available rather than providing their own implementation.
2024-04-17[libc][c23][fenv] Implement fetestexceptflag (#87828)Robin Caloudis1-0/+1
Provide C23 `fetestexceptflag` function according to 7.6.4.6 in the latest [revision of the C standard](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf) from 2023-04-02. Closes https://github.com/llvm/llvm-project/issues/87565.
2024-04-05 [libc][c23][fenv] implement fesetexcept (#87603)aniplcc1-0/+1
Closes #87564
2024-04-01[libc][math] Implement atan2f correctly rounded to all rounding modes. (#86716)lntue1-0/+1
We compute atan2f(y, x) in 2 stages: - Fast step: perform computations in double precision , with relative errors < 2^-50 - Accurate step: if the result from the Fast step fails Ziv's rounding test, then we perform computations in double-double precision, with relative errors < 2^-100. On Ryzen 5900X, worst-case latency is ~ 200 clocks, compared to average latency ~ 60 clocks, and average reciprocal throughput ~ 20 clocks.
2024-03-16[libc] Include empty remove in baremetal stdio.h (#85336)Petr Hosek1-0/+1
This is required to avoid compilation error in libc++. See #85335 for more details.
2024-03-16[libc] Match baremetal stdlib.h entrypoints with typesPetr Hosek1-1/+0
To match the entrypoints and types we need to exclude __atexithandler_t and __qsortrcompare_t, as well as qsort_r, which is a GNU extension. This is a reland of llvm/llvm-project#85030.
2024-03-16[libc] Include time.h in baremetal targets (#85026)Petr Hosek1-0/+3
These types and conversion functions are used in embedded development. Note that we cannot yet include other entrypoints such as asctime because `src/time/time_utils.h` unconditionally uses `EOVERFLOW`, which is only defined in POSIX and not in C standard. This issue is tracked by #85556.
2024-03-12[libc] Include additional baremetal entrypoints (#85020)Petr Hosek1-0/+44
These functions are usable on embedded platforms and are sometimes used in various baremetal projects.
2024-03-07[libc][stdfix] Add exp function for short _Accum and _Accum types. (#84391)lntue1-0/+2
2024-03-06[libc][stdfix] Add integer square root with fixed point output functions. ↵lntue1-0/+2
(#83959) Fix https://github.com/llvm/llvm-project/issues/83924.
2024-03-04[libc] Include stdfix.h in baremetal targets (#83900)Petr Hosek1-0/+30
Fixed-point arithmetic support is targeted towards baremetal targets.
2024-02-28[libc] Include assert.h on baremetal targets (#83324)Petr Hosek1-0/+3
Many baremetal applications use asserts.
2024-02-20[libc] add more stdbit.h entrypoints to additional targets (#82440)Nick Desaulniers1-0/+42
stdbit.h isn't complete yet, but looking to turn these on on more targets for earlier feedback.
2024-01-22[libc] Include missing RISC-V stdlib.h and math.h entrypoints (#79034)Petr Hosek1-0/+110
This matches the entrypoints for baremetal ARM.
2024-01-02[libc] `__stack_chk_fail` baremetal dependencies (#76412)Petr Hosek1-0/+1
`__stack_chk_fail` uses `write_to_stderr` and `abort` but these currently aren't included in baremetal targets resulting in a CMake build error: ``` CMake Error at /llvm-project/libc/cmake/modules/LLVMLibCObjectRules.cmake:693 (target_link_libraries): Target "libc.src.stdlib.abort" of type UTILITY may not be linked into another target. One may link only to INTERFACE, OBJECT, STATIC or SHARED libraries, or to executables with the ENABLE_EXPORTS property set. Call Stack (most recent call first): /llvm-project/libc/cmake/modules/LLVMLibCObjectRules.cmake:811 (create_entrypoint_object) /llvm-project/libc/cmake/modules/LLVMLibCObjectRules.cmake:891 (expand_flags_for_entrypoint_object) /llvm-project/libc/src/compiler/generic/CMakeLists.txt:1 (add_entrypoint_object) CMake Error at /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:5 (get_target_property): get_target_property() called with non-existent target "libc.src.__support.OSUtil.osutil". Call Stack (most recent call first): /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:36 (collect_object_file_deps) /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:36 (collect_object_file_deps) /llvm-project/libc/cmake/modules/LLVMLibCLibraryRules.cmake:85 (collect_object_file_deps) /llvm-project/libc/lib/CMakeLists.txt:26 (add_entrypoint_library) ``` To address these errors, we need to include `abort` in the list of baremetal entrypoints. We also need to provide `write_to_stderr` baremetal implementation, but this is challenging since there is no uniform way to print a message on these platforms (sometimes there may not be any way to print a message). We instead defer to `__libc_log_write` which can be provided by the underlying platform. We use a similar approach for `quick_exit`, defering to `__libc_quick_exit`.
2023-12-19[libc] move __stack_chk_fail to src/ from startup/ (#75863)Nick Desaulniers1-0/+3
__stack_chk_fail should be provided by libc.a, not startup files. Add __stack_chk_fail to existing linux and arm entrypoints. On Windows (when not targeting MinGW), it seems that the corresponding function identifier is __security_check_cookie, so no entrypoint is added for Windows. Baremetal targets also ought to be compileable with `-fstack-protector*` There is no common header for this prototype, since calls to __stack_chk_fail are meant to be inserted by the compiler upon function return when compiled `-fstack-protector*`.
2023-09-26[libc] Start to refactor riscv platform abstraction to support both 32 and ↵Mikhail R. Gadelha1-0/+126
64 bits versions This patch enables the compilation of libc for rv32 by unifying the current rv64 and rv32 implementation into a single rv implementation. We updated the cmake file to match the new riscv32 arch and force LIBC_TARGET_ARCHITECTURE to be "riscv" whenever we find "riscv32" or "riscv64". This is required as LIBC_TARGET_ARCHITECTURE is used in the path for several platform specific implementations. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D148797