summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-30iconv: prevent compiler warning during initialization with jis0208Frank Mehnert
The data in jis0208.h initializes a two-dimensional array, so insert the missing braces to prevent a compiler warning about missing braces around initializer. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-30iconv: fix parameter type of utf8seq_is_{overlong,surrogate,illegal}Frank Mehnert
Use `unsigned char *s` rather than `char *s`. First, this fixes compiler warnings when these functions are called from utf8dec_wchar() passing the `in` pointer of type `unsigned char *`. Second, these functions are always called with characters >= 0x80 so the sign bit is set. Shifting right a negative signed value will insert `1` from the left side, so `foo >> 1` where foo is negative will always have the sign bit set. So at least "case 2" would never return true. There is a similar problem with tests like (*(s+1) >= 0xA0) && (*(s+1) <= 0xBF) This condition is always false with `char *s`. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-30ldso.c: use 'unsigned int' as loop variable typeFrank Mehnert
As the condition for terminating the loop compares the loop variable against an ElfW() variable which is, depending on the platform, either uint32_t or uint64_t, use 'unsigned int' rather than 'int' for the loop variable to prevent corresponding compiler warnings. Note that it would not make sense to use 'unsigned long' because the number of program headers will never exceed 32-bit. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-30iconv: explicitly state operator precedenceFrank Mehnert
gcc suggests to set parentheses around '-'/'+' inside '<<' if the corresponding warnings are enabled. Make the compiler happy and make the code easier to understand for developers. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-30iconv: explicit cast to `unsigned char*`Frank Mehnert
Perform an explicit cast to prevent the corresponding compiler warning. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-30libdl: properly cast parameters for %p format string specifierFrank Mehnert
The "%p" format specifier requires a void pointer. Cast parameters of type ElfW(Addr) to 'void *'. This fixes warnings if _dl_if_debug_print() performs parameter type checking. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-30Group conditions after `&&`Dmitry Chestnykh
If the conditions are not grouped we can reach this block even if `__NR_stat` is not defined. `defined __NR_stat && ((!defined(__UCLIBC_USE_TIME64__) || defined(__sparc__))` gives us false but `LINUX_VERSION_CODE <= KERNEL_VERSION(5,1,0))` may give us true. So if linux headers version is below 5.1.0 and __NR_stat is not defined we can have compilation error Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
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-24add SEEK_DATA/SEEK_HOLEWaldemar Brodkorb
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-07-17allow to use <sys/ucontext.h>Waldemar Brodkorb
For architectures without ucontext implementation it is possible to use libucontext with this small adaptation.
2024-07-09Clang support for gnu_inline attributeWaldemar Brodkorb
Clang also supports the gnu_inline attribute and the __GNUC_STDC_INLINE__ macro (C99 semantics). However, it reports as GCC 4.2 compatible (__GNUC_MINOR__ / __GNUC__) and thus the current defines do not think it can support this. Add clang as an alternative for this support. Documentation shows that this attribute is supported since at least Clang 8. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09buildsys: allow building with gcc-14Marcus Haehnel
GCC-14 requires all functions to have an explicit return type. An implicit return type is no longer supported. main() in the ncurses link check was declared without return type. Add it to make this work on GCC-14. See also: https://gcc.gnu.org/gcc-14/porting_to.html Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09features.h: add clang prerequisite macroMarcus Haehnel
This can be used to guard features for specific clang versions. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09c++: Remove deprecated dynamic exception specificationSven Linker
Dynamic exception specification using `throw()` is deprecated since C++11 and removed in C++17. This change replaces `throw()` with `noexcept` when compiling for newer standards. Co-authored-by: Sven Linker <sven.linker@kernkonzept.com> Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09stdlib: increase number of static atexit handlers to 32Yann Le Du
The existing limit of 20 was found to be insufficient when moving from gcc 8 to gcc 9. At the time a test ran already 16 handlers had been installed leaving only minimal room for application installed handlers. Musl uses 32, as does newlib. Further, the ISO C standard for C99 specifies that: The implementation shall support the registration of at least 32 functions. (7.20.4.2 The atexit function) Co-authored-by: Yann Le Du <yann.le.du@kernkonzept.com> Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09libm: Fix float conversion compiler warningMarcus Haehnel
Make two implicit casts from double to int explicit to silence compiler warnings about them. The casts are required during the computation of exponentiation. Co-authored-by: Sven Linker <sven.linker@kernkonzept.com> Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09uclibc: Fix double promotion warningMarcus Haehnel
Add casts where necessary to convince clang that the promotion of float to double is intentional. Co-authored-by: Sven Linker <sven.linker@kernkonzept.com> Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-07-09ldso/dl-vdso: avoid compiler warning if configured without vdsoMarcus Haehnel
The parameters are not used in the function variant without vdso support, so tell this to the compiler to avoid a warning. Also fix the indentation to be in-line with other functions in the file. Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
2024-06-15bump version for 1.0.49 releasev1.0.49Waldemar Brodkorb
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-10config: enable TIME64 by defaultWaldemar Brodkorb
2024-06-10config: make ctor/dtor visible againWaldemar Brodkorb
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-21linuxthreads: enable unwinding over signal framesMax Filippov
linuxthreads use a helper function to invoke signal handlers, this function needs stack unwinding information to enable stack unwinding from signal handlers over signal frames. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-20Cast to proper types inside atomic macroses.Dmitry Chestnykh
GCC-14 raises `-Wint-conversion` error if lvalues are of pointer types and rvalues are of integer types. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@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-09ldso: arm: fix build with gcc-14Max Filippov
With gcc-14 warnings caused by type mismatches turn to errors: - got_entry is a pointer in the _dl_linux_resolver(), but the function _dl_linux_resolver() returns unsigned long. Convert got_entry to unsigned long when returning - first argument of _dl_funcdesc_for() is a pointer, but (symbol_addr + reloc_value) is unsigned long in the _dl_do_reloc(). Convert function argument to (void *) - struct funcdesc_value::entry_point is a pointer, but DL_RELOC_ADDR returns ElfW(Addr). Convert DL_RELOC_ADDR result to (void *) before assigning to funcdesc_value::entry_point Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-09ldso: FDPIC: fix type mismatchesMax Filippov
With gcc-14 warnings caused by type mismatches turn to errors: - (void **) needs explicit conversion operator to become struct funcdesc_value **entry - both subexpressions of the ternary operator must be pointers - %p should be used instead of %x to print a pointer Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-09iconv: fix type mismatchesMax Filippov
With gcc-14 warnings caused by type mismatches turn to errors: - iconv_t is not a pointer type, convert the result directly to iconv_t in combine_to_from() - unsigned int is not the same as wchar_t, use temporary wchar_t wc as an argument for utf8dec_wchar() Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2024-05-08sparc64: Fix incorrect sigreturn stub function implementationWaldemar Brodkorb
2024-05-08futimesat: add missing headerWaldemar Brodkorb