klibc sparc trouble with gcc 4.0

2007-11-05 Thread maximilian attems
tried below fix, that is a partial revert of klibc
6fbd8fafdcc793135988733996d72b0298afe934
see git://git.kernel.org/pub/scm/libs/klibc/klibc.git
with belows fix klibc compiles fine on sparc with newer gcc,
but segfaults:


titan:~# strace -vfF /usr/lib/klibc/bin/fstype
execve(/usr/lib/klibc/bin/fstype, [/usr/lib/klibc/bin/fstype],
[SHELL=/bin/bash, TERM=xterm, SSH_CLIENT=[myip] 39403...,
SSH_TTY=/dev/pts/0, USER=root,
LS_COLORS=no=00:fi=00:di=01;34:l...,
PATH=/usr/local/sbin:/usr/local/..., MAIL=/var/mail/root,
PWD=/root, LANG=en_US.UTF-8, PS1=\\h:\\w\\$ , HOME=/root,
SHLVL=2, LS_OPTIONS=--color=auto, LOGNAME=root,
SSH_CONNECTION=[myip] 3..., _=/usr/bin/strace, OLDPWD=/]) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 3636 detached

thanks for looking at it.

-- 
maks



use our own clzdi on sparc instead the one of libgcc

Signed-off-by: maximilian attems [EMAIL PROTECTED]

diff --git a/usr/klibc/arch/sparc64/Kbuild b/usr/klibc/arch/sparc64/Kbuild
index 2854f69..f2450a2 100644
--- a/usr/klibc/arch/sparc64/Kbuild
+++ b/usr/klibc/arch/sparc64/Kbuild
@@ -2,7 +2,7 @@
 # klibc files for sparc64
 #
 
-klib-y := pipe.o setjmp.o syscall.o sysfork.o
+klib-y := pipe.o setjmp.o syscall.o sysfork.o ../../libgcc/__clzdi2.o
 
 always  := crt0.o
 targets := crt0.o
diff --git a/usr/klibc/libgcc/__clzdi2.c b/usr/klibc/libgcc/__clzdi2.c
new file mode 100644
index 000..13e636c
--- /dev/null
+++ b/usr/klibc/libgcc/__clzdi2.c
@@ -0,0 +1,23 @@
+/*
+ * __clzdi2 - Returns the leading number of 0 bits in the argument
+ */
+
+#include stdint.h
+#include stddef.h
+
+uint64_t __clzdi2(uint64_t v)
+{
+   uint32_t vhi = (uint32_t) (v  32);
+   uint32_t vx;
+   int dp;
+
+   if (vhi) {
+   vx = vhi;
+   dp = 0;
+   } else {
+   vx = (uint32_t) v;
+   dp = 32;
+   }
+
+   return dp + __builtin_clz(vx);
+}
-
To unsubscribe from this list: send the line unsubscribe sparclinux in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 09/12] arch/sparc: Remove duplicate includes.

2007-11-05 Thread Lucas Woods

Signed-off-by: Lucas Woods [EMAIL PROTECTED]
---
 arch/sparc/kernel/irq.c   |1 -
 arch/sparc64/kernel/ds.c  |1 -
 arch/sparc64/kernel/module.c  |1 -
 arch/sparc64/kernel/sys_sparc32.c |1 -
 arch/sparc64/kernel/sys_sunos32.c |1 -
 arch/sparc64/kernel/time.c|2 --
 6 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c
index e1e24f3..01a6756 100644
--- a/arch/sparc/kernel/irq.c
+++ b/arch/sparc/kernel/irq.c
@@ -18,7 +18,6 @@
 #include linux/linkage.h
 #include linux/kernel_stat.h
 #include linux/signal.h
-#include linux/sched.h
 #include linux/interrupt.h
 #include linux/slab.h
 #include linux/random.h
diff --git a/arch/sparc64/kernel/ds.c b/arch/sparc64/kernel/ds.c
index 9f472a7..eeb5a2f 100644
--- a/arch/sparc64/kernel/ds.c
+++ b/arch/sparc64/kernel/ds.c
@@ -6,7 +6,6 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/types.h
-#include linux/module.h
 #include linux/string.h
 #include linux/slab.h
 #include linux/sched.h
diff --git a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c
index 5798715..158484b 100644
--- a/arch/sparc64/kernel/module.c
+++ b/arch/sparc64/kernel/module.c
@@ -11,7 +11,6 @@
 #include linux/fs.h
 #include linux/string.h
 #include linux/slab.h
-#include linux/vmalloc.h
 #include linux/mm.h
 
 #include asm/processor.h
diff --git a/arch/sparc64/kernel/sys_sparc32.c 
b/arch/sparc64/kernel/sys_sparc32.c
index 78caff9..98c4688 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -51,7 +51,6 @@
 #include linux/vfs.h
 #include linux/netfilter_ipv4/ip_tables.h
 #include linux/ptrace.h
-#include linux/highuid.h
 
 #include asm/types.h
 #include asm/uaccess.h
