Re: [PATCH] arm: add RESET_PID in the clone impl
On 2014/9/4 19:40, Bernhard Reutner-Fischer wrote: > On 4 September 2014 00:01, Waldemar Brodkorb wrote: >> Hi Carmelo, >> Carmelo Amoroso wrote, >> >>> Hi, >>> I don't think clone on arm is missing RESET_PID if you use the >>> correct implementation from >>> libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S. >> >> Can you explain this a little bit more? >> >> cat ./libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S >> #define RESET_PID >> #include >> #include "../../../../../../../libc/sysdeps/linux/arm/clone.S" >> >> Do you think the test-suite failures on arm come from a buildsystem >> problem? > > No, the patch is fine and needed. > ARCH_HAS_BX and ARCH_HAS_BLX should be deleted though, we handle that > via bits/arm_bx.h Actually,to fix missing RESET_PID, I just need ARCH_HAS_HARD_TP. I'll resend the patch. Regards, Wang > Can somebody run this through a test-harness for !threads and NPTL on > the affected ISA revisions just to be sure? > > That'd help. > TIA, > ___ > uClibc mailing list > uClibc@uclibc.org > http://lists.busybox.net/mailman/listinfo/uclibc > > ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH] arm: add RESET_PID in the clone impl
Il 04 settembre 2014 22:32:01 Bernhard Reutner-Fischer ha scritto: >On 4 September 2014 19:32, Carmelo Amoroso wrote: > > > Il 04 settembre 2014 00:01:38 Waldemar Brodkorb ha > scritto: > >> Hi Carmelo, > > > Hello, > > >> Carmelo Amoroso wrote, >> >> > Hi, >> > I don't think clone on arm is missing RESET_PID if you use the >> > correct implementation from >> > libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S. >> >> Can you explain this a little bit more? >> > > What I mean to say is that if the root cause is the lack of RESET_PIN > definition it's not the case. No, it's not the define of RESET_PID but nothing in the arm clone.S actually does anything with RESET_PID, i.e. the actual implementation is missing, AFAICS. Indeed by looking at the patch better I've noticed the actual fix. > > Then, I did not enter into the details of the patch, but at first glance I > could see several other unrelated changes that could eventually have been > split in more patches, but I could be wrong. > On my platform armv7 I don't remember to have such failures. Curious how you get a correct getpid() on arm then? This whole caching stuff is a pain and should be removed instead. I will test and check it again as soon as back from my bz trip... I could not remember correctly. For sure I did not debug it. Carmelo Inviato con AquaMail per Android http://www.aqua-mail.com ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH v2] libpthread: modify CFLAGS-pthread_once.c to avoid earlier setting being replaced
On 2014/9/5 0:13, Bernhard Reutner-Fischer wrote: > On 3 September 2014 08:55, Yang Yingliang wrote: >> From: Yang Yingliang >> >> I use uclibc in arch arm. The CFLAGS-pthread_once.c has been set >> to -DNOT_IN_libc -DIS_IN_libpthread in >> libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch. >> But it will be replaced by -fexceptions -fasynchronous-unwind-tables in >> libpthread/nptl/Makefile.in. >> >> If CFLAGS-pthread_once.c has no -DIS_IN_libpthread the testcase >> tst-once3 in test/nptl/ will be failed. The reason is pthread_once >> calls another pthread_cleanup_push() which is not under IS_IN_libpthread >> so that clear_once_control do not be called when the thread is canceled. >> So pthread_once will hang up when it's called second time. >> >> Other parts don't have this problem, because IS_IN_libpthread is defined by >> CFLAGS-nptl = -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS), >> CFLAGS-pthread = $(SSP_ALL_CFLAGS) -DNOT_IN_libc -DIS_IN_libpthread, >> CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread and >> CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread. > > These are defined but it seems to me they are not effective, no? > Please try the attached instead. The hunks in nptl/... should be moved to > Makerules, near objs: though, so it affects LT and LT.old, too. > > Comments? > Thanks, I tried the attachment. The IS_IN_libpthread and NOT_IN_libc are defined twice when it's compiling the source files in nptl. One is defined by $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS)), the other is defined by $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $(http://lists.busybox.net/mailman/listinfo/uclibc
Re: m68k test-suite linking error
On 4 September 2014 20:47, Waldemar Brodkorb wrote: > Hi, > > I am trying to compile uClibc master from today for m68k targeting > Aranym-mmu. The C library compiles, but the test-suite fails. > /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/../../../../m68k-openadk-linux-uclibc/bin/ld: > BFD (GNU Binutils) 2.24 assertion fail elf32-m68k.c:2641 > collect2: error: ld returned 1 exit status > > Is this commit related? > http://git.uclibc.org/uClibc/commit/?id=7a3acb243bc09f253a77faee7ee097a781f3eebe No, not directly related. > > It didn't work before, but may someone (Bernhard?) have an idea? I was starting to think about retrying to get me an m68k test setup. I picked the cpu which appears to be the lowest supported thing in qemu, i.e. 5206. Does not work yet though. Right now we only have classical 68xxx support int here. See gcc list for the current issue i seem to have with 5206. We'll see how this progresses. ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH] arm: add RESET_PID in the clone impl
>On 4 September 2014 19:32, Carmelo Amoroso wrote: > > > Il 04 settembre 2014 00:01:38 Waldemar Brodkorb ha > scritto: > >> Hi Carmelo, > > > Hello, > > >> Carmelo Amoroso wrote, >> >> > Hi, >> > I don't think clone on arm is missing RESET_PID if you use the >> > correct implementation from >> > libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S. >> >> Can you explain this a little bit more? >> > > What I mean to say is that if the root cause is the lack of RESET_PIN > definition it's not the case. No, it's not the define of RESET_PID but nothing in the arm clone.S actually does anything with RESET_PID, i.e. the actual implementation is missing, AFAICS. > > Then, I did not enter into the details of the patch, but at first glance I > could see several other unrelated changes that could eventually have been > split in more patches, but I could be wrong. > On my platform armv7 I don't remember to have such failures. Curious how you get a correct getpid() on arm then? This whole caching stuff is a pain and should be removed instead. ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
m68k test-suite linking error
Hi, I am trying to compile uClibc master from today for m68k targeting Aranym-mmu. The C library compiles, but the test-suite fails. KCONFIG_CONFIG=/home/vmadmin/openadk/toolchain_build_aranym-m68k_uclibc_m68k/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/.config /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/bin/m68k-openadk-linux-uclibc-gcc -nostdinc -I../../install_dir/usr/include -I../../test -D_GNU_SOURCE -I/home/vmadmin/openadk/target_aranym-m68k_uclibc_m68k/usr/include/ -isystem /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/include-fixed -isystem /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/include -Os -funit-at-a-time -fmerge-all-constants -fstrict-aliasing -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -fwrapv -fno-ident -fhonour-copts -Os -pipe -g3 -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -Wall -Wstrict-prototypes -Wstrict-aliasing -Wstrict-prototypes-c assert.c -o assert.o /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/bin/m68k-openadk-linux-uclibc-gcc -Wl,-EB -Wl,-z,now -Wl,-s -Wl,-rpath,/home/vmadmin/openadk/toolchain_build_aranym-m68k_uclibc_m68k/w-uClibc-0.9.34-git-1/uClibc-0.9.34-git/test/assert -Wl,--dynamic-linker,/lib//ld-uClibc.so.0 assert.o -o assert /home/vmadmin/openadk/toolchain_aranym-m68k_uclibc_m68k/usr/lib/gcc/m68k-openadk-linux-uclibc/4.8.3/../../../../m68k-openadk-linux-uclibc/bin/ld: BFD (GNU Binutils) 2.24 assertion fail elf32-m68k.c:2641 collect2: error: ld returned 1 exit status Is this commit related? http://git.uclibc.org/uClibc/commit/?id=7a3acb243bc09f253a77faee7ee097a781f3eebe It didn't work before, but may someone (Bernhard?) have an idea? best regards Waldemar ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH] arm: add RESET_PID in the clone impl
Il 04 settembre 2014 00:01:38 Waldemar Brodkorb ha scritto: Hi Carmelo, Hello, Carmelo Amoroso wrote, > Hi, > I don't think clone on arm is missing RESET_PID if you use the > correct implementation from > libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S. Can you explain this a little bit more? What I mean to say is that if the root cause is the lack of RESET_PIN definition it's not the case. Then, I did not enter into the details of the patch, but at first glance I could see several other unrelated changes that could eventually have been split in more patches, but I could be wrong. On my platform armv7 I don't remember to have such failures. cat ./libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S #define RESET_PID #include #include "../../../../../../../libc/sysdeps/linux/arm/clone.S" Do you think the test-suite failures on arm come from a buildsystem problem? best regards Waldemar Carmelo > Cheers > Carmelo > > Inviato con AquaMail per Android > http://www.aqua-mail.com > > > Il 02 settembre 2014 14:12:24 Wangyufen ha scritto: > > >From: Wang Yufen > > > >Called getpid() When creating a new process with clone(), getpid() returns > >the father_process's value. It should be child_process's value. > >The reason is missing a RESET_PID in the arm clone impl. > > > >Signed-off-by: Wang Yufen > >--- > > libc/sysdeps/linux/arm/clone.S | 61 ++- > > libc/sysdeps/linux/arm/sysdep.h | 45 > > 2 files changed, 92 insertions(+), 14 deletions(-) > > > >diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S > >index 03cd10e..29045ef 100644 > >--- a/libc/sysdeps/linux/arm/clone.S > >+++ b/libc/sysdeps/linux/arm/clone.S > >@@ -19,12 +19,17 @@ > > /* clone() is even more special than fork() as it mucks with stacks > >and invokes a function in the right context after its all over. */ > > > >+#include > > #define _ERRNO_H > > #include > > #include > > #include > > #include > > #include > >+#include > >+ > >+#define CLONE_VM 0x0100 > >+#define CLONE_THREAD 0x0001 > > > > #if defined(__NR_clone) > > /* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ > >@@ -87,6 +92,8 @@ __error: > > .pool > > #else > > __clone: > >+.fnstart > >+.cantunwind > > @ sanity check args > > cmp r0, #0 > > IT(te, ne) > >@@ -95,32 +102,58 @@ __clone: > > beq __error > > > > @ insert the args onto the new stack > >- sub r1, r1, #8 > >- str r3, [r1, #4] > >- @ save the function pointer as the 0th element > >- str r0, [r1] > >+ str r3, [r1, #-4]! > >+ str r0, [r1, #-4]! > > > > @ do the system call > > @ get flags > > mov r0, r2 > >+#ifdef RESET_PID > >+ mov ip, r2 > >+#endif > > @ new sp is already in r1 > >- @ load remaining arguments off the stack > >- stmfd sp!, {r4} > >- ldr r2, [sp, #4] > >- ldr r3, [sp, #8] > >- ldr r4, [sp, #12] > >- DO_CALL (clone) > >- movsa1, a1 > >- IT(t, ne) > >- ldmnefd sp!, {r4} > >+ push{r4, r7} > >+ cfi_adjust_cfa_offset (8) > >+ cfi_rel_offset (r4, 0) > >+ cfi_rel_offset (r7, 4) > >+ ldr r2, [sp, #8] > >+ ldr r3, [sp, #12] > >+ ldr r4, [sp, #16] > >+ ldr r7, =SYS_ify(clone) > >+ swi 0x0 > >+ cfi_endproc > >+ cmp r0, #0 > >+ beq 1f > >+ pop {r4, r7} > > blt __error > >- IT(t, ne) > > #if defined(__USE_BX__) > > bxnelr > > #else > > movne pc, lr > > #endif > > > >+ cfi_startproc > >+.fnend > >+PSEUDO_END (__clone) > >+ > >+1: > >+ .fnstart > >+ .cantunwind > >+#ifdef RESET_PID > >+ tst ip, #CLONE_THREAD > >+ bne 3f > >+ GET_TLS (lr) > >+ mov r1, r0 > >+ tst ip, #CLONE_VM > >+ ldr r7, =SYS_ify(getpid) > >+ ite ne > >+ movne r0, #-1 > >+ swieq 0x0 > >+ NEGOFF_ADJ_BASE (r1, TID_OFFSET) > >+ str r0, NEGOFF_OFF1 (r1, TID_OFFSET) > >+ str r0, NEGOFF_OFF2 (r1, PID_OFFSET, TID_OFFSET) > >+3: > >+#endif > > @ pick the function arg and call address off the stack and execute > > ldr r0, [sp, #4] > > mov lr, pc > >diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h > >index 64f4040..38a131d 100644 > >--- a/libc/sysdeps/linux/arm/sysdep.h > >+++ b/libc/sysdeps/linux/arm/sysdep.h > >@@ -213,6 +213,51 @@ __local_syscall_error: \ > >sees the right arguments. > > > > */ > >+#if __ARM_ARCH > 4 || defined (__ARM_ARCH_4T__) > >+# define ARCH_HAS_BX > >+#endif > >+#if __ARM_ARCH > 4 > >+# define ARCH_HAS_BLX > >+#endif > >+#if __ARM_ARCH > 6 || defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6ZK__) > >+# define ARCH_HAS_HARD_TP >
Re: [PATCH v2] libpthread: modify CFLAGS-pthread_once.c to avoid earlier setting being replaced
On 3 September 2014 08:55, Yang Yingliang wrote: > From: Yang Yingliang > > I use uclibc in arch arm. The CFLAGS-pthread_once.c has been set > to -DNOT_IN_libc -DIS_IN_libpthread in > libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch. > But it will be replaced by -fexceptions -fasynchronous-unwind-tables in > libpthread/nptl/Makefile.in. > > If CFLAGS-pthread_once.c has no -DIS_IN_libpthread the testcase > tst-once3 in test/nptl/ will be failed. The reason is pthread_once > calls another pthread_cleanup_push() which is not under IS_IN_libpthread > so that clear_once_control do not be called when the thread is canceled. > So pthread_once will hang up when it's called second time. > > Other parts don't have this problem, because IS_IN_libpthread is defined by > CFLAGS-nptl = -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS), > CFLAGS-pthread = $(SSP_ALL_CFLAGS) -DNOT_IN_libc -DIS_IN_libpthread, > CFLAGS-dir_linuxthreads := -DNOT_IN_libc -DIS_IN_libpthread and > CFLAGS-dir_linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread. These are defined but it seems to me they are not effective, no? Please try the attached instead. The hunks in nptl/... should be moved to Makerules, near objs: though, so it affects LT and LT.old, too. Comments? Thanks, > > Cc: Waldemar Brodkorb > Cc: Bernhard Reutner-Fischer > Tested-by: Waldemar Brodkorb > Signed-off-by: Yang Yingliang > > --- > Change note: > Update changelog to describe other parts' IS_IN_libpthread. > Add Tested-by: Waldemar Brodkorb . > --- > libpthread/nptl/Makefile.in | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in > index 0008822..1b9ba8c 100644 > --- a/libpthread/nptl/Makefile.in > +++ b/libpthread/nptl/Makefile.in > @@ -186,7 +186,7 @@ CFLAGS-forward.c = -fexceptions > CFLAGS-pthread_testcancel.c = -fexceptions > CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables > CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables > -CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \ > +CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \ > -fasynchronous-unwind-tables > CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables > CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables > -- 1.8.0 . > > > fwd0 Description: Binary data ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH] sparc: remove sparc64/sparcv9 code
On 3 September 2014 21:02, Waldemar Brodkorb wrote: > The sparc64/sparcv9 code is incomplete. Furthermore there is > no real embedded hardware for sparc64 available, so better remove > it until someone comes up with a complete port. Applied, thanks! ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH] libc: add fallocate() and fallocate64()
On 1 September 2014 16:27, wrote: > From: "Anthony G. Basile" > > We add the Linux-specific system call fallocate() which allows the user to Please only enable the non-hidden symbol if UCLIBC_LINUX_SPECIFIC is set. Also, you seem to completely ignore the type of the function decl. You should make sure the fallocate decl is visible when being compiled with _LIBC (i.e. internally) and use extern __typeof(fallocate) _fallocate in the impl. We would potentially miss changed function "signature" otherwise.. TIA, > directly manipulate allocate space for a file. The default operation is > equivalent to posix_fallocate() which is specified in POSIX.1. However, > recent releases of e2fsprogs 1.42.11 and above expect fallocate() to be > available. ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH] arm: add RESET_PID in the clone impl
On 4 September 2014 00:01, Waldemar Brodkorb wrote: > Hi Carmelo, > Carmelo Amoroso wrote, > >> Hi, >> I don't think clone on arm is missing RESET_PID if you use the >> correct implementation from >> libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S. > > Can you explain this a little bit more? > > cat ./libpthread/nptl/sysdeps/unix/sysv/linux/arm/clone.S > #define RESET_PID > #include > #include "../../../../../../../libc/sysdeps/linux/arm/clone.S" > > Do you think the test-suite failures on arm come from a buildsystem > problem? No, the patch is fine and needed. ARCH_HAS_BX and ARCH_HAS_BLX should be deleted though, we handle that via bits/arm_bx.h Can somebody run this through a test-harness for !threads and NPTL on the affected ISA revisions just to be sure? That'd help. TIA, ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH 1/3] test: disable test when UCLIBC_HAS_XLOCALE is n
On 31 August 2014 10:43, Waldemar Brodkorb wrote: > wcsftime() is only implemented when locale support in uClibc > is activated. So test will always fail when locale is deactivated > by the user. Rename file name to be consistent with other test file > names. Applied without the renaming: We have imported that file. bc23c6440d34d85c8e6bb04656beb233bba47cb8 Thanks! ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH 3/3] ldso: fix compile error for bfin non-mmu
On 31 August 2014 10:44, Waldemar Brodkorb wrote: > When compiling for bfin non-mmu, you get following error: > ldso/ldso/dl-elf.c:731:18: error: '_dl_debug_file' undeclared (first use in > this function) > _dl_debug_file is only available when __SUPPORT_LD_DEBUG__ is > defined. I think this should use the fd, this is not debugging-output but a hard error. b212e3804fb155cb418852dd70abad9a3d2354cc thanks, ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc
Re: [PATCH 2/3] test: skip test for non-mmu case
On 31 August 2014 10:43, Waldemar Brodkorb wrote: > Non-mmu targets have no fork(). In the case of vfork(), > we can not test communication between parent and child > in this way. Let's just not compile it then. ff48662bbadd3d49fabe6fdfeb8e8181d4c80b06 thanks, ___ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc