summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
AgeCommit message (Collapse)Author
6 daysFix Sysvipc for ARM, AARCH64, RISCV64, KVX and m68kWaldemar Brodkorb
6 daystime64: fix *ctl functions in mips32eb/mips64yliu
6 daystime64: fixed msgctl/semctl/shmctl result errors for for MIPS32/RISCV32yliu
6 daysmips32: Preventing FORCE_FRAME_POINTER from being optimized awayyliu
In functions that modify sp, debug and unwind information should be located by fp instead of sp, and the conversion is completed through FORCE_FRAME_POINTER. With gcc -Os, FORCE_FRAME_POINTER is optimized away, and the modified sp is still used, causing a segmentation fault in the recvfrom(). Adding a meaningless assembly instruction to use the return value of FORCE_FRAME_POINTER to prevent it from being deleted.
2025-07-25utimes: force to use 64-bit implementation if available and requested (part II)Peter Seiderer
- fix dependency for libc_hidden_def(utimes) statement, fixes (on ARM-64bit): ./include/libc-symbols.h:431:32: error: '__EI_utimes' aliased to undefined symbol '__GI_utimes' 431 | extern __typeof (name) __EI_##name __attribute__((alias (__hidden_asmname1 (,#local)))) \ | ^~~~~ ./include/libc-symbols.h:435:41: note: in expansion of macro '__hidden_ver1' 435 | # define hidden_def(name) __hidden_ver1(__GI_##name, name, name); | ^~~~~~~~~~~~~ ./include/libc-symbols.h:503:32: note: in expansion of macro 'hidden_def' 503 | # define libc_hidden_def(name) hidden_def (name) | ^~~~~~~~~~ libc/sysdeps/linux/common/utimes.c:54:1: note: in expansion of macro 'libc_hidden_def' 54 | libc_hidden_def(utimes) | ^~~~~~~~~~~~~~~ - fix dependency for 64-bit implementation, fixes (on ARM-64bit): .../build/busybox-1.37.0/libbb/copy_file.c:433:(.text.copy_file+0x2b0): undefined reference to `utimes' Fixes: 48591e2a2 ("Provide fixups for riscv32.") Fixes: 5aee86ed3 ("utimes: force to use 64-bit implementation if available and requested") Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2025-07-25fix getentropy()Waldemar Brodkorb
Add missing header in commit 19fe75f0ab09c9661ff03738579171624fc35018 Reported-By: Ronald Wahl <ronald.wahl@legrand.com>
2025-07-19utimes: force to use 64-bit implementation if available and requestedPeter Seiderer
Fixes 64-/32-bit time_t regression on ARM32 (reported for buildroot, see [1] for details). [1] https://gitlab.com/buildroot.org/buildroot/-/issues/128 Fixes: 48591e2a2 ("Provide fixups for riscv32.") Signed-off-by: Peter Seiderer <ps.report@gmx.net>
2025-06-11arc: add missing files for fenv supportWaldemar Brodkorb
2025-04-28csky: add fenv support from glibcWaldemar Brodkorb
2025-04-28sh: add fenv support from glibcWaldemar Brodkorb
2025-04-27sparc: add fenv support from glibcWaldemar Brodkorb
2025-04-27or1k: add fenv support from glibcWaldemar Brodkorb
2025-04-27m68k: add fenv support from glibcWaldemar Brodkorb
2025-04-27fix build for coldfire with FPUWaldemar Brodkorb
2025-04-24riscv: add fenv support from glibcWaldemar Brodkorb
2025-04-23mips/mips64: add fenv support from glibcWaldemar Brodkorb
2025-04-11getentropy: guard syscall to getrandomWaldemar Brodkorb
2025-04-07add getentropy(), fix return value of getrandom()Thorsten Glaser
Signed-off-by: Thorsten Glaser <tg@debian.org>
2025-04-01arm: add fenv support from glibcWaldemar Brodkorb
2025-03-31aarch64: add fenv support from glibcWaldemar Brodkorb
2025-03-22Use __ehdr_start as known zero link address symbolJan Klötzke
The _start symbol does not necessarily have to be on the first page of the application. But the __ehdr_start symbol is always at address zero for PIE binaries. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2025-03-22Do not rely on unrelocated GOT entriesJan Klötzke
The LLVM linker seems to be quite clever. When resolving relocations, accesses to the GOT are potentially replaced by PC relative addressing to the requested symbol. This breaks the old method of calculating the load address by using an unrelocated GOT entry value. Instead, rely on __ehdr_start having a link address of zero. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2025-02-10nan.h: define NAN only if not already definedFrank Mehnert
Clang-19 defines NAN in <float.h>. Check if NAN is already defined to prevent a compiler warning. Change-Id: I29ebcb2a7a0c1eade46a73074a1701ea67869128 Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2025-01-14clock_adjtime: warn instead of error outWaldemar Brodkorb
2024-08-14add process_vm_{read,write}v syscall wrapper from glibcWaldemar Brodkorb
2024-08-13getrandom: remove __USE_GNU / add GRND_INSECUREWaldemar Brodkorb
Neither glibc nor musl use __GNU macro to hide getrandom. While there sync with glibc and add GRND_INSECURE flag.
2024-08-11add memfd_create syscall wrapperWaldemar Brodkorb
2024-08-11riscv: remove incomplete context implementation, use libucontextWaldemar Brodkorb
2024-08-09bits/stat.h: Declare st_mtim if defined(__USE_XOPEN2K8), add missingWaldemar Brodkorb
d0c8c185b439187b12644457bb2aa0326f25aaf7 was not complete, add missing architectures.
2024-08-09lseek: allow SEEK_DATA/SEEK_HOLE to be usedWaldemar Brodkorb
2024-07-27bits/stat.h: Declare st_mtim if defined(__USE_XOPEN2K8), everywhereJ. Neuschäfer
While building software that sets _POSIX_C_SOURCE=200809L and uses stat.st_mtim for ARM, it was noticed that st_mtim was not defined. This seems to be because common/bits/stat.h was picked up, which does not take __USE_XOPEN2K8 as a reason to enable st_mtim and related fields. This appears to be an oversight, and porting the check from common-generic/bits/stat.h to other architectures does indeed fix the build issue. This patch is based on commit 50bd6d06e ("Fix memory corruption due to struct stat field"). Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
2024-07-21Fix compilation with 4.x kernel headersDmitry Chestnykh
- Fallback to __NR_stat syscall in ld.so if we use 4.x kernel headers. 4.x kernel doesn't support 64-bit time so we can use old syscall - Add preprocessor conditions to have fstat64 and fstatat64 in libc with old kernel headers Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-07-19arm: Replace deprecated asm instructions for ARMv8 AArch32Valentin Gehrke
ARMv8 has particular restrictions which coprocessor can be used and as such these instructions, which were likely used for backwards compatibility purposes, cannot be used on ARMv8. We solve this by checking for ARMv8 and then using the corresponding mnemonics which were placed in comments alongside the instructions causing issues. Fixes the following errors: .../setjmp.S:59:6: error: invalid operand for instruction stc p11, cr8, [r12], #68 ^ .../setjmp.S:62:6: error: invalid operand for instruction mrc p10, 7, r2, cr1, cr0, 0 ^ .../__longjmp.S:69:6: error: invalid operand for instruction ldc p11, cr8, [r12], #68 ^ .../__longjmp.S:73:6: error: invalid operand for instruction mcr p10, 7, r1, cr1, cr0, 0 ^ Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.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-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>