summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
AgeCommit message (Collapse)Author
2018-09-21bugfix renameat2 wrong implement.Guo Ren
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-08-16sched_setaffinity: use the same style with glibc'sGuo Ren
Call getpid() in INTERNAL_SYSCALL will break the argument regs, because gcc couldn't save destoryed regs for system call asm. Ref to glibc, we could just remove all the check code. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-08-10arm/clone.S: Fix threading supportChristophe Lyon
Change clone.S so that in FDPIC case we take into account the fact that we are given a function descriptor. * libc/sysdeps/linux/arm/clone.S (__clone): Support __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10Add runtime support needed for C++ exceptionsChristophe Lyon
Implements __gnu_Unwind_Find_got(), which is called from libgcc while unwinding. * libc/sysdeps/linux/arm/Makefile.arch (CSRC): Add find._got.c. * libc/sysdeps/linux/arm/find_got.c: New file. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10Add application startup code for FDPICChristophe Lyon
* libc/sysdeps/linux/arm/crt1.S: Define _start for __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-08-10rtld: Add FDPIC code for armChristophe Lyon
Add FDPIC dynamic relocations support, similar to what other FDPIC targets do. Lazy binding is implemented in a folllow-up patch. Disable the SEND* macros because they involve relocations to access constant strings that are unsupported by the existing arm version. Define DL_START, START, ARCH_NEEDS_BOOTSTRAP_RELOCS, DL_CHECK_LIB_TYPE similarly to what other FDPIC targets do. Define raise() because _dl_find_hash references __aeabi_uidivmod, which uses __aeabi_idiv0 which in turn references raise. * include/elf.h (R_ARM_FUNCDESC): Define. (R_ARM_FUNCDESC_VALUE): Define. * ldso/include/dl-string.h (SEND_STDERR, SEND_ADDRESS_STDERR) (SEND_NUMBER_STDERR): Define empty for __FDPIC__. * ldso/ldso/arm/dl-inlines.h: New file. * ldso/ldso/arm/dl-startup.h (PERFORM_BOOTSTRAP_RELOC): Fix type of load_addr. Fix handling of R_ARM_RELATIVE, add support for R_ARM_FUNCDESC_VALUE. (DL_START, START): Define for __FDPIC__. (raise): Define. * ldso/ldso/arm/dl-sysdep.h (ARCH_NEEDS_BOOTSTRAP_RELOCS): Define. (DL_CHECK_LIB_TYPE): Define. (elf_machine_type_class): Take into account FDPIC related relocations. (elf_machine_load_address): Support __FDPIC__. (elf_machine_relative): Likewise. * ldso/ldso/arm/elfinterp.c (_dl_linux_resolver): Dummy support for __FDPIC__, implemented in a later patch. (_dl_do_reloc): Fix reloc_adr computation for __FDPIC__, fix handling of local symbols. Fix handling of R_ARM_RELATIVE, add support for R_ARM_FUNCDESC_VALUE, R_ARM_FUNCDESC. * ldso/ldso/arm/resolve.S: Make _dl_linux_resolve hidden. * ldso/ldso/fdpic/dl-inlines.h (htab_delete): Declare. * libc/sysdeps/linux/arm/bits/elf-fdpic.h: New file, similar to bfin's. * libc/sysdeps/linux/arm/crtreloc.c: Likewise. * libc/sysdeps/linux/arm/find_exidx.c (__dl_addr_in_loadaddr) Define. (find_exidx_callback): Support __FDPIC__. Signed-off-by: Mickaël Guêné <mickael.guene@st.com> Signed-off-by: Christophe Lyon <christophe.lyon@st.com>
2018-06-10risc-v: initial 64 bit port, static only (no TLS/NPTL)Waldemar Brodkorb
Only a simple hello world is tested in qemu system emulation.
2018-04-17common/sendfile.c: bugfix can't support offset is NULLGuo Ren
In ltp testcase sendfile08.c, it use offset=NULL to test the api. PATCH V2: fixup the stupid missing check in the end. Sorry for lose test. See "man sendfile" and it really support offset is NULL. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-04-17Revert "common/sendfile.c: bugfix can't support offset is NULL"Waldemar Brodkorb
This reverts commit b00fd230ed0b49b9f23d829ad5d09859f34bb754.
2018-04-13lseek.c: bugfix ltp lseek01.cGuo Ren
Ref the implement from the glibc and high=0 seems so bad. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-04-13common/sendfile.c: bugfix can't support offset is NULLGuo Ren
In ltp testcase sendfile08.c, it use offset=NULL to test the api. See "man sendfile" and it really support offset is NULL. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-04-13or1k: add F_{DUPFD_CLOEXEC, SETPIPE_SZ, GETPIPE_SZ}Thomas Petazzoni
Those definitions exist on all other architectures, but were not present in or1k specific headers when or1k support was merged. On the kernel side, their support is completely architecture independent, so we just need those definitions to make those fcntl() calls available on or1k. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-04-02use __NR_newfstatat only for modern Linux architecturesWaldemar Brodkorb
Otherwise it breaks mips64 n64. Should be used for aarch64/tilegx only.
2018-03-22hppa: fix runtime issuesWaldemar Brodkorb
Sync clone()/vfork() with GNU C Library. Allow CFI and fix strsignal() / tcsetattr().
2018-03-15csky: support bsd-setjmp and bsd-_setjmp.Guo Ren
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-03-12tile: add basic support for tilegxWaldemar Brodkorb
This adds basic support for tile architecture. Only static binaries, no ld.so or threading support. Tested with qemu-tilegx only.
2018-03-09sparc32: Add nop before __startcontext to stop unwindingWaldemar Brodkorb
From glibc commit 9aa5c222b9e0409143410a02b6364a3b25dbf028 [BZ #22919]
2018-02-26stat.h: fix issue with aarch64Waldemar Brodkorb
2018-02-17bits/socket.h: add missing definesWaldemar Brodkorb
Newer iproute2 package make use of some of defines. Sync missing defines with GNU C library.
2018-02-12uClibc-ng does not implement name_to_handle_atAlexey Neyman
... so don't declare it. Otherwise, eudev finds it declared and tries to link with it - and fails. Signed-off-by: Alexey Neyman <stilor@att.net>
2018-02-04mman: disable memfd_create declarationWaldemar Brodkorb
2018-02-03csky: bugfix ltp open12 failed.Guo Ren
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2018-02-03bits/mman.h: consolidate header fileWaldemar Brodkorb
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.
2018-01-31aarch64/sys/ucontext.h: include bits/sigcontext.hBernd Kuhls
Fixes a buildroot build error with ffmpeg In file included from /home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/signal.h:329:0, from fftools/ffmpeg.h:26, from fftools/ffmpeg_opt.c:23: /home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/sys/ucontext.h:52:16: error: field 'uc_mcontext' has incomplete type mcontext_t uc_mcontext; ^~~~~~~~~~~ using this defconfig: BR2_aarch64=y BR2_PACKAGE_FFMPEG=y sys/ucontext.h for other archs already include bits/sigcontext.h, on aarch64 this is needed as well. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
2018-01-21simplify and fix getcwdWaldemar Brodkorb
The fallback code is not used as all supported kernels have the syscall. Check if a absolute path is returned from syscall.
2018-01-15rt: cleanup and allow to build for linuxthreadsWaldemar Brodkorb
It seems there is no real dependency to NPTL for these clock_* functions when UCLIBC_ADVANCED_REALTIME is enabled. No regressions found. Reported-by: Baruch Siach <baruch@tkos.co.il>
2018-01-15nds32: Add syscall macros for 5 and 6 parametersStafford Horne
This is to fix an error after switching to use generic syscalls. libc/sysdeps/linux/common/syscall.c: In function 'syscall': libc/sysdeps/linux/common/syscall.c:27:2: warning: implicit declaration of function 'internal_syscall_ncs6' [-Wimplicit-function-declaration] return INLINE_SYSCALL_NCS(sysnum, 6, arg1, arg2, arg3, arg4, arg5, arg6); ^ Defining these functions as described by Vincent Ren-Wei Chen <vincentc@andestech.com> Signed-off-by: Stafford Horne <shorne@gmail.com>
2018-01-15nds32: Use new common syscall() implementationStafford Horne
Traditionally nds32 has had a generic syscall implementation supporting varargs. During an audit it was found that this implementation seems to duplicate the new common implementation and is no longer needed. Signed-off-by: Stafford Horne <shorne@gmail.com>
2018-01-15or1k: Use new common syscall() implementationStafford Horne
Now that the common syscall implementation supports vararg calling conventions we can safely use it on OpenRISC. This saves a bit of code in the openrisc implementation. Signed-off-by: Stafford Horne <shorne@gmail.com>
2018-01-15syscall: Make common implementation match unistd.hStafford Horne
The definition of syscall() in unistd.h is with varargs. Traditionally the common implementation in uclibc has been with regular arguments. This patch updates that by using varargs. This has caused issues on architectures like or1k which have different calling conventions for varargs and regular arg parameters. The implementation here is based on an implementation from Joel Stanley <joel@jms.id.au>. There is a difference that I do not initialize the stack args with 0 as they are immediately overwritten by va_args. Signed-off-by: Stafford Horne <shorne@gmail.com>
2018-01-08csky: bugfix libc sync_file_range.c for csky.Guo Ren
Use __NR_sync_file_range2 for csky sync_file_range function. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2017-12-31m68k: add NPTL/TLS supportWaldemar Brodkorb
Port over NPTL/TLS support from GNU C Library. In the first step only the slower syscall is used for TLS access. The uClibc-ng testsuite shows 79 errors, so their is room for bugfixes and improvements.
2017-12-28csky: add Copyright.Guo Ren
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2017-12-10or1k: syscall: Pass arguments on the stackJoel Stanley
Busybox internally calls syscall(2). - in unistd.h defined something like int syscall(nr, ....) - in syscall.c (common) implemented as int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6) This will not work, busybox thinks syscall should have varargs calling conventions. But it doesnt in the uclibc implementation so no args go through. Most architectures this will work. But on openrisc varargs are all sent on the stack. Regular args are passed in registers. Commit message and idea from Stafford Horne <shorne@gmail.com>. Signed-off-by: Joel Stanley <joel@jms.id.au>
2017-12-03x86_64: add fenv support from glibcWaldemar Brodkorb
2017-11-25statfs.h: add f_flagsWaldemar Brodkorb
Add missing member in struct statfs. It is used by xfsprogs (f.e. 4.13.1). Reported-by: Joshua Kinard <kumba@gentoo.org>
2017-11-25setjmp/longjmp saves only non-call clobbered regsChristian Svensson
Previously we saved everything, but we only need to save the registers that are promised to be untouched by the setjmp call.
2017-11-25Update __longjmp.SChristian Svensson
2017-11-22remove misleading comment about f_frsize fieldEugene Rudoy
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>
2017-11-22librt: fix broken posix_spawnWaldemar Brodkorb
Fix iteration over signals, synced with GNU C library code and pending patches. Issues found when running dhcpcd with hook scripts. (exit status 127) Reported-By: kapeka <kapeka@bering-uclibc.de>
2017-11-19csky: port to uclibc-ngGuo Ren
Follow the steps to build c-sky uclibc linux system: 1. git clone https://github.com/c-sky/buildroot.git 2. cd buildroot 3. make qemu_csky_ck810_uclibc_defconfig 4. make Follow the buildroot/board/qemu/csky/readme.txt to run. This buildroot toolchain is pre-build, But you can rebuild the c-sky uclibc-ng alone and install it to the buildroot sysroot manually. We'll try our best to improve the uclibc-ng continuously. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2017-11-19remove unused FORTIFY code fragmentsWaldemar Brodkorb
2017-11-18use atomic instructions for atomicsStafford Horne
Signed-off-by: Stafford Horne <shorne@gmail.com>
2017-11-16or1k: remove unused fileWaldemar Brodkorb
2017-11-03math: add exception handling functionalitySergey Cherkashin
According to standards SVID and SYSV. Modified lgamma calling in case when 'signgam' variable should not be used. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-11-03Define _STATFS_F_FRSIZE for MIPSWaldemar Brodkorb
After discussion on the busybox mailinglist. Reported-by: Ralf Friedl <Ralf.Friedl@online.de> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2017-10-11h8300: remove dead codeWaldemar Brodkorb
As h8/300 architecture does not use deprecated syscalls after reintroduction into Linux upstream, this part of the code in vfork.S is always unused.
2017-10-01preadv/pwritev: bugfix preadv/pwritev syscall should be 5 argsGuo Ren
The current uclibc-ng use 4 arguments, and this will cause ltp-testsuite's preadv/pwritev case failed. The syscall of preadv/pwritev in current linux-kernel is 5 arguments: linux/fs/read_write.c: SYSCALL_DEFINE5(preadv, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h) SYSCALL_DEFINE5(pwritev, unsigned long, fd, const struct iovec __user *, vec, unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h) So just update to 5-args-syscall, and off_t could be 32bit or 64bit. Signed-off-by: Guo Ren <ren_guo@c-sky.com>
2017-09-14arc: Ensure that debugger can recognize sigrestorerAnton Kolesov
An issue has been found with current implementation of signal restorer function in uClibc and how GDB handles it. When debugger information is not present, everything worked fine, because GDB would use a built-in logic to determine if function is a signal restorer. However when debugging information is present, debugger would rely solely on it and wouldn't use ARC-specific functions to detect signal handler frames. Because debug information for signal restorer is generated completely by the compiler, it lacks a marker, that identifies this as a signal frame that requires special handling. While it is possible to insert that marker via inline assembly, that still doesn't solve the whole problem, because some other expectations are not met by the debug information - there is no "nop" in front of the function, needed to fool debugger into thinking that this was a function call, and references to previous frame information need to be described manually. The simplest way to fix the problem is just to make sure that signal restorer function will not have any debug function at all, which can be done by writing it in assembly. Alternative, more complex, solution, where debug information for signal frame is manually defined can be found in glibc/sysdeps/unix/sysv/linux/x86_64/sigaction.c [1]. [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/x86_64/sigaction.c;hb=HEAD Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
2017-08-10sys/ptrace.h: remove obsolete Linux PTRACE_SEIZE_DEVEL constantWaldemar Brodkorb
Remove enum __ptrace_flags along with the only constant it contains, PTRACE_SEIZE_DEVEL, from Linux's sys/ptrace.h files. Following GNU C library commit: 60e2846e2633a990bdf474004a373bde54c0bc5f