diff --git a/arch/sparc64/kernel/sys_sunos32.c 
b/arch/sparc64/kernel/sys_sunos32.c
index 170d6ca..cfc22d3 100644
--- a/arch/sparc64/kernel/sys_sunos32.c
+++ b/arch/sparc64/kernel/sys_sunos32.c
@@ -57,7 +57,6 @@
 #include linux/personality.h
 
 /* For SOCKET_I */
-#include linux/socket.h
 #include net/sock.h
 #include net/compat.h
 
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index a2cf955..4352ee4 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -28,7 +28,6 @@
 #include linux/jiffies.h
 #include linux/cpufreq.h
 #include linux/percpu.h
-#include linux/profile.h
 #include linux/miscdevice.h
 #include linux/rtc.h
 #include linux/kernel_stat.h
@@ -47,7 +46,6 @@
 #include asm/sections.h
 #include asm/cpudata.h
 #include asm/uaccess.h
-#include asm/prom.h
 #include asm/irq_regs.h
 
 DEFINE_SPINLOCK(mostek_lock);
-- 



-
To unsubscribe from this list: send the line unsubscribe sparclinux in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: klibc sparc trouble with gcc 4.0

2007-11-05 Thread Oleg Verych
== Mon, Nov 05, 2007 at 02:55:45PM +0100, maximilian attems ==
[]
 titan:~# strace -vfF /usr/lib/klibc/bin/fstype
 execve(/usr/lib/klibc/bin/fstype, [/usr/lib/klibc/bin/fstype],
 [SHELL=/bin/bash, TERM=xterm, SSH_CLIENT=[myip] 39403...,
 SSH_TTY=/dev/pts/0, USER=root,
 LS_COLORS=no=00:fi=00:di=01;34:l...,
 PATH=/usr/local/sbin:/usr/local/..., MAIL=/var/mail/root,
 PWD=/root, LANG=en_US.UTF-8, PS1=\\h:\\w\\$ , HOME=/root,
 SHLVL=2, LS_OPTIONS=--color=auto, LOGNAME=root,
 SSH_CONNECTION=[myip] 3..., _=/usr/bin/strace, OLDPWD=/]) = 0
 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
 +++ killed by SIGSEGV +++

gdb doesn't work/help?

[]
 +++ b/usr/klibc/libgcc/__clzdi2.c
 @@ -0,0 +1,23 @@
 +/*
 + * __clzdi2 - Returns the leading number of 0 bits in the argument
 + */
 +
 +#include stdint.h
 +#include stddef.h
 +
 +uint64_t __clzdi2(uint64_t v)
 +{
 + uint32_t vhi = (uint32_t) (v  32);

`v' is a data in memory loaded to register to perform shift, thus this
operation yields high 32-bits part of `v'

 + uint32_t vx;
 + int dp;
 +
 + if (vhi) {
 + vx = vhi;
 + dp = 0;
 + } else {
 + vx = (uint32_t) v;

`v' is a data in memory, accessed with 32-bits cast, thus operation
yields high 32-bits part of `v'.

 + dp = 32;
 + }
 +
 + return dp + __builtin_clz(vx);
 +}

While i didn't see/used any big-endian machine/asm_dump, i just
speculate, since noone replied yet.

-
To unsubscribe from this list: send the line unsubscribe sparclinux in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: unkillable dpkg-query processes

2007-11-05 Thread Bernd Zeimetz

 So I'm not sure if the result is really useful for you - if not just let
 me know. I've attached the last ~10-20 sysrq-g outputs - as it was
 running in a loop I have a ton of them. In case you're wondering: http
 is aptitude's http method.
 
 The http module is stuck in a different place, I'll try to
 see if I can make sense of it.


Here's also some output from apt-get which got stuck in my unstable
chroot while I wanted to retrieve the klibc source to try to debug it...

