Age | Commit message (Collapse) | Author |
|
crt1.S needed to use a got relative reference.
Libraries like pthreads define a _init and unless it is GOT, the
linker will fail because it will try to create a dynamic reloc on
.text section, more precisely on __start.
Signed-off-by: Cupertino Miranda <cmiranda@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vlad Zakharov <vzakhar@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
|
|
This was found by Buildroot autobuilders for m68k.
|
|
This change was inspired by similar change in glibc:
https://sourceware.org/git/?p=glibc.git;a=commit;h=0cb313f7cb0e418b3d56f3a2ac69790522ab825d
Current Linux kernel requires CLONE_VM to be set with CLONE_THREAD
otherwise returning -EINVAL, see man clone2. This means we don't need
to check for both CLONE_THREAD and CLONE_VM instead we may simplify
code a lot and just check 1 bit (CLONE_THREAD).
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
|
|
For thread group case (CLONE_THREAD), the cached PID of new process/thread
need not be reset. The old logic to decide that was flawed as it would be
true only for exact combination of CLONE_THREAD + _VM, but would fail for
CLONE_THREAD + _VM + _xyz.
More detailed tear-down of current and new code below.
Current implementation is:
--------------------->8--------------------
; r12 contains clone flags
mov_s r2, CLONE_THREAD_N_VM; r2 contains bit mask
and_s r2, r2, r12 ; r2 contains bit mask AND clone flags
; but r12 still contains the same flags
brne r2, r12, .Lgo_thread ; here we compare modified mask with
; flags as they were and skip pthread TID/PID
; setup if r2 != r12 which happens all
; the time except clone flags were
; exactly CLONE_THREAD | CLONE_VM
--------------------->8--------------------
New implementation is:
--------------------->8--------------------
; r12 contains clone flags
mov_s r2, CLONE_THREAD_N_VM; r2 contains bit mask
and_s r12, r12, r2 ; r12 contains clone flags AND bit mask
; i.e. we did mask all flags except
; CLONE_THREAD and CLONE_VM
breq r2, r12, .Lgo_thread ; here we compare masked flags with
; target mask and if they match we skip
; pthread TID/PID setup
--------------------->8--------------------
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
|
|
Caught by tst-getpid1 test from uClibc's test-suite.
It looks like original implementation was not correct.
The code in question is supposed to recover PID of the new
thread. And by no means that could happen with clone() syscall
while getpid() does exactly this.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Reported-by: Eugeniy Paltsev <paltsev@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.
|
|
|
|
As this is only implemented for a few architecture and not well
tested, just remove it.
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
In uClibc-ng the syscall macros are in bits/syscalls.h.
|
|
Add support for Andes Technology NDS32 architecture.
See here http://www.andestech.com/en/index/index.htm for more
informaton. Verification of the port from an older uClibc
port was done on a sponsored AG101p board.
The testsuite only has 5 errors, three are related to
an existing bug in dlclose() with LT.old, also happening
on cris32 and m68k.
Failures to fallocate/posix_fallocate are unresolved.
Thanks to Andes Technology sponsoring the hardware and
being very helpful while doing the uClibc-ng porting.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Commit 251a3c19cb "sleep: employ __USE_EXTERN_INLINES (with necessary fixes)"
introduces following problems:
1. __USE_EXTERN_INLINES forcibly enabled build fails
...
LD libuClibc-1.0.15.so
libc/libc_so.a(cmsg_nxthdr.os): In function `__GI___cmsg_nxthdr':
cmsg_nxthdr.c:(.text.__GI___cmsg_nxthdr+0x0): multiple definition of `__GI___cmsg_nxthdr'
libc/libc_so.a(close.os):close.c:(.text.__GI___cmsg_nxthdr+0x0): first defined here
libc/libc_so.a(creat.os): In function `__GI___cmsg_nxthdr':
creat.c:(.text.__GI___cmsg_nxthdr+0x0): multiple definition of `__GI___cmsg_nxthdr'
libc/libc_so.a(close.os):close.c:(.text.__GI___cmsg_nxthdr+0x0): first defined here
...
2. libuargp wrongly contains __cmsg_nxthdr/__sigismember/__sigdelset/__sigaddset
global symbols on platforms which includes signal.h from sys/procfs.h
As result, static linking will fail:
TEST_LINK argp/ bug-argp1
/home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os):
In function `__GI___sigismember':
sigsetops.c:(.text+0x0): multiple definition of `__sigismember'
/home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x0):
first defined here
/home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os):
In function `__GI___sigaddset':
sigsetops.c:(.text+0x28): multiple definition of `__sigaddset'
/home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x28):
first defined here
/home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libc.a(sigsetops.os):
In function `__GI___sigdelset':
sigsetops.c:(.text+0x4c): multiple definition of `__sigdelset'
/home/wbx/ppc-static/target_qemu-ppc-macppc_uclibc-ng_hard/usr/lib/libuargp.a(argp-xinl.os):argp-xinl.c:(.text+0x4c):
first defined here
We have to partially revert 251a3c19cb to fix problems above. It is
safe to do this after commit
162cfaea20 *: inline constant __sig{add,del}set and __sigismember
since we are able to use new inlines from within libc and leave the
rest of world(__USE_EXTERN_INLINES) equal to glibc now.
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Currently crt1 takes address of functions (main,_init,_fini) directly
which doesn't generate truely position independent code, but zero based
values instead. e.g.
| __start:
| ...
| add_s r2,sp,0x4
| mov_s r0, main
generates to
| 000156ec <__start>:
| ...
| 156f4: add_s r2,sp,0x4
| 156f6: mov_s r0,0x15f7c
| ...
| 00015f7c <main>:
| 15f7c: push_s blink
This works just fine for the normal (non PIE) dynamic executables since
they are loaded at address 0. However this is not true for PIE
executables. So for Scrt1 we use a true position independent way when
taking function addresses.
Cc: uclibc@uclibc.org <uclibc@uclibc.org>
Cc: devel@uclibc-ng.org <devel@uclibc-ng.org>
Cc: Cupertino Miranda <cmiranda@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
|
|
Linux Standard Base specifies section .note.ABI-tag that can be considered
as a marker for ELF files targeted to Linux systems. See
https://refspecs.linuxfoundation.org/LSB_1.2.0/gLSB/noteabitag.html
This section, for example, is used by the GDB to identify Linux ELFs as
compared to baremetal ELFs that do not have this section.
Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>
|
|
|
|
Nobody should use gcc 3.3 nowadays.
|
|
These files are not used, no regression found while
running the testsuite.
|
|
Remove ppc64 bits and bytes, as we don't support ppc64 and
it makes the code more readable without the dead code.
|
|
|
|
Sync mostly with GNU libc implementation of setjmp/longjmp.
Just generate PIC compatible code, so no difference for static
builds are made. Add sysdep.h with some handy assembly macros
used inside setjmp.S/__longjmp.S.
This unbreaks dynamic linker support, first test suite run
only shows 10 errors, which doesn't look so bad.
|
|
Linuxthreads.new isn't really useful with the existence
of NPTL/TLS for well supported architectures. There is no
reason to use LT.new for ARM/MIPS or other architectures
supporting NPTL/TLS. It is not available for noMMU architectures
like Blackfin or FR-V. To simplify the live of the few uClibc-ng
developers, LT.new is removed and LT.old is renamed to LT.
LINUXTHREADS_OLD -> UCLIBC_HAS_LINUXTHREADS
|
|
Ported over from glibc mostly without changes.
Lightly tested with mongrel2 in qemu-system-sparc.
|
|
|
|
License notices in most of the source files refer to an outdated
FSF address. Replace it with URL, like in the rest of the source
files.Signed-off-by: Nikola Forró <nforro@redhat.com>
|
|
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
|
|
On systems where uClibc doesn't provide an arch specific byteswap.h,
we fall back on bits/byteswap-common.h. However, there is a bug
in this header in the __bswap_constant_64(x) macro. If, for example,
a double is passed, we get 'invalid operands to binary &' in which we
mismatch a 'double' and 'long long unsigned int'. The newer glibc
headers fix this and so we import them. Also, since the inclusion of
byteswap.h is not appropriate for assembly code, we guard a portion
of endian.h which uses byteswap.h from inclusion in any assembly.
This is needed, for example, for f2fs-tools 1.6.0 on 32-bit big
endian PowerPC.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
Currently, the Thumb support on ARM has three related Config.in
options, which are not trivial for users to understand, and are in
fact not needed:
- The USE_BX option is not needed: knowing whether BX is available or
not is easy. If you have an ARM > v4 or ARMv4T, then BX is
available, otherwise it's not. This is the logic used in glibc.
- The USE_LDREXSTREX option is not needed: whenever Thumb2 is
available, ldrex/strex are available, so we can simply rely on
__thumb2__ to determine whether ldrex/strex should be used, without
requiring a Config.in option.
- Once USE_BX and USE_LDREXSTREX are removed, the only thing left
that COMPILE_IN_THUMB does is to set -mthumb. This makes the option
unnecessary, as on ARM at least, the user is already supposed to
pass -march=<foo> or other compiler options tuning the library for
a specific ARM variant. There is no reason to do otherwise for
Thumb, which allows to get rid of the COMPILE_IN_THUMB option.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
Register window saving loop in __sigsetjmp incorrectly calculates offset
in the jmp_buf in case it was called with call12. The bug was introduced
in commit f4b1b7ade7971141 "xtensa: fix setjmp that didn't save all
registers correctly".
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
|
|
__JMP_BUF_SP is the index of a stack pointer slot in the __jmp_buf.
According to ARM __sigsetjmp code it does not depend on configuration
parameter __UCLIBC_HAS_FPU__. Make its definition unconditional.
__JMP_BUF_SP is used in the unwind_stop through the
_JMPBUF_CFA_UNWINDS_ADJ macro, this change fixes cleanup routines call
on thread cancellation in configurations with hard FP.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
For some xtensa cores generated code gets arranged so that
__default_sa_restorer immediately follows preceding function. E.g.:
40a1b: c03340 sub a3, a3, a4
40a1e: f01d retw.n
00040a20 <__default_sa_restorer>:
40a20: e1a022 movi a2, 225
40a23: 005000 syscall
...
Contents of the .eh_frame section:
...
000007f4 00000014 000007f8 FDE cie=00000000 pc=0004076c..00040a20
DW_CFA_advance_loc4: 3 to 0004076f
DW_CFA_def_cfa_offset: 48
Due to the way xtensa libgcc uw_frame_state_for calls _Unwind_Find_FDE
for non-signal frames, FDE for the previous function is found during
thread cancellation signal stack unwinding in that case. Signal stack
frame is not recognized and is not unwound properly, breaking cleanup
routines calling for cancelled thread.
Insert padding before the __default_sa_restorer so that no FDE is found
for it, MD_FALLBACK_FRAME_STATE_FOR is called by uw_frame_state_for and
the frame is correctly recognized as signal frame.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
|
|
The FR-V port is really broken, and I have no emulator
or hardware for this platform. I tried to get some hardware
from RedHat, who made the FR-V port initially. Unfortunately
Fujitsi didn't agreed to sent me some of their unused spare
hardware lying @RedHat. As I invested some time to get stuff compiled,
I decided to add the code and may be anytime later I can gain
access to some emulator or hardware.
GDB simulator for FR-V doesn't support booting Linux AFAIK.
|
|
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>
|
|
Althought recent versions of sofware don't require it, old ntpd
wants - see http://bugs.ntp.org/show_bug.cgi?id=769
Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
Some software make use of exp10, so add it.
Basic testing with LTP.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
|
|
At least allow to compile a toolchain targeting nios2 without MMU.
|
|
At least allow to build a toolchain for hppa.
Sync some headers with glibc.
|
|
libc/sysdeps/linux/common/euidaccess.c:1:1: warning: "_GNU_SOURCE" redefined
In file included from <command-line>:0:
./include/libc-symbols.h:52:1: warning: this is the location of the previous definition
Signed-Off-By: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Different define of latest kernel.
kernel define is
#define O_DIRECT 00040000 /* direct disk access hint */
#define O_DIRECTORY 00200000 /* must be a directory */
Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
Patch from OpenWrt.
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
Reported-by: Leonid Lisovskiy <lly.dev@gmail.com>
|
|
open_cancel and open2_cancel have diffrent argument on open.
So can't alias this functions.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
If argument passing to register case (ex. -mregparam=3).
This case set all parameters set to register from caller.
But callee refer to stack. So can't get parameter.
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
|
|
syncfs() was recently added (commit dfa593d4d). But man sync(2) specifies
that syncfs() is Linux-specific. This was overlooked in the original
commit so we add it to the set of Linux-specific functions supported by
uClibc.
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
One test fails to compile with a gcc ICE, so disable it for now.
|
|
|