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 2007-02-03 05:33:29

magore
Member
Registered: 2007-01-05
Posts: 25

Success building the uclibc tool chain and other results

Thought I would post a progress report

I have managed to compile the uclibc-toolchain-src-20040609 from the GPL after adding some patches. I will upload a script this weekend that will patch and compile it. You can then use this to compile your projects with the uclibc toolchain.

So far I have been able to compile the u-boot code and generate a new u-boot image
u-boot notes: It appears that although they configured the environment to reside in flash - they are not using it. They left it in a broken state pointing to the region now occupied by the MTD1 (/dev/mtd0) file system (oops!) This explains the CRC error on the environment while booting as seen from the serial console . They could have used the upper area of MTD4 above the boot code. Why do we care ? Well if someone wanted to change how the u-boot loader worked you need this because all of the settings come from environment variables - or hard coded within the u-boot code if the environment fails. The crazy thing is that all of the code is really there in the u-boot binary. They just broke it.

(Aside: /dev/mtd0 and /dev/mtdblock0 devices access MTD1, this is an EXT2 file system so you can do things like  mount /dev/mtdblock0 /sys/mtd1 -o loop )  Note MTD2 is a copy of the same filesystem and uses /dev/mtdblock1

Flash Area     Absolute Address  Comment
MTD1        0xff800000          EXT2 file system - /dev/mtdblock0
MTD2        0xff810000          EXT2 file system - /dev/mtdblock1
Kernel              0xff820000          u-boot format kernal image
Initrd              0xff9a0000          u-boot compressed ram image followed by a tar.gz image
u-boot            0xfffd0000           u-boot loader
MAC ADDR     0xffffff80             ASCII MAC address of the DNS-323


Stay tuned...

Ok, download the build_dns323.tgz attachment

Feb 1 2007 Mike Gore

What is this?
This document shows how to build the D-LINK DNS-323 GPL
toolchain, kernel and u-boot loader

Things you will need first
        - Development System x86 based Debian based "Ubuntu Dapper"
        - You will need the following tools:
                bison flex gcc3-4 byacc g++
        - Check your active compiler version
                gcc -v
                If your compiler is newer then gcc-3.4 then
                change the /usr/bin/gcc symlink to point to /usr/bin/gcc-3.4
                for building the toolchain - restore it when you are done.

        - Create a directory to build your source in:
                mkdir GPL
        - Create a directory to download the sources into:
                mkdir GPL/zips
        - Change into the GPL directory:
                cd GPL

        - Download and extract my build_dns323.tgz the GPL directory
                tar xzf build_dns323.tgz

1) download the GPL sources:
        ./wget_GPL

2) build the ARM UCLIBC toolchain
        ./build_uclibc
3) build the ARM kernel
        ./build_kernel
4) build the u-boot loader
        ./build_u-boot
5) build busybox
        ./build_busybox
6) build at
       ./build_at

Notes:
The ./build_uclibc script creats a script called setpath that can be used
to compile other ARM uclibc programs later on

Many of the remaining D-LINK sources have not been configured for being cross
compiled.  In fact the "Readme.txt" file they supply with the GPL sources
has instruction that are just plain wrong.

Last edited by magore (2007-02-07 04:15:49)

Offline

 

#2 2007-02-03 06:44:06

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

What host operating system are you using for your development/compiling?

Offline

 

#3 2007-02-05 01:03:57

jerrison
Member
Registered: 2007-02-04
Posts: 13

Re: Success building the uclibc tool chain and other results

hi there,

wget_GPL needs modification: ftp folder path is: ftp://ftp.dlink.com/GPL/DNS-323/ ...mind captial letters smile.

iīll give this a try tonight, since i couldnīt compile rtorrent so far!

Offline

 

#4 2007-02-05 05:17:43

magore
Member
Registered: 2007-01-05
Posts: 25

Re: Success building the uclibc tool chain and other results

Hi,
  OK, I had done that one part by hand originally - thanks for finding that.