ov  6 04:43:19 titan kernel: [100896.376237] SysRq : Show Global CPU Regs
Nov  6 04:43:19 titan kernel: [100896.423254] * CPU[  0]: 
TSTATE[] TPC[] TNPC[] 
TASK[bash:11762]
Nov  6 04:43:19 titan kernel: [100896.544064]   CPU[  1]: 
TSTATE[004411009602] TPC[0067b59c] TNPC[0067b5a0] 
TASK[swapper:0]
Nov  6 04:43:19 titan kernel: [100896.663869]  
TPC[schedule+0x5f8/0x7a4]
Nov  6 04:43:19 titan kernel: [100896.722179]  
O7[schedule+0x5cc/0x7a4]
Nov  6 04:43:19 titan kernel: [100896.779474]  
I7[cpu_idle+0xa8/0xb8]
Nov  6 04:43:19 titan kernel: [100896.834677]   CPU[  2]: 
TSTATE[009911009601] TPC[0042888c] TNPC[00428890] 
TASK[swapper:0]
Nov  6 04:43:19 titan kernel: [100896.954474]  
TPC[cpu_idle+0x80/0xb8]
Nov  6 04:43:19 titan kernel: [100897.010715]  
O7[cpu_idle+0xa8/0xb8]
Nov  6 04:43:19 titan kernel: [100897.065932]  
I7[after_lock_tlb+0x19c/0x1b0]
Nov  6 04:43:19 titan kernel: [100897.129468]   CPU[  3]: 
TSTATE[004411009602] TPC[0053a0c4] TNPC[0053a0c8] 
TASK[apt-get:11759]
Nov  6 04:43:19 titan kernel: [100897.253443]  
TPC[__first_cpu+0x4/0x28]
Nov  6 04:43:19 titan kernel: [100897.311767]  O7[__delay+0x28/0x48]
Nov  6 04:43:20 titan kernel: [100897.365923]  
I7[cheetah_xcall_deliver+0x1c0/0x23c]
Nov  6 04:43:31 titan kernel: [100909.020406] SysRq : Show Global CPU Regs
Nov  6 04:43:31 titan kernel: [100909.067374] * CPU[  0]: 
TSTATE[] TPC[] TNPC[] 
TASK[bash:11762]
Nov  6 04:43:31 titan kernel: [100909.188209]   CPU[  1]: 
TSTATE[004411009604] TPC[0045731c] TNPC[00457320] 
TASK[swapper:0]
Nov  6 04:43:32 titan kernel: [100909.308013]  
TPC[update_stats_wait_end+0x24/0x88]
Nov  6 04:43:32 titan kernel: [100909.377808]  
O7[sched_clock+0x10/0x30]
Nov  6 04:43:32 titan kernel: [100909.436116]  
I7[pick_next_task_fair+0x24/0x44]
Nov  6 04:43:32 titan kernel: [100909.502782]   CPU[  2]: 
TSTATE[009911009601] TPC[0042888c] TNPC[00428890] 
TASK[swapper:0]
Nov  6 04:43:32 titan kernel: [100909.622580]  
TPC[cpu_idle+0x80/0xb8]
Nov  6 04:43:32 titan kernel: [100909.678817]  
O7[cpu_idle+0xa8/0xb8]
Nov  6 04:43:32 titan kernel: [100909.734029]  
I7[after_lock_tlb+0x19c/0x1b0]
Nov  6 04:43:32 titan kernel: [100909.797570]   CPU[  3]: 
TSTATE[11009601] TPC[00441a78] TNPC[00441a7c] 
TASK[apt-get:11759]
Nov  6 04:43:32 titan kernel: [100909.921536]  
TPC[cheetah_xcall_deliver+0x174/0x23c]
Nov  6 04:43:32 titan kernel: [100909.993401]  
O7[cheetah_xcall_deliver+0x6c/0x23c]
Nov  6 04:43:32 titan kernel: [100910.063193]  
I7[flush_dcache_page_all+0x178/0x240]
Nov  6 04:43:33 titan kernel: [100910.766366] SysRq : Show Global CPU Regs
Nov  6 04:43:33 titan kernel: [100910.813292] * CPU[  0]: 
TSTATE[] TPC[] TNPC[] 
TASK[bash:11762]
Nov  6 04:43:33 titan kernel: [100910.934129]   CPU[  1]: 
TSTATE[004411009604] TPC[0045731c] TNPC[00457320] 
TASK[swapper:0]
Nov  6 04:43:33 titan kernel: [100911.053923]  
TPC[update_stats_wait_end+0x24/0x88]
Nov  6 04:43:33 titan kernel: [100911.123706]  
O7[sched_clock+0x10/0x30]
Nov  6 04:43:33 titan kernel: [100911.182037]  
I7[pick_next_task_fair+0x24/0x44]
Nov  6 04:43:33 titan kernel: [100911.248702]   CPU[  2]: 
TSTATE[004411009601] TPC[004288a0] TNPC[004288a4] 
TASK[swapper:0]
Nov  6 04:43:34 titan kernel: [100911.368498]  
TPC[cpu_idle+0x94/0xb8]
Nov  6 04:43:34 titan kernel: [100911.424738]  
O7[cpu_idle+0xa8/0xb8]
Nov  6 04:43:34 titan kernel: [100911.479949]  
I7[after_lock_tlb+0x19c/0x1b0]
Nov  6 04:43:34 titan kernel: [100911.543490]   CPU[  3]: 
TSTATE[11009601] TPC[0042fc44] TNPC[0042fbe8] 
TASK[apt-get:11759]
Nov  6 04:43:34 titan kernel: [100911.667456]  TPC[udelay+0x14/0x1c]
Nov  6 04:43:34 titan kernel: [100911.721611]  O7[udelay+0x10/0x1c]
Nov  6 04:43:34 titan kernel: [100911.774739]  
I7[flush_dcache_page_all+0x178/0x240]
Nov  6 04:43:35 titan kernel: [100912.474070] SysRq : Show Global CPU Regs
Nov  6 04:43:35 titan kernel: [100912.520982] * 

Re: [PATCH 09/12] arch/sparc: Remove duplicate includes.

2007-11-05 Thread David Miller
From: Lucas Woods [EMAIL PROTECTED]
Date: Tue, 06 Nov 2007 07:15:22 +1100

 
 Signed-off-by: Lucas Woods [EMAIL PROTECTED]

Applied, thanks.
-
To unsubscribe from this list: send the line unsubscribe sparclinux in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html