An issue has been found with current implementation of ARC 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/x8…
Signed-off-by: Anton Kolesov <Anton.Kolesov(a)synopsys.com>
Anton
Hi André,
we are seeing a build error on your machine when
locales in uClibc-ng are enabled:
http://autobuild.buildroot.net/results/d5b/d5ba81eea9223569ba5b363551c4a2f7…
Can you show us locale -a from your machine?
For a working tolower(), the uClibc-ng code needs to use setlocale
on the host.
But it seems only these are tried to use:
en_US en_US en_GB
best regards
Waldemar
Hi,
The function towlower doesn't work with locales diffrent from C.
Issue was introduced in this commit:
https://cgit.openadk.org/cgi/cgit/uclibc-ng.git/commit/?id=
8cde3a9bf2856dcb9a759dec7ecb04a68e712254
Call to setlocale is needed for correct generation of the table uplow_diff.
I received the compile time error "range assumption error" after
uncommenting the call.
Similar problem described here:
http://lists.uclibc.org/pipermail/uclibc/2015-March/048852.html
The attached patch fix the problem by using int32_t values.
Test program:
$ cat test.c
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
int main(int argc, char *argv[])
{
int i = 0;
wchar_t str[] = L"ТЕСТОВАЯ СТРОКА";
wchar_t c;
setlocale(LC_ALL, "ru_RU.utf-8");
wprintf(L"Input:\t\"%ls\"\n", str);
wprintf(L"Output:\t\"");
while (str[i]) {
c = str[i];
putwchar(towlower(c));
i++;
}
wprintf(L"\"\n");
return 0;
}
Output (without patch):
$ ./test
Input: "ТЕСТОВАЯ СТРОКА"
Output: "ТЕСТОВАЯ СТРОКА"
Output (with patch):
$ ./test
Input: "ТЕСТОВАЯ СТРОКА"
Output: "тестовая строка"
--
Best regards,
Eugene
Hi,
Current uClibc-ng have issue with several different valloc declarations.
malloc.h:
#ifdef __UCLIBC_SUSV2_LEGACY__
/* Allocate SIZE bytes on a page boundary. */
extern __malloc_ptr_t valloc __MALLOC_P ((size_t __size))
__attribute_malloc__;
#endif
stdlib.h:
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Allocate SIZE bytes on a page boundary. The storage cannot be freed.
*/
extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
#endif
The second declaration doesn't use the define __UCLIBC_SUSV2_LEGACY__.
That leads to compile time problems.
The attached patch fixes this diffrence.
--
Best regards,
Eugene
Hi,
I would like to get some feedback for following three patches.
The test suite runs over all architectures showed no regressions.
The goal is to simplify the addition of new architectures and
remove the need to add assembly code to sysdep-cancel.h.
Most of the work was done in 2011 in commit
9f68f0cbf8c8eea6a7f9e195e4617bbaa808d7c6, but it was not finished
for NPTL and RT components of uClibc.
best regards
Waldemar