9703 Commits

Author SHA1 Message Date
Vineet Gupta
ca1c74d67d NPTL/arc: notify kernel of the TP value
Native gdb makes a ptrace (GET_THREAD_AREA) which needs to return the
TP. however when libc sets up TP reg (for main thread), it doesn't call
arc_settls syscall so kernel doesn't know of TP register details
(moreso because clone doesnt have SETTLS flag)

Note that kernel doesn't know about r25 being TP etc.

This commit got lost in merge of NPTL tools into arc-mainline-dev and
showed up again as STAR 9000919529 (native gdb can't debug threaded
apps)

	------->8---------------
	[ARCLinux]# gdb ./pth
	Reading symbols from ./pth...(no debugging symbols found)...done.
	(gdb) b main
	Breakpoint 1 at 0x106f2
	(gdb) r
	Starting program: /pth
	[Thread debugging using libthread_db enabled]
	Using host libthread_db library "/lib/libthread_db.so.1".
	thread_get_info_callback: cannot get thread info: generic error
	(gdb) q
	------->8---------------
Debugged-by: Anton Kolesov <akolesov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-07-05 22:09:46 +02:00
Bernhard Reutner-Fischer
9930f8b92b getconf.c: undef VERSION
might come in via nptl so undef it before redefining it

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-28 17:05:43 +02:00
Alexey Brodkin
c058c0578d ARC: enable IPv6 in defconfigs
These days IPv6 is used more and more in different software
packages. And so we're adding IPv6 support by default in uClibc
for ARC cores.

Signed-off-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 22:22:00 +02:00
Yoshinori Sato
e158f13f3d h8300: Makefile update
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 22:20:12 +02:00
Yoshinori Sato
8c79e4541e h8300: Add new feature
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 22:15:35 +02:00
Yoshinori Sato
dc19aa5479 h8300: headers update
- wire up new kernel

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 22:15:35 +02:00
Yoshinori Sato
5e3820a8c6 h8300: Assembly functions
- remove symbol prefix
- new startup
- new clone syscall support

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 22:15:26 +02:00
Yoshinori Sato
62775f4518 h8300: 64bit integer support
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 21:59:19 +02:00
Yoshinori Sato
7a8856c38c h8300: config update
- New toolchain
- Add new flags

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-26 21:59:18 +02:00
Daniel Golle
274f3c8456 siginfo: add signal info for seccomp related SIGSYS
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>
2015-05-20 12:26:26 +02:00
Andrew Burgess
ec0827d3c2 test/silly: Extend include path.
When attempting to build uClibc under buildroot, including building the
tests, the silly tests don't currently compile, a result of attempting
to build using a compiler that does not yet have an installed version of
uClibc available.  The error is a missing header file, specifically
atomic.h.

Taking inspiration from the nptl tests, I have extended the EXTRA_CFLAGS
variable to add the required include paths.  The tests can now be built
under buildroot.

Signed-off-by: Andrew Burgess <andrew.burgess@embecosm.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-20 12:18:19 +02:00
Will Newton
fe7d30e633 _scanf.c: Implement 'm' modifier for 'c' and '[' conversions.
The current code implements the 'm' modifier only for 's'
conversions and would cause a segfault if it was used for 'c'
or '[' conversions. This patch extends the code to cover these
cases too.

The original version could write scanned data outside the passed buffer
because index i used in the '[' conversion handling block was clobbered.

Signed-off-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-20 10:59:30 +02:00
Bernhard Reutner-Fischer
bfbcc35b0f nptl_db: fix ommitting td_ta_setconcurrency
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-06 22:38:38 +02:00
Roland McGrath
62175247d9 init.c (__nptl_initial_report_events): New variable.
(__pthread_initialize_minimal_internal): Initialize pd->report_events
	to that.

This patch helps NPTL report TD_CREATE event, so that GDB could catch the
event and update its thread_list.
Link: http://lists.uclibc.org/pipermail/uclibc/2015-April/048921.html
[shengyong:
 - original patch from glibc: commit 7d9d8bd18906fdd17364f372b160d7ab896ce909
 - context adjust
 - update nptl_db/ChangeLog]

Signed-off-by: Roland McGrath <roland@gnu.org>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-05-06 22:19:31 +02:00
Bernhard Reutner-Fischer
5b691e38f4 buildsys: pregen depends on xlocale
pt-initfini eventually depends on xlocale

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-29 23:52:18 +02:00
Bernhard Reutner-Fischer
9a1e4d650e strftime: comment on %0xY %+nY %-nY
Would fix: date -u +%4Y%2m%2d%2H%2M%2S

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-29 10:41:42 +02:00
Bernhard Reutner-Fischer
3010966c6d buildsys: swap V=1 with V=2 command printing
Previously V=1 did print abbreviated commands and V=2 the full commands.