I fixed the path added a few tests and uploaded the change
This is the new version of wget_GPL:
#!/bin/bash
#

if [ ! -d zips ]
then
   echo I did not find a zips directory
   echo please run this from the root of your GPL folder
   exit 1
fi

cd zips

echo download the D-LINK GPL code - this will take a while
wget -v -N ftp://ftp.dlink.com/GPL/DNS-323/*

Last edited by magore (2007-02-05 05:23:07)

Offline

 

#5 2007-02-05 21:15:57

jerrison
Member
Registered: 2007-02-04
Posts: 13

Re: Success building the uclibc tool chain and other results

hereīs another one: before you can start build_kernel you need to extract linux-2.6.6.tar.gz (and all the others you wrote scripts for) into the GPL folder...

hereīs a question: what do i compile into the kernel? never did build a kernel so far smile.
and another question: how do i actually build arm binaries now? i just need a hint in the right direction!

thnx for the help smile.

Last edited by jerrison (2007-02-05 22:15:46)

Offline

 

#6 2007-02-06 01:48:03

magore
Member
Registered: 2007-01-05
Posts: 25

Re: Success building the uclibc tool chain and other results

Hi,
  The purpose of all this work is to create a total replacement firmware. For example - one could add features to the kernel and modules for say USB video capture devices, cameras audio,
etc (think PVR)

Once you build the tools chain you have ARM cross compilers (Runs on x86 and spits out ARM binaries).
So each build script creates ARM uclibc binaries using the newly created cross compiler
The Kernel that is compiled is close to the one provided with the D-LINK DNS-323 firmware.

Offline

 

#7 2007-02-06 09:10:35

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

I'm having a ... well, not a fun time trying to figure out the cross compiling thing.

Anyway, I got about as far as you magore...
Although I would ask you to check your 'at'.  do a 'file at' and check if its actually arm.  For me its compiling natively under my x86 processor.  I'm missing something on how to use the binutils/toolchain properly...

Offline

 

#8 2007-02-06 19:48:51

magore
Member
Registered: 2007-01-05
Posts: 25

Re: Success building the uclibc tool chain and other results

Hi,

Oops: I had CC defined in my environment - I updated the build_at script in the build_dns323.tgz -
Here is a copy of the update

#!/bin/bash
#
source setpath
export CC=arm-linux-gcc
export GCC=arm-linux-gcc

echo Note at does not really use the flex library
cd at/at-3.1.8
make clean
make

Offline

 

#9 2007-02-07 00:30:21

jerrison
Member
Registered: 2007-02-04
Posts: 13

Re: Success building the uclibc tool chain and other results

magore wrote:

Once you build the tools chain you have ARM cross compilers (Runs on x86 and spits out ARM binaries).
So each build script creates ARM uclibc binaries using the newly created cross compiler
The Kernel that is compiled is close to the one provided with the D-LINK DNS-323 firmware.

I get the theoretical part but iīm kind of lost actually DOING the stuff...hereīs what i think how it should work: compile with
options like "./configure --host=i386-sth. --build=arm-sth. --target=arm-sth.   am i getting close?
itīd be awesome if you can guide through a successful compilation of, well, some meaningful program smile.

Thanx!

Last edited by jerrison (2007-02-07 00:35:39)

Offline

 

#10 2007-02-07 02:35:02

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

magore wrote:

Hi,

Oops: I had CC defined in my environment - I updated the build_at script in the build_dns323.tgz -
Here is a copy of the update

#!/bin/bash
#
source setpath
export CC=arm-linux-gcc
export GCC=arm-linux-gcc

echo Note at does not really use the flex library
cd at/at-3.1.8
make clean
make

Are you sure yours is ARM?

Here's what I get, even exporting CC and GCC

macpro-debian-parallels:/home/toby/DNS323/at/at-3.1.8# file at
at: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
macpro-debian-parallels:/home/toby/DNS323/at/at-3.1.8# file atd
atd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped
macpro-debian-parallels:/home/toby/DNS323/at/at-3.1.8#

