Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
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>
|
|
Perform an explicit cast to prevent the corresponding compiler warning.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
- 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>
|
|
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>
|
|
For architectures without ucontext implementation it is possible
to use libucontext with this small adaptation.
|
|
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>
|
|
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>
|
|
This can be used to guard features for specific clang versions.
Signed-off-by: Marcus Haehnel <marcus.haehnel@kernkonzept.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
|
|
|
|
See here for details:
https://github.com/wbx-github/uclibc-ng/issues/15
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
The correct one is `struct ucontext` -> `ucontext_t`.
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
|
|
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>
|
|
Add missing includes and function decls.
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
|
|
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
|
|
This reverts commit 6b6f51c21dd29685bd1339de0bdffc0929316c63.
|
|
- 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>
|
|
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>
|
|
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>
|
|
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
|
|
|
|
This function haven't have prologue/epilogue/cfi directives etc.
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
|
|
Glibc and musl both defines this macro.
Glibc defines it for 64-bit time_t on 32-bit arch
and for 64-bit architectures.
Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
|
|
Make rule that announces and makes static libc archive can generate
command line that is too long when a full path O= option is used. That
breaks the build with the following message:
make: /bin/sh: Argument list too long
Use make $(file) construct to generate file list file and use that file
as $(AR) argument instead.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|