Kbuild-based build-systems behave in the opposite way and this is
apparently confusing or inconvenient for users so swap our V handling to
be in line with kbuild (and automake as far as V=0 / V=1 is concerned).

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-29 10:22:18 +02:00
Bernhard Reutner-Fischer
d5ecf4cf9e buildsys: LT{,.old} CRT prereq
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-23 23:17:00 +02:00
Bernhard Reutner-Fischer
22176277c8 buildsys: Tweak pregen wrt headers_dep
Required for !NPTL, !context-funcs for example.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-23 23:15:45 +02:00
Alexey Brodkin
f1f98784e6 ARC: enable more options to satisfy build requirements of applications
As reported by Buildroot autobuilder following options were missing:

 * Libutil stub (UCLIBC_HAS_LIBUTIL option)
   http://autobuild.buildroot.org/results/ce3/ce39eb9b9ece0968563641fb2207099d1a37b191/

 * Program_invocation_name (UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y)
   http://autobuild.buildroot.org/results/154/1546d909e606daefd41b87dece94d642c0fdeba4/
   http://autobuild.buildroot.org/results/bd5/bd54581d7b0cc73bc501072d27e870a443dfce79/

 * Ifaddrd support (UCLIBC_SUPPORT_AI_ADDRCONFIG=y)
   http://autobuild.buildroot.org/results/134/134e78ef1fa87f7fbf26c23ec5dfc68785d79613/

 * Libnsl (UCLIBC_HAS_LIBNSL_STUB=y)
   http://autobuild.buildroot.net/results/331/331ed781b422448205fb9e7c9730ec0c438d6306/
   http://autobuild.buildroot.net/results/402/402d64965ac7ac6e1d4e1990080394958802fe8c/
   http://autobuild.buildroot.net/results/960/9605bac2972d3e3d3fb91947ae6921e89210247b/
   http://autobuild.buildroot.net/results/6b6/6b61ea80a3a6dcead233c4b408eba8b8d647e841/

* UTMP got reworked recently, which breaks packages such as busybox, gdbserver
  etc so enable that too

Enabling mentioned options to make sure more packages could be built with ARC pre-built uClibc tools.

Note UCLIBC_USE_NETLINK is a prerequisite for UCLIBC_SUPPORT_AI_ADDRCONFIG.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 20:02:15 +02:00
Bernhard Reutner-Fischer
6173ee4f61 buildsys: pregen depends on xlocale
since ae9e3f46 sched.h pulls in stdlib.h (for malloc() and free()) and
thus also xlocale..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 20:00:48 +02:00
Bernhard Reutner-Fischer
e71fc570ca arm: Add BX and BXC macros
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 20:00:24 +02:00
Bernhard Reutner-Fischer
298f58e073 arm: Fix POP_RET for armv4t && interworking
It seems the condition was reversed which lead to e.g. arm-920t being
confused

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 20:00:09 +02:00
Bernhard Reutner-Fischer
7c78a5c52b NPTL: Rename a variable
There seems to be a bug in gold with static TLS at least on x86_64 (?)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 19:59:09 +02:00
Bernhard Reutner-Fischer
8e04c064c4 ldso: PRELINK: Remove surplus newline
in early debugging code

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 19:58:40 +02:00
Bernhard Reutner-Fischer
9058b43530 buildsys: try to merge all constants
Saves a couple of bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-22 19:57:40 +02:00
Bernhard Reutner-Fischer
c78cc48514 arm: thumb1: Fix conflicting types for _v3
In file included from ./include/sys/syscall.h:33:0,
                 from libc/sysdeps/linux/common/sync_file_range.c:10:
libc/sysdeps/linux/common/sync_file_range.c: In function '__sync_file_range_nocancel':
./include/bits/syscalls.h:144:16: error: conflicting types for '_v3'
   register int _v3 __asm__ ("v3") = _v3tmp;
                ^
./libc/sysdeps/linux/arm/sysdep.h:281:7: note: in expansion of macro 'LOAD_ARGS_7'
       LOAD_ARGS_##nr (args)     \
       ^
./libc/sysdeps/linux/arm/sysdep.h:324:2: note: in expansion of macro 'INTERNAL_SYSCALL_RAW'
  INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
  ^
./libc/sysdeps/linux/arm/sysdep.h:256:40: note: in expansion of macro 'INTERNAL_SYSCALL'
   ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL (name, , nr, args); \
                                        ^
