summaryrefslogtreecommitdiff
path: root/libc
AgeCommit message (Collapse)Author
2024-06-15libc: cast free() argument to void * in wchar.cYuriy Kolerov
iconv_close() accepts iconv_t type (which is void *) and passes it to free() which accepts void *. However, GCC 14 raises a -Wint-conversion warning if it is not casted to void * because GCC cannot unwind typedef of iconv_t. Signed-off-by: Yuriy Kolerov <ykolerov@synopsys.com>
2024-06-10m68k: fix for m68000 cpuWaldemar Brodkorb
See here for details: https://github.com/wbx-github/uclibc-ng/issues/15
2024-06-04xtensa: add FDPIC supportMax Filippov
This change implements Xtensa FDPIC ABI as specified in the first version of the following document: https://github.com/jcmvbkbc/xtensa-abi/blob/master/fdpic-xtensa.txt Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-31epoll.h: Add epoll ioctlsJoe Damato
add two ioctls to get and set struct epoll_params to allow users to control epoll based busy polling of network sockets. added to uapi in commit 18e2bf0edf4dd88d9656ec92395aa47392e85b61 (Linux kernel 6.9 and newer). Signed-off-by: Joe Damato <jdamato@fastly.com>
2024-05-21xtensa: make _init and _fini hiddenMax Filippov
Make _init and _fini hidden so that references to these symbols bind locally in the shared objects. glibc does the same. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-21xtensa: use compiler-provided XCHAL macrosMax Filippov
Starting with gcc-13 the compiler provides configuration-specific macro definitions for the target xtensa core. Use them when available instead of the configuration overlay file xtensa-config.h Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-20libc/sysdeps/linux/common/utime.c: fix riscv32 buildFabrice Fontaine
Commit 48591e2a259d84247ae38f050bd58e6f7450bb77 forgot to update utime.c resulting in the following riscv32 build failure with applications using utime such as bzip2: /home/buildroot/autobuild/instance-0/output-1/host/riscv32-buildroot-linux-uclibc/bin/ld.real: bzip2.o: in function `copyFileName': bzip2.c:(.text+0x1fcc): undefined reference to `utime' Fixes: 48591e2a259d84247ae38f050bd58e6f7450bb77 - http://autobuild.buildroot.org/results/2e37d4e0bcef515fe9e643737419bfd26aa2833e Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2024-05-18Fix wrong `struct ucontext_t` typedef for all arches.Dmitry Chestnykh
The correct one is `struct ucontext` -> `ucontext_t`. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-05-18riscv32: Fix `struct ucontext` definition.Dmitry Chestnykh
The correct typedef is `struct ucontext` -> `ucontext_t`, not `struct ucontext_t` -> `ucontext_t` like for other architectures. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-05-18Fix riscv32 build with gcc-14.Dmitry Chestnykh
Add missing includes and function decls. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-05-18Fix uClibc build for nds32 with gcc-14.Dmitry Chestnykh
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-05-18Revert "nds32: sync with binutils 2.37, gcc 11.2 and linux 5.10.93 changes"Waldemar Brodkorb
This reverts commit 6b6f51c21dd29685bd1339de0bdffc0929316c63.
2024-05-16Correct uClibc compilation.Dmitry Chestnykh
- Include sys/types.h instead of asm/types.h to prevent types conflict for uClibc typedefs and kernel headers typedefs. - Cast 3rd arg of utimensat_time64 syscall to integer type to avoid compiler's -Wint-conversion error. The error was found during uClibc compilation for mips32. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-05-15fix kernel_stat64 definitionMax Filippov
The commit 74ca8d6f5d2e ("remove UCLIBC_HAS_LFS") removed conditional compilation dependent on __UCLIBC_HAS_LFS__, assuming it to be always defined, but removed the wrong branch in the definition of kernel_stat64. Fix kernel_stat64 definition to be stat64. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Tested-by: Chris Packham <judge.packham@gmail.com>
2024-05-14malloc/memalign: avoid integer overflowMax Filippov
Check that the size passed to memalign() is not greater than PTRDIFF_MAX before adjusting it, otherwise it may wrap around in the adjustment. This fixes gcc testsuite test gcc.dg/torture/pr60092.c Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-11m68k: fix noMMU ELF compile with gcc 14.xWaldemar Brodkorb
2024-05-10csky: allow time64Waldemar Brodkorb
2024-05-08sparc64: Fix incorrect sigreturn stub function implementationWaldemar Brodkorb
2024-05-08futimesat: add missing headerWaldemar Brodkorb
2024-04-30sparc: Fix incorrect sigreturn stub function implementation.Dmitry Chestnykh
This function haven't have prologue/epilogue/cfi directives etc. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-04-20x86: Fix __libc_sigaction implementation.Dmitry Chestnykh
For x86 we have to copy only mask, handler and flags. We haven't set SA_RESTORER bit in sa_flags anyway. This patch fixes multiple test failures on x86. Also we have to build uClibc with FP for x86 because without FP NPTL and libgcc code cannot properly unwind the stack during asynchronous cancellation of system calls. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-04-18Fix vDSO support for all supported architectures.Dmitry Chestnykh
- Cleanup dl-vdso.c code. - Pass `void *` as first arg to `load_vdso()`, using 32-bit type is completely wrong on 64bit architectures. - Split libc code and vDSO-related code. Move arch-specific implementations into separate files. The performance improvement is for example 50-60 times on ARMv7 and about 4 times on x86_64. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-04-14tree: Remove ^LPetr Vorel
Remove ^L (0x0c) chars from source code. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2024-04-14riscv32: allow ELF PIE noMMU buildWaldemar Brodkorb
2024-04-13Provide fixups for riscv32.Dmitry Chestnykh
- Use TIME64 by default for rv32, usage of 32-bit time leads to a lot of incompatibilities with linux kernel 6.6.x and later versions. - Add some other corrections to use proper system calls on riscv32 platform. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-04-01riscv64: partially revert cb9d1f53717dd67892ba943626f3d1b46f3e760b, fixes no ↵Waldemar Brodkorb
MMU ELF
2024-03-29riscv32: implement linuxthreads, from sorearWaldemar Brodkorb
2024-03-28riscv64: implement Linuxthreads, from sorearWaldemar Brodkorb
2024-03-27riscv: add __UCLIBC_ABORT_INSTRUCTION__, suggested by sorearWaldemar Brodkorb
2024-03-22riscv: fix pread64/pwrite64 users like git, suggested by sorearWaldemar Brodkorb
2024-03-20riscv32: sync with riscv64Waldemar Brodkorb
2024-03-19riscv64: add atomic.h, fixes tst-cond16, suggested by sorearWaldemar Brodkorb
2024-03-19riscv64: sync with glibc clone.SWaldemar Brodkorb
2024-03-19riscv64: page size is 4096, reported by sorearWaldemar Brodkorb
2024-03-12add explicit_bzero from muslWaldemar Brodkorb
2024-03-12add reallocarray from muslWaldemar Brodkorb
2024-03-03x86: enable time64Waldemar Brodkorb
2024-03-03m68k: enable time64Waldemar Brodkorb
2024-03-03superh: enable time64Waldemar Brodkorb
2024-03-03microblaze: enable time64Waldemar Brodkorb
2024-03-03riscv32: decouple from riscv64Waldemar Brodkorb
2024-03-03remove symlinkWaldemar Brodkorb
2024-03-02Add time64 support to ARC.Dmitry Chestnykh
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-03-01libc: Remove 32bit timespec structures everywhere.Dmitry Chestnykh
With time64 enabled we use statx() system call and the appropriate routines for results conversion. There is no need in `__ts32_struct` anymore. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-29libc: restore correct definition of semid_ds struct.Dmitry Chestnykh
Previously the common definition of this structure was broken by a mistake. Restore it correctly for all needed architectures and all use cases. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-29Add time64 support for sparc.Dmitry Chestnykh
By some reason sparc ld.so cannot work properly with statx() system call, so fallback to regular stat() family in ld.so. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-28Add time64 support to OpenRISC.Dmitry Chestnykh
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-28libc: always redirect *stat() family to statx() with time64 enabled.Dmitry Chestnykh
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-27Fix *stat() and *stat64() when the time is beyond year 2038.Dmitry Chestnykh
To obtain correct `st_atim`, `st_mtim` and `st_ctim` fields we need to use statx() syscall and then convert the data from the kernel to the regular stat structure. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-26Add time64 support for MIPS32.Dmitry Chestnykh
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>