DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-03-01 17:44:53

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

GDB

Has anyone been successful compiling gdb for the DNS-323? I did an attempt, but apparently a termcap library is required, and I wouldn't know where to start here.

Offline

 

#2 2008-11-26 13:46:31

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: GDB

This one's been bugging me for a while, I just forgot to ask about it here:

When I try to debug a thread-enabled application on the NAS (for example, Transmission, or my own tool Automatic) using gdb, the debugger complains right at the start that it can't find a specific library (I think it was libpthread.so or something similar, I can't access the NAS right now). When starting the debug run, gdb will crash almost immediately, because it can't deal with threads.

I searched for the missing .so file, but it's not included in /ffp/lib. It is, however, available in /lib (so it's part of the original firmware). Placing the file somewhere where gdb can find it (or setting up a symlink) doesn't help though. Now gdb won't start at all.


Is it possible to get gdb with thread support running on the CH3SNAS?

Offline

 

#3 2008-11-26 13:50:56

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: GDB

upgrade/install the uclibc package. it has that library (also don't remember the name, but I think I know the problem).

Offline

 

#4 2009-07-08 15:11:42

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: GDB

@fonz:

Since the thread debugging issue persists, I was again looking around to find a solution. I found this forum post where others have a similar/the same problem: http://www.linuxquestions.org/questions … b98dbae71e

If I understand the instructions right, a recompile of both uClibc and gdb is necessary. Maybe you could check these instructions and see if this would solve the problem on the DNS-323 as well?

Offline

 

#5 2009-07-08 23:06:42

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: GDB

KyleK wrote:

If I understand the instructions right, a recompile of both uClibc and gdb is necessary. Maybe you could check these instructions and see if this would solve the problem on the DNS-323 as well?

Indeed, the gdb package was compiled against an old uclibc. I recompiled it, let me know how it works.
http://www.inreto.de/dns323/fun-plug/0. … S.html#gdb

Offline

 

#6 2009-08-15 23:25:30

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: GDB

Hey fonz,

unfortunately the new version of gdb brings up the same error message.

I'm now playing with the idea to build both uclibc and gdb from scratch, but as I understand it, all apps that run in fun_plug must use the same version of uclibc.

I've just compiled the latest uclibc (it downloads from svn), but how do I tell the gdb build script to use the new uclibc files when compiling?
Furthermore, gcc itself is still linked to the 'old' official uclibc from your package.

Seems like a chicken-and-egg problem to me smile

Offline

 

#7 2009-08-15 23:34:51

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: GDB

KyleK wrote:

I've just compiled the latest uclibc (it downloads from svn), but how do I tell the gdb build script to use the new uclibc files when compiling?

Installing the new uclibc to /ffp should work (when using a compatible config). Maybe there's just a configure switch for gdb missing?
Btw, are you sure svn has the latest uclibc? They switched to git, recently.

Offline

 

#8 2009-08-16 00:32:04

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: GDB

Well, then I'm sure I _don't_ have the latest uclibc, since I just used your funplug framework to obtain the source.

Regarding installing the newly built uclibc: I remember weird stuff happening after I replaced the library. But maybe something else was responsible for that. I'll let you know how it goes.

Offline

 

#9 2009-08-16 14:09:06

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: GDB

I checked out uClibc from git and attempted to compile, unfortunately it fails pretty early:

Code:

gcc -c libc/sysdeps/linux/common/syscall.c -o libc/sysdeps/linux/common/syscall.os -include ./include/libc-symbols.h -Wall -Wstrict-prototypes -fno-strict-aliasing -funsigned-char -fno-builtin -fno-asm -msoft-float -std=gnu99 -mlittle-endian -fno-stack-protector -nostdinc -I./include -I. -I./libc/sysdeps/linux/arm -Os -funit-at-a-time -fno-tree-loop-optimize -fno-tree-dominator-opts -fno-strength-reduce -fstrict-aliasing -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux/arm -I./libpthread/linuxthreads.old/sysdeps/arm -I./libpthread/linuxthreads.old/sysdeps/unix/sysv/linux -I./libpthread/linuxthreads.old/sysdeps/pthread -I./libpthread/linuxthreads.old -I./libpthread -I/ffp/include/ -isystem /mnt/USB/ffp/bin/../lib/gcc/arm-unknown-linux-uclibc/4.1.3/include-fixed -isystem /mnt/USB/ffp/bin/../lib/gcc/arm-unknown-linux-uclibc/4.1.3/include -DNDEBUG -fPIC -MT libc/sysdeps/linux/common/syscall.os -MD -MP -MF libc/sysdeps/linux/common/.syscall.os.dep
libc/sysdeps/linux/common/syscall.c: In function 'syscall':
libc/sysdeps/linux/common/syscall.c:11: warning: asm operand 1 probably doesn't match constraints
libc/sysdeps/linux/common/syscall.c:11: error: impossible constraint in 'asm'
make: *** [libc/sysdeps/linux/common/syscall.os] Error 1

After preprocessing the source file, the error above refers to line 31 of the following code: http://pastebin.com/d30442f54

No clue what it means, or how to fix it smile
I've tried chatting up the guys in #uclibc, but they're either fast asleep or just ignoring me.

Offline

 

#10 2009-08-19 21:33:14

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: GDB

So to just give a heads-up (I'm not sure if you follow the uClibc mailing list), apparently OABI support is currently broken for syscalls on ARM.
Nothing I can do but wait for someone to fix it smile

I was wondering though: any reason why funplug doesn't use EABI? I don't know too much about it, but several websites say it's better than OABI in many ways.

I suspect a switch to EABI (if possible) would mean to actually recompile _everything_, obviously not an option. Still, I'd be interesting in testing out the performance improvements.

Offline

 

#11 2009-08-19 23:10:50

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: GDB

KyleK wrote:

I was wondering though: any reason why funplug doesn't use EABI?

EABI doesn't work with the DNS-323 firmware kernels. However, e.g. DNS-313, and -343 firmwares use the EABI. EABI requires a complete recompile of everything.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB