Age | Commit message (Collapse) | Author |
|
From [1]
"GCC 10 (PR 91233) won't silently allow registers that are not architecturally
available to be present in the clobber list anymore, resulting in build failure
for mips*r6 targets in form of:
...
.../sysdep.h:146:2: error: the register ‘lo’ cannot be clobbered in ‘asm’ for the current target
146 | __asm__ volatile ( \
| ^~~~~~~
This is because base R6 ISA doesn't define hi and lo registers w/o DSP extension.
This patch provides the alternative definitions of __SYSCALL_CLOBBERS for r6
targets that won't include those registers."
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=020b2a97bb15f807c0482f0faee2184ed05bcad8
Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Waldemar Brodkorb <wbx@openadk.org>
|
|
Similar to glibc commit
https://sourceware.org/git/?p=glibc.git;a=commit;h=6bbfc5c09fc5b5e3d4a0cddbbd4e2e457767dae7
we need to handle Linux kernel change, which removed stat64 family from default syscall set.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Waldemar Brodkorb <wbrodkorb@conet.de>
|
|
The return type of syscall() is long so __syscall_error, which is jumped
to by syscall handlers to stash an error number into errno, must return
long too otherwhise it returs 4294967295L instead of -1L. For example,
syscall for x86_64 is defined in libc/sysdeps/linux/x86_64/syscall.S as
syscall:
movq %rdi, %rax /* Syscall number -> rax. */
movq %rsi, %rdi /* shift arg1 - arg5. */
movq %rdx, %rsi
movq %rcx, %rdx
movq %r8, %r10
movq %r9, %r8
movq 8(%rsp),%r9 /* arg6 is on the stack. */
syscall /* Do the system call. */
cmpq $-4095, %rax /* Check %rax for error. */
jae __syscall_error /* Branch forward if it failed. */
ret /* Return to caller. */
In libc/sysdeps/linux/x86_64/__syscall_error.c, __syscall_error is
defined as
int __syscall_error(void) attribute_hidden;
int __syscall_error(void)
{
register int err_no __asm__ ("%rcx");
__asm__ ("mov %rax, %rcx\n\t"
"neg %rcx");
__set_errno(err_no);
return -1;
}
So __syscall_error returns -1 as a 32-bit int in a 64-bit register, %rax
(0x00000000ffffffff, whose decimal value is decimal 4294967295) and a
test like this always returns false:
if (syscall(number, ...) == -1)
foo();
Fix the error by making __syscall_error return a long, like syscall().
The problem can be circumvented by the caller by coercing the returned
value to int before comparing it to -1:
if ((int) syscall(number, ...) == -1)
foo();
The same problem probably occurs on other 64-bit systems but so far only
x86_64 was tested, so this change must be considered experimental.
Signed-off-by: Carlos Santos <unixmania@gmail.com>
|
|
On Linux/MIPS (O32 ABI) for system call we have two result registers - v0 and a3.
v0 contains actual syscall result on success or error number on fail, a3 set to 0/1
for indicating syscall success/fail. (if a3 == 1, v0 contains errno).
Now as we can see from definition of handle_sys (arch/mips/kernel/scall32-o32.S),
handler treats returned by syscall function (let's call "original") values in
range [-EMAXERRNO; 0[ as -errno, a3 is set to 1 and final returned (to userspace)
value is (-original).
INLINE_SYSCALL_NOERR_NCS defined in mips/bits/syscalls.h will handle
this behaviour.
Signed-off-by: Volodymyr Boyko <boyko.cxx@gmail.com>
|
|
Sync with GNU C library and consolidate duplicate non
architecture specific defines.
MAP_UNINITIALIZED is only defined to 0x4000000 and used by
the Linux kernel when CONFIG_MMAP_ALLOW_UNINITIALIZED is enabled.
CONFIG_MMAP_ALLOW_UNINITIALIZED is only available for nommu.
See Documentation/nommu-mmap.txt.
|
|
Add missing member in struct statfs.
It is used by xfsprogs (f.e. 4.13.1).
Reported-by: Joshua Kinard <kumba@gentoo.org>
|
|
It is supported both in the sense of being contained in mips version
of statfs/statfs64 structs and also in the sense that it's filled by
the corresponding kernel syscalls.
It is UNsupported in that sense that it's value is the same as that
of f_bsize (at least on older kernel versions, the oldest version
tested is 2.6.13), s. [1] and [2] for details ([1] is the latest
kernel version as of now, [2] is the oldest kernel version git
history is available for).
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/statfs.c?h=v4.14-rc7#n64
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/open.c?h=v2.6.12-rc2#n41
Follow-up of 68de9946e914d8c30dcc6667a059ea59e5b74cac
Signed-off-by: Eugene Rudoy <gene.devel@gmail.com>
Signed-off-by: Ralf Friedl <Ralf.Friedl@online.de>
|
|
After discussion on the busybox mailinglist.
Reported-by: Ralf Friedl <Ralf.Friedl@online.de>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
|
|
|
|
Sync with GNU C library. Found while trying to compile
linux-rdma to uClibc-ng.
Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
|
|
If you enable these wrappers, be sure you don't need long double
precision on your embedded device, as these only enables
long double warpper functions to the existing double math
functions. Required to build some software as lvm2.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
|
|
Follow GNU C Library from c579f48edba88380635ab98cb612030e3ed8691e
and remove the PID caching. These simplifies the architecture specific
assembly code.
The run of the test suite found no regressions, it even solves
some of the test failures for x86/x86_64/sparc.
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Vineet Gupta <Vineet.Gupta1@synopsys.com>
Acked-by: Matthew Fortune <Matthew.Fortune@imgtec.com>
Acked-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
|
|
|
|
|
|
|
|
|
|
|
|
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
As this is only implemented for a few architecture and not well
tested, just remove it.
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
ISC bind9 uses ptrsize, better use something else.
Reported-By: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Only alpha, hppa and sparc need non-default value.
|
|
glibc [BZ# 16922]
* sysdeps/mips/sys/asm.h (INT_SUB): Fix definition.
(LONG_SUB): Ditto.
(PTR_SUB): Ditto.
glibc commit 5057ad3b50
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
.globl can be used for every architecture so remove the define.
Sync with GNU C library.
|
|
It's even no longer required for non-ported ppc64
architecture. Sync with GNU C library.
This simplify the macros in include/libc-symbols.h.
|
|
Fixes following compile error, when UCLIBC_HAS_CONTEXT_FUNCS is enabled
on a mips64 build:
CC libc/sysdeps/linux/common/_exit.os
libc/sysdeps/linux/mips/swapcontext.S: Assembler messages:
libc/sysdeps/linux/mips/swapcontext.S:110: Error: Illegal operands `s.d fs6,(30*8+296)($4)'
libc/sysdeps/linux/mips/swapcontext.S:111: Error: Illegal operands `s.d fs7,(31*8+296)($4)'
libc/sysdeps/linux/mips/swapcontext.S:149: Error: Illegal operands `l.d fs6,(30*8+296)($2)'
libc/sysdeps/linux/mips/swapcontext.S:150: Error: Illegal operands `l.d fs7,(31*8+296)($2)'
Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
access to the jmp_buf structure occasionally happens asymmetrically:
fields defined in pointer size width (64 on N32) can be accessed as
32-bit words, but in that case, a̲l̲l̲ involved code must agree on that…
|
|
uClibc doesn't define signal info for the SIGSYS signal which is issued
in case of hitting a syscall prohibited by seccomp.
This is sad as it makes debugging seccomp filter policies impossible on
some architectures (at least ARM and PowerPC, maybe also others) which
do not coincidentally set si_value.sival_int as the syscall number.
To fix this, import the definitions and macros needed from glibc.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
https://dev.openwrt.org/browser/trunk/toolchain/uClibc/patches-0.9.33.2/616-mips_fix_stat_time.patch
When booting in Qemu you get for example failures from mdev -s otherwise.
|
|
Rename _timer[12] to si_tid and si_overrun to fix compilation of
strace-4.9+
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
This patch fixes the rest of the set-but-not-used warnings in the MIPS
code by using attribute_unused and also fixes some conversion warnings
by changing __arch_compare_and_exchange_xxx_[8|16]_int. Assigning __cmp
(int type) to __prev (pointer type) generates a warning. Assigning zero
to each separately avoids this warning without having to add a cast.
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Uclibc is not building for MIPS N64 because pread is trying to use the
pread/pwrite system calls instead of pread64/pwrite64. This patch fixes
the problem and was tested with LFS enabled and disabled.
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The INLINE_SYSCALL, INTERNAL_SYSCALL*, and internal_syscall* macros
are defined for MIPS in both libc/sysdeps/linux/mips/sysdep.h and
libc/sysdeps/linux/mips/bits/syscalls.h. The macros are the same
in both cases except that syscalls.h defines internal_syscalls[567]
the same for N32 and N64 ABIs and has a different definition for O32.
I believe that is correct. The sysdep.h header uses the O32 versions
for N32 and has different definitions for N64. I think that is wrong
and that N32 and N64 should share the same definition (modulo the
type 'long' vs. 'long long' for the arguments. This setup (from
sysdep.h) now agrees with what glibc has.
I am not positive about which header (sysdep.h vs syscalls.h) is
really the right one to have these definitions in but using sysdep.h
seems to work for all my builds.
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
When booting a Linux system with qemu-system-mips64 the execution
of $(pwd) in the ash shell triggers a segmentation fault. Ash uses
setjmp/longjmp for exception handling.
After looking at the glibc implementation,
I found some differences, with this patch tries to resolve.
Now the system boots up fine and no segmentation faults occur.
The global pointer should be restored and the types for the
register values should be wide enough.
See:
http://www.cygwin.com/ml/libc-alpha/2003-03/msg00363.html
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
This patch uses 'attribute_unused' to clean up a number of warnings
messages that are generated when doing a MIPS build. All of the
changes are in MIPS specific files and there are no code changes
other then adding the unused attribute where needed.
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
The MIPS build is failing when UCLIBC_HAS_LFS is set to "n"
because posix_fadvise64.c is included in the build when it
should not be.
Signed-off-by: Steve Ellcey <sellcey@mips.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
fork() is broken for MIPS64 N64 ABI. You can check it with a simple
C program statically linked with qemu-mips64 user emulation.
Internally fork() is using the clone system call (at least with NPTL)
with 5 arguments. See ./libpthread/nptl/sysdeps/unix/sysv/linux/i386/fork.c.
The calling conventions for MIPS N32 and N64 allow to use up to 8 registers
for that. See http://en.wikipedia.org/wiki/Calling_convention#MIPS
This is correctly implemented in libc/sysdeps/linux/mips/bits/syscalls.h,
but not in libc/sysdeps/linux/mips/sysdep.h. fork.c uses the later one.
It seems that fork() works fine for MIPS64 N32 with just using the stack like
with the O32 case. There is a user of INLINE_SYSCALL with 7 arguments in
libc/sysdeps/linux/common/sync_file_range.c for MIPS64 N32, so I decided to
only use the macros for the MIPS64 N64 case. With this patch my uClibc based
Linux system boots up fine in qemu-system-mips64.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Make __SIGEV_PAD_SIZE to take __WORDSIZE into account for alpha, mips
and ia64 arches.
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Add "__pid_t _tid" member which is used for some packages, like rt-test
for instance, which fails with an error like this one:
src/cyclictest/cyclictest.c:638:9: error: 'union <anonymous>' has no
member named '_tid'
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
* Add a common ret_ERRVAL definition
* Remove ret_ERRVAL from architectures using the common 'ret'
* Add 'undef' to architectures that need a different return instruction
* Add '#include <common/sysdep.h>' to cris and ia64 that were missing it
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|
|
Prompted by lkml discussion of a MIPS bug where sending
signal 128 was found to be able to crash the machine :/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
|
|
As in timerfd.h, eventfd.h needs arch-specific definition files.
alpha, mips and sparc needs separate file, all the other arch
will use common definition.
This problem is already fixed in glibc.
Also sanitize and provide bits for hppa.
Make sure not to install the new bits/eventfd unless eventfd support is
enabled.
Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
|