libc/sysdeps/linux/common/sync_file_range.c:32:9: note: in expansion of macro 'INLINE_SYSCALL'
  return INLINE_SYSCALL(sync_file_range, 7, fd, 0,
         ^
In file included from ./libpthread/nptl/sysdeps/unix/sysv/linux/arm/sysdep-cancel.h:18:0,
                 from ./include/cancel.h:58,
                 from libc/sysdeps/linux/common/sync_file_range.c:15:
./libc/sysdeps/linux/arm/sysdep.h:280:21: note: previous definition of '_v3' was here
       register int *_v3 __asm__ ("v3") = _sys_buf;  \
...

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
03cc2041fc librt: Add missing __dso_handle
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
efc26521e8 librt: Refine LIBS
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
a8cf23486e librt: honour HAS_STUBS in buildsys
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
a68d786f30 include/: ignore sys/random.h symlink
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
19c4bf396e librt: Rephrase librt.so library dependencies
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
04cd09eb3a librt: Fix librt.so depends for !NPTL
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
1df50b08df prelink: handle _begin in a gold-agnostic way
The nostartfiles is redundant but better be safe

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
f820f4ce07 buildsys: pass -O to ld unless DODEBUG
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-04-14 23:58:41 +02:00
Bernhard Reutner-Fischer
cf0234de47 libc: Fix page-size in getifaddrs()
TODO: this could need a cleanup..

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31 23:47:51 +02:00
Bernhard Reutner-Fischer
5fe8fc1ac4 buildsys: Do not build crt upon pregen
No need to build crt when just generating headers

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31 23:47:43 +02:00
Bernhard Reutner-Fischer
e51d746b4b buildsys: tweak ucontext_i.h prerequisites
ucontext_i.h too depends on uClibc_config.h.
Update it to look like the other MANGLE generated files and tweak
prereqs

Fixes: make realclean ; make -j libc/misc/internals/__uClibc_main.i

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31 22:44:19 +02:00
Bernhard Reutner-Fischer
5f374c1fe8 buildsys: Fix setting LIBGCC
We were ending up with multiple entries in LIBGCC for recursive child
make instances, avoid that.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31 22:44:12 +02:00
Bernhard Reutner-Fischer
3a14ea8812 Revert "librt: Use -nodefaultlibs instead of -nostdlib"
This reverts commit 534f44d531.

I don't think this is wanted.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-31 22:43:52 +02:00
Alexey Brodkin
2494628931 ARC: don't hard-code ELF_NGREG
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
[updated changelog]

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:47 +01:00
Vineet Gupta
d3c60fc490 ARC/signal: shield sa_restorer from compiler toggle side-effects
when building uClibc with -O0 (DODEBUG build) the default sigrestorer
had some extra glue code generated for stack manipulation which was
messing up resume from signal path.

So annotate the function with -Os so that gcc would only generate the
bare min 2 instruction TRAP sequence

Reported-and-Debugged-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:47 +01:00
Vineet Gupta
70bafe7e4d ARC: switch to NPTL
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:47 +01:00
Andrew Burgess
8fde02feb2 Add support for R_ARC_NONE relocations.
The R_ARC_NONE relocation is generated when --gc-sections, used by the
compile time linker, removes some sections.  This is completely normal,
and we can see that all other targets (based on random sampling) have
support for R_*_NONE relocations (named for each target).

Handling R_ARC_NONE involves doing nothing with it, which is nice and
easy.

Signed-off-by: Andrew Burgess <andrew.burgess@embecosm.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:46 +01:00
Bernhard Reutner-Fischer
cc8d7d062e include: update atomic.h from glibc
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:46 +01:00
Bernhard Reutner-Fischer
560f416794 test: Add SIMULATOR_uclibc and SIMULATOR_glibc
where SIMULATOR_glibc is an optional simulator to run host binaries and
SIMULATOR_uclibc is an optional simulator to run target (uClibc)
binaries.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-27 00:08:45 +01:00
Bernhard Reutner-Fischer
cf80a7fc2d utmp: always have at least utmpx
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-26 00:50:17 +01:00
Bernhard Reutner-Fischer
8836d184d4 NPTL: SH: silence warning
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-26 00:03:09 +01:00
Bernhard Reutner-Fischer
fc673e1420 SH: add 't' to syscall clobber list
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-26 00:03:05 +01:00
Bernhard Reutner-Fischer
2c8a776668 ldso: mark _dl_exit as noreturn
Otherwise gcc might not understand that oom() ended control-flow and
might emit an (untaken) reference to abort() in _dl_update_slotinfo()
on e.g. SH4 which breaks linking ld-uClibc.so.
Arguably -ffreestanding should prevent GCC from emitting this
'.global abort' but alas, it does not, which is another bug..

Also mark the function cold to further lower the incoming frequency and
branch probability.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-26 00:02:58 +01:00