Busybox works:
macpro-debian-parallels:/home/toby/DNS323/busybox-1.00-pre1# file busybox
busybox: ELF 32-bit LSB executable, ARM, version 1 (ARM), statically linked, stripped

But as you said, I don't think most anything in the package is actually setup to be able to be cross compiled.

Offline

 

#11 2007-02-07 04:23:48

magore
Member
Registered: 2007-01-05
Posts: 25

Re: Success building the uclibc tool chain and other results

Hi,

Yes I do get the correct result - ARM. Make sure setpath (created when you made the toolchain) has your cross compiler path in it
root@server:/share/embedded/DNS-323/GPL# cat setpath
#!/bin/bash
#
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games::/share/embedded/DNS-323/GPL/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/bin


Here is the log of what happens when I do a clean build of at

root@server:/share/embedded/DNS-323/GPL# rm -rf at
root@server:/share/embedded/DNS-323/GPL# tar xzf zips/at.tar.gz
root@server:/share/embedded/DNS-323/GPL# ./build_at
Note at does not really use the flex library
rm -f subs.sed *.o *.s at atd core a.out *~ atq atrm  *.bak stamp-built
rm -f parsetest
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall at.c
at.c:111: warning: `rcsid' defined but not used
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall panic.c
panic.c:49: warning: `rcsid' defined but not used
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall perm.c
perm.c:59: warning: `rcsid' defined but not used
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall y.tab.c
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall lex.yy.c
lex.yy.c:1281: warning: `yyunput' defined but not used
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall getloadavg.c
getloadavg.c:36: warning: `rcsid' defined but not used
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall libyywrap.c
arm-linux-gcc -O -o at at.o panic.o perm.o y.tab.o lex.yy.o getloadavg.o libyywrap.o  -L/../flex-2.5.4/libfl.a -L/../flex-2.5.4/libfl.a -s
rm -f atq atrm
ln -s -f at atq
ln -s -f at atrm
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall atd.c
atd.c: In function `run_loop':
atd.c:611: warning: implicit declaration of function `getloadavg'
atd.c: At top level:
atd.c:113: warning: `rcsid' defined but not used
arm-linux-gcc -c -O -DHAVE_CONFIG_H -DVERSION=\"3.1.8\" -DETCDIR=\"/etc\" -DLOADAVG_MX=0.8 -DDAEMON_USERNAME=\"root\" -DDAEMON_GROUPNAME=\"root\" -DLFILE=\"/var/spool/at/.SEQ\" -Wall daemon.c
daemon.c:51: warning: `rcsid' defined but not used
arm-linux-gcc -O -o atd atd.o daemon.o  getloadavg.o -L/../flex-2.5.4/libfl.a -s


Here is the result
root@server:/share/embedded/DNS-323/GPL# file at/at-3.1.8/at
at/at-3.1.8/at: ELF 32-bit LSB executable, ARM, version 1 (ARM), statically linked, stripped
root@server:/share/embedded/DNS-323/GPL# file at/at-3.1.8/atd
at/at-3.1.8/atd: ELF 32-bit LSB executable, ARM, version 1 (ARM), statically linked, stripped

Last edited by magore (2007-02-07 04:29:40)

Offline

 

#12 2007-02-07 05:08:24

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

Ok, I found my problem.  I had run 'configure' which screwed up the Makefile.  Mental note, don't do that.  smile  It was using gcc no matter what I had set GCC or CC to with export.

Ok I'm finding out some more things here.. stay tuned.  I was able to get a few more things to build...

Offline

 

#13 2007-02-07 08:02:44

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Success building the uclibc tool chain and other results

magore, when running ./build_uclibc I'm faced with a lot of question. Like big/little endian, cpu type, etc. Did you answer 'default' on all these or did you modify any?
I think it'd be good if the Wiki mentioned these questions....

...building...waiting...waiting...waiting....

/Apan

Offline

 

#14 2007-02-07 08:20:49

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

Apskaft wrote:

magore, when running ./build_uclibc I'm faced with a lot of question. Like big/little endian, cpu type, etc. Did you answer 'default' on all these or did you modify any?
I think it'd be good if the Wiki mentioned these questions....

...building...waiting...waiting...waiting....

/Apan

I just built mine with all defaults.

Offline

 

#15 2007-02-07 19:46:53

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

Well I was able to get just about everything to compile.

Now, I'm going to 'redo' it all and note each step because there are some things that are broken.

For instance, the symlinks (on my build/install at least) for libdl.so and libcrypt.so in uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/arm-linux-uclibc/lib are wrong, which prevents samba from compiling.

bison on my debian install is too new and causes compile problems with wu-ftpd, the fix is here:
http://gcc.gnu.org/ml/gcc-help/2004-07/msg00129.html

LPRing compiling was complaining about "conflicting types for built in function 'log'", the fix seems to be to just remove the references to the void log function in lpf.c : http://www.lprng.com/LPRng-CHANGES

and so on and so forth...

Offline

 

#16 2007-02-07 21:35:59

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Success building the uclibc tool chain and other results

tobyg wrote:

bison on my debian install is too new and causes compile problems with wu-ftpd, the fix is here:
http://gcc.gnu.org/ml/gcc-help/2004-07/msg00129.html

Attached you'll find a build-script for wu-ftpd. Applies an important patch and the above mentioned bison workaround. The output havn't been tested yet, but if it's work then you have a more secure ftp deamon.

/Apan

Offline

 

#17 2007-02-07 21:43:06

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

Thanks.  I thought I'd just try to get everything to compile before finding patches!  smile

My real goal here is to get the latest samba to compile for arm and run natively using the uclibc library (i.e. not running under debian/glibc as it already does).

Offline

 

#18 2007-02-07 22:37:06

jerrison
Member
Registered: 2007-02-04
Posts: 13

Re: Success building the uclibc tool chain and other results

ahem...i hate to bother you guys again, but...can anyone at least point me in the right direction how to crosscompile for arm? i completed all the steps  magore suggested and (i think) built the correct toolchain...but it seems that "arm-linx-gcc" is not found at all...did i miss anything?
thnx guys!

Offline

 

#19 2007-02-07 22:56:21

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Success building the uclibc tool chain and other results

Any luck with mt-daapd-0.2.4? I get a link failure in the final part which puzzles me alot:


arm-linux-gcc  -g -O2  -lpthread -L/home/apa/dns-323/GPL/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/lib -lgdbm -lid3tag -lz -o mt-daapd  main.o uici.o webserver.o configfile.o err.o restart.o daap-proto.o daap.o db-gdbm.o mp3-scanner.o playlist.o lexer.o parser.o strcasestr.o strsep.o redblack.o dynamic-art.o query.o mDNS.o mDNSPosix.o mDNSUNP.o rend-posix.o rend-unix.o

main.o(.text+0x11a0): In function `start_signal_handler':
/home/marcus/dns-323/GPL/iTunesServer/mt-daapd-0.2.4/src/main.c:681: undefined reference to `pthread_create'
main.o(.text+0x1738): In function `main':
/home/marcus/dns-323/GPL/iTunesServer/mt-daapd-0.2.4/src/main.c:976: undefined reference to `pthread_kill'
.
.
.

This even though I clearly have -lpthread. I've even tried to add -<stipped>/toolchain_arm/arm-linux/lib

I've also tried to use arm-linux-uclibc-gcc but there's something I'm missing


...too tired now.


/Apan

Offline

 

#20 2007-02-07 22:56:31

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

jerrison wrote:

ahem...i hate to bother you guys again, but...can anyone at least point me in the right direction how to crosscompile for arm? i completed all the steps  magore suggested and (i think) built the correct toolchain...but it seems that "arm-linx-gcc" is not found at all...did i miss anything?
thnx guys!

it's 'arm-linux-gcc' and actually that's just a symlink.

it links to arm-linux-uclibc-gcc and it's found in your uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/bin directory

macpro-debian-parallels:/home/toby/DNS323/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/bin# ls -ld arm-linux*
lrwxrwxrwx  1 root root      26 Feb  5 16:06 arm-linux-addr2line -> arm-linux-uclibc-addr2line
lrwxrwxrwx  1 root root      19 Feb  5 16:06 arm-linux-ar -> arm-linux-uclibc-ar
lrwxrwxrwx  1 root root      19 Feb  5 16:06 arm-linux-as -> arm-linux-uclibc-as
lrwxrwxrwx  1 root root      20 Feb  5 16:06 arm-linux-c++ -> arm-linux-uclibc-c++
lrwxrwxrwx  1 root root      24 Feb  5 16:06 arm-linux-c++filt -> arm-linux-uclibc-c++filt
lrwxrwxrwx  1 root root      20 Feb  5 16:06 arm-linux-cpp -> arm-linux-uclibc-cpp
lrwxrwxrwx  1 root root      20 Feb  5 16:06 arm-linux-g++ -> arm-linux-uclibc-g++
lrwxrwxrwx  1 root root      20 Feb  5 16:06 arm-linux-gcc -> arm-linux-uclibc-gcc
lrwxrwxrwx  1 root root      26 Feb  5 16:06 arm-linux-gcc-3.3.3 -> arm-linux-uclibc-gcc-3.3.3
lrwxrwxrwx  1 root root      23 Feb  5 16:06 arm-linux-gccbug -> arm-linux-uclibc-gccbug
lrwxrwxrwx  1 root root      21 Feb  5 16:06 arm-linux-gcov -> arm-linux-uclibc-gcov
lrwxrwxrwx  1 root root      20 Feb  5 16:06 arm-linux-gdb -> arm-linux-uclibc-gdb
lrwxrwxrwx  1 root root      19 Feb  5 16:06 arm-linux-ld -> arm-linux-uclibc-ld
lrwxrwxrwx  1 root root      19 Feb  5 16:06 arm-linux-nm -> arm-linux-uclibc-nm
lrwxrwxrwx  1 root root      24 Feb  5 16:06 arm-linux-objcopy -> arm-linux-uclibc-objcopy
lrwxrwxrwx  1 root root      24 Feb  5 16:06 arm-linux-objdump -> arm-linux-uclibc-objdump
lrwxrwxrwx  1 root root      25 Feb  5 16:06 arm-linux-protoize -> arm-linux-uclibc-protoize
lrwxrwxrwx  1 root root      23 Feb  5 16:06 arm-linux-ranlib -> arm-linux-uclibc-ranlib
lrwxrwxrwx  1 root root      24 Feb  5 16:06 arm-linux-readelf -> arm-linux-uclibc-readelf
lrwxrwxrwx  1 root root      20 Feb  5 16:06 arm-linux-run -> arm-linux-uclibc-run
lrwxrwxrwx  1 root root      21 Feb  5 16:06 arm-linux-size -> arm-linux-uclibc-size
lrwxrwxrwx  1 root root      24 Feb  5 16:06 arm-linux-strings -> arm-linux-uclibc-strings
lrwxrwxrwx  1 root root      22 Feb  5 16:06 arm-linux-strip -> arm-linux-uclibc-strip
-rwxr-xr-x  1 root root  343276 Feb  5 16:06 arm-linux-uclibc-addr2line
-rwxr-xr-x  2 root root  310124 Feb  5 16:06 arm-linux-uclibc-ar
-rwxr-xr-x  2 root root  532888 Feb  5 16:06 arm-linux-uclibc-as
-rwxr-xr-x  2 root root   84748 Feb  5 16:06 arm-linux-uclibc-c++
-rwxr-xr-x  1 root root  340076 Feb  5 16:06 arm-linux-uclibc-c++filt
-rwxr-xr-x  1 root root   84748 Feb  5 16:06 arm-linux-uclibc-cpp
-rwxr-xr-x  2 root root   84748 Feb  5 16:06 arm-linux-uclibc-g++
-rwxr-xr-x  2 root root   81484 Feb  5 16:06 arm-linux-uclibc-gcc
-rwxr-xr-x  2 root root   81484 Feb  5 16:06 arm-linux-uclibc-gcc-3.3.3
-rwxr-xr-x  1 root root   16039 Feb  5 16:05 arm-linux-uclibc-gccbug
-rwxr-xr-x  1 root root   19148 Feb  5 16:06 arm-linux-uclibc-gcov
-rwxr-xr-x  1 root root 2042924 Feb  5 16:06 arm-linux-uclibc-gdb
-rwxr-xr-x  2 root root  550392 Feb  5 16:06 arm-linux-uclibc-ld
-rwxr-xr-x  2 root root  351852 Feb  5 16:06 arm-linux-uclibc-nm
-rwxr-xr-x  1 root root  498860 Feb  5 16:06 arm-linux-uclibc-objcopy
-rwxr-xr-x  1 root root  530316 Feb  5 16:06 arm-linux-uclibc-objdump
-rwxr-xr-x  1 root root   31832 Feb  5 16:06 arm-linux-uclibc-protoize
-rwxr-xr-x  2 root root  310124 Feb  5 16:06 arm-linux-uclibc-ranlib
-rwxr-xr-x  1 root root  178316 Feb  5 16:06 arm-linux-uclibc-readelf
-rwxr-xr-x  1 root root  477048 Feb  5 16:06 arm-linux-uclibc-run
-rwxr-xr-x  1 root root  289740 Feb  5 16:06 arm-linux-uclibc-size
-rwxr-xr-x  1 root root  289740 Feb  5 16:06 arm-linux-uclibc-strings
-rwxr-xr-x  2 root root  498892 Feb  5 16:06 arm-linux-uclibc-strip
-rwxr-xr-x  1 root root   27288 Feb  5 16:06 arm-linux-uclibc-unprotoize
lrwxrwxrwx  1 root root      27 Feb  5 16:06 arm-linux-unprotoize -> arm-linux-uclibc-unprotoize

Offline

 

#21 2007-02-07 22:59:37

tobyg
Member
Registered: 2007-01-31
Posts: 42

Re: Success building the uclibc tool chain and other results

Apskaft wrote:

Any luck with mt-daapd-0.2.4? I get a link failure in the final part which puzzles me alot:


arm-linux-gcc  -g -O2  -lpthread -L/home/apa/dns-323/GPL/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/lib -lgdbm -lid3tag -lz -o mt-daapd  main.o uici.o webserver.o configfile.o err.o restart.o daap-proto.o daap.o db-gdbm.o mp3-scanner.o playlist.o lexer.o parser.o strcasestr.o strsep.o redblack.o dynamic-art.o query.o mDNS.o mDNSPosix.o mDNSUNP.o rend-posix.o rend-unix.o

main.o(.text+0x11a0): In function `start_signal_handler':
/home/marcus/dns-323/GPL/iTunesServer/mt-daapd-0.2.4/src/main.c:681: undefined reference to `pthread_create'
main.o(.text+0x1738): In function `main':
/home/marcus/dns-323/GPL/iTunesServer/mt-daapd-0.2.4/src/main.c:976: undefined reference to `pthread_kill'
.
.
.

This even though I clearly have -lpthread. I've even tried to add -<stipped>/toolchain_arm/arm-linux/lib

I've also tried to use arm-linux-uclibc-gcc but there's something I'm missing


...too tired now.


/Apan

Have you checked your symlinks?  Same thing, that one is linked incorrectly.

macpro-debian-parallels:/home/toby/DNS323/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/arm-linux-uclibc/lib# ls -ld libpthread*
-rw-r--r--  1 root root  83640 Feb  5 15:57 libpthread-0.9.28.so
-rw-r--r--  1 root root 104558 Feb  5 15:57 libpthread.a
lrwxrwxrwx  1 root root     52 Feb  5 15:57 libpthread.so -> ../../../../arm/arm-linux-uclibc/lib/libpthread.so.0
lrwxrwxrwx  1 root root     20 Feb  5 15:57 libpthread.so.0 -> libpthread-0.9.28.so
lrwxrwxrwx  1 root root     12 Feb  5 15:57 libpthread_pic.a -> libpthread.a
macpro-debian-parallels:/home/toby/DNS323/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/arm-linux-uclibc/lib# file libpthread.so
libpthread.so: broken symbolic link to `../../../../arm/arm-linux-uclibc/lib/libpthread.so.0'

Offline

 

#22 2007-02-07 23:00:17

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Success building the uclibc tool chain and other results

jerrison wrote:

ahem...i hate to bother you guys again, but...can anyone at least point me in the right direction how to crosscompile for arm? i completed all the steps  magore suggested and (i think) built the correct toolchain...but it seems that "arm-linx-gcc" is not found at all...did i miss anything?
thnx guys!

Did you manage to execute the ./build_at or ./build_busybox ?

Sounds like you're missing:

source setpath
export CC=arm-linux-gcc
export GCC=arm-linux-gcc

HTH/Apan

Offline

 

#23 2007-02-07 23:16:34

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Success building the uclibc tool chain and other results

tobyg wrote:

Have you checked your symlinks?

Nope, and they were totally screwed. Now fixed and mt-daapd compiled. Had to add LDFLAGS=-L/home/apa/dns-323/GPL/uclibc-toolchain-src-20040609/gcc-3.3.x/toolchain_arm/usr/lib to each ./configure except the zlib one....



THANKS!!! Now it's time to hit the sack, tomorrow its FireFly time..



/Apan

Offline

 

#24 2007-02-07 23:56:18

jerrison
Member
Registered: 2007-02-04
Posts: 13

Re: Success building the uclibc tool chain and other results

Apskaft wrote:

jerrison wrote:

ahem...i hate to bother you guys again, but...can anyone at least point me in the right direction how to crosscompile for arm? i completed all the steps  magore suggested and (i think) built the correct toolchain...but it seems that "arm-linx-gcc" is not found at all...did i miss anything?
thnx guys!

Did you manage to execute the ./build_at or ./build_busybox ?

Sounds like you're missing:

source setpath
export CC=arm-linux-gcc
export GCC=arm-linux-gcc

HTH/Apan

yup...did that...all i really want to do is compile rtorrent/libtorrent or basically anything just to give it a go. all the build_* scripts worked flawlessly but using ./configure --built=arm-linux-gcc just doesnīt work...and i canīt find anything useful about crosscompiling so far.

Offline

 

#25 2007-02-08 08:37:05

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: Success building the uclibc tool chain and other results

jerrison wrote:

yup...did that...

jerrison wrote:

or basically anything just to give it a go

Well, if you've successfully executed those scripts they you've successfully crosscompiled both 'at' and 'busybox'. Many of sources on the net needs modified files (Makefiles, configurescripts, etc.) in order to work. Some will not work without modified sourcecode due to limitations in the uClibc (which is very small end efficient compared to GNU's libc).

One approach learning the process might be to build yourself the mt-daapd deamon both on the native Linux system and using the crosscompiler. Check the differences in the Makefiles and configure scrips and draw conclusion from others work.

I cannot help you anymore as I'm lerning this the hard way myself. All we can do is to share gained knowledged in our Wiki. The buildfiles from magore are excellent and are showing us the way forward.

As mentioned before, litorrent will be one of the things I'll dig into rather soon and I promise you that I'll share my findings.

Good luck/Apan

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB