[Split] Compiling DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions
Goto page Previous  1, 2, 3 ... 14, 15, 16 ... 23, 24, 25  Next
Author Message
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Thu Dec 15, 2011 3:36    Post subject: Reply with quote
Well, I tried again to create a VM for building dd-wrt.

I'm using kc1608 scripts but 02 and 03 are giving me errors, can somebody help me?

In 02 I have errors like this:

Code:
tests/test-table-opts/Makefile.am:73: `%'-style pattern rules are a GNU make extension
tests/test-table-opts/Makefile.am:74: subst -,_,$(basename $(@F: non-POSIX variable name
tests/test-table-opts/Makefile.am:74: (probably a GNU make extension)
tests/test-table-opts/Makefile.am:76: `%'-style pattern rules are a GNU make extension
tests/test-table-opts/Makefile.am:77: subst -,_,$(basename $(@F: non-POSIX variable name
tests/test-table-opts/Makefile.am:77: (probably a GNU make extension)


It's inside radvd/flex

Now in 03:

Code:
root@ddbuilder:~# sh 03_compile_tools.sh
cc     jsformat.c   -o jsformat
jsformat.c: In function âfilterâ:
jsformat.c:11: warning: incompatible implicit declaration of built-in function âmallocâ
make: Nothing to be done for `all'.
`lzma' -> `/root/DEV/DD-WRT/opt/loader-0.02/lzma'
make -C ./lzma/C/7zip/Compress/LZMA_Lib
make[1]: Entering directory `/root/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Lib'
g++ mksquashfs.o read_fs.o sort.o -L./lzma/C/7zip/Compress/LZMA_Lib -llzma -lpthread -o mksquashfs-lzma
strip.c: In function âmainâ:
strip.c:14: warning: incompatible implicit declaration of built-in function âmemsetâ
strip.c:24: warning: incompatible implicit declaration of built-in function âstrstrâ
strip.c:30: warning: incompatible implicit declaration of built-in function âstrlenâ
strip.c:79: warning: incompatible implicit declaration of built-in function âmemcpyâ
strip.c:87: warning: incompatible implicit declaration of built-in function âstrlenâ
write4.c: In function âfilterâ:
write4.c:65: warning: incompatible implicit declaration of built-in function âstrlenâ
write4.c:80: warning: incompatible implicit declaration of built-in function âmemcpyâ
webcomp.c: In function âcompileâ:
webcomp.c:144: warning: comparison of distinct pointer types lacks a cast
root@ddbuilder:~#
Sponsor
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Fri Dec 16, 2011 23:02    Post subject: Reply with quote
fggs wrote:
Well, I tried again to create a VM for building dd-wrt.

I'm using kc1608 scripts but 02 and 03 are giving me errors, can somebody help me?

In 02 I have errors like this:

Code:
tests/test-table-opts/Makefile.am:73: `%'-style pattern rules are a GNU make extension
tests/test-table-opts/Makefile.am:74: subst -,_,$(basename $(@F: non-POSIX variable name
tests/test-table-opts/Makefile.am:74: (probably a GNU make extension)
tests/test-table-opts/Makefile.am:76: `%'-style pattern rules are a GNU make extension
tests/test-table-opts/Makefile.am:77: subst -,_,$(basename $(@F: non-POSIX variable name
tests/test-table-opts/Makefile.am:77: (probably a GNU make extension)


It's inside radvd/flex

Add this to your script, this will fix radvd/flex

#fix radvd compile
cd ~/DEV/DD-WRT/src/router/radvd/flex
aclocal
automake --add-missing
autoreconf -vfi
autoconf



Now in 03:

Code:
root@ddbuilder:~# sh 03_compile_tools.sh
cc     jsformat.c   -o jsformat
jsformat.c: In function âfilterâ:
jsformat.c:11: warning: incompatible implicit declaration of built-in function âmallocâ
make: Nothing to be done for `all'.
`lzma' -> `/root/DEV/DD-WRT/opt/loader-0.02/lzma'
make -C ./lzma/C/7zip/Compress/LZMA_Lib
make[1]: Entering directory `/root/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Lib'
g++ mksquashfs.o read_fs.o sort.o -L./lzma/C/7zip/Compress/LZMA_Lib -llzma -lpthread -o mksquashfs-lzma
strip.c: In function âmainâ:
strip.c:14: warning: incompatible implicit declaration of built-in function âmemsetâ
strip.c:24: warning: incompatible implicit declaration of built-in function âstrstrâ
strip.c:30: warning: incompatible implicit declaration of built-in function âstrlenâ
strip.c:79: warning: incompatible implicit declaration of built-in function âmemcpyâ
strip.c:87: warning: incompatible implicit declaration of built-in function âstrlenâ
write4.c: In function âfilterâ:
write4.c:65: warning: incompatible implicit declaration of built-in function âstrlenâ
write4.c:80: warning: incompatible implicit declaration of built-in function âmemcpyâ
webcomp.c: In function âcompileâ:
webcomp.c:144: warning: comparison of distinct pointer types lacks a cast
root@ddbuilder:~#


Here make sure you are using Make 3.82
and u have the automake tools installed.
ex: sudo apt-get install automake; make; gcc
ect.... But remember these are just warnings, all the tools should compile.


-Fractal


Last edited by Fractal on Fri Dec 16, 2011 23:05; edited 1 time in total
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Fri Dec 16, 2011 23:04    Post subject: Reply with quote
my compile script for that part looks like this:

Code:
#!/bin/bash
cd ~/DEV/DD-WRT/src/router/tools
rm jsformat
make jsformat
#change compile flage in /home/dd-wrt/DD-WRT/src/squashfs-tools/Makefile to use non x64 compiler if oyu do not have x64 machine
if [ `uname -m | grep -q x86_64` ] ; then
   sed -i -e "s%-m64%-m32%" ~/DEV/DD-WRT/src/squashfs-tools/Makefile
   sed -i -e "s%-m64%-m32%" ~/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Lib/makefile
fi
# same in ~/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Lib/makefile

# now make the lzma util. because Version in svn is 64 bit. There should not be any problem with recompiling in on 64bit, too.
cd ~/DEV/DD-WRT/src/squashfs-tools/lzma/C/7zip/Compress/LZMA_Alone
mv makefile makefile.disabled
mv makefile.gcc makefile
make
cp -vf lzma ~/DEV/DD-WRT/opt/loader-0.02/
# restore point checked out of SVN
mv makefile makefile.gcc
mv makefile.disabled makefile
# compile mksquashfs-lzma (again it is 64 bit)
cd ~/DEV/DD-WRT/src/squashfs-tools
rm mksquashfs-lzma
make
cp mksquashfs-lzma ../linux/brcm/linux.v24_2/scripts/squashfs
cp mksquashfs-lzma ../linux/brcm/linux-2.6.23/scripts/squashfs
cd ~/DEV/DD-WRT/tools/
rm ./strip
gcc strip.c -o ./strip
rm ./write3
gcc write3.c -o ./write3
rm ./write4
gcc write4.c -o ./write4
rm ./webcomp
gcc -o webcomp -DUEMF -DWEBS -DLINUX webcomp.c
cd ~/DEV/DD-WRT/opt/tools/
rm ./trx
gcc trx.c -o ./trx
rm ./addpattern
gcc addpattern.c -o ./addpattern
rm ./motorola-bin
gcc motorola-bin.c -o ./motorola-bin
rm ./trx_wgr614
gcc trx_wgr614.c -o ./trx_wgr614
cd ~/DEV/DD-WRT/opt/sstrip
rm ./sstrip
gcc sstrip.c -o ./sstrip
cd ~/DEV/DD-WRT/opt/asus
gcc asustrx-rt66u.c -o ./asustrx-rt66u
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Sat Dec 17, 2011 2:12    Post subject: Reply with quote
Now I'm stuck in iproute2, how did you solve yours?
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Sat Dec 17, 2011 10:03    Post subject: Reply with quote
fggs wrote:
Now I'm stuck in iproute2, how did you solve yours?


yep your almost done check out this ticket:

http://svn.dd-wrt.com/ticket/2263

I have the fixed file, but its not needed anymore as u can comment out IPROUTE2 in configs/broadcom_K26/.config-XXX

-Fractal
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Sat Dec 17, 2011 11:52    Post subject: Reply with quote
Thanks Fractal!

Now it complains about something in lib.mipsel while making optmize-lib. Seems like it's missing pics directory.
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Sat Dec 17, 2011 17:03    Post subject: Reply with quote
Okay, I've fixed that error by downloading lib.mipsel.tar.gz and unpacking inside router dir, but now it says it couldn't find libc.so.6 in path /lib:/usr/lib.

I've checked manually and libc.so.6 is inside /lib, I don't know why it's not finding!

Any ideas?
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Sat Dec 17, 2011 17:07    Post subject: Reply with quote
fggs wrote:
Okay, I've fixed that error by downloading lib.mipsel.tar.gz and unpacking inside router dir, but now it says it couldn't find libc.so.6 in path /lib:/usr/lib.

I've checked manually and libc.so.6 is inside /lib, I don't know why it's not finding!

Any ideas?


can you give me the last 10 lines up to the compile error... I assume its a path issue.... optimize-lib should be in toolchain/bin directory as well
you can check your path echo $PATH let me know what that says as well.
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Sat Dec 17, 2011 17:20    Post subject: Reply with quote
Give me a few minutes, I'm trying again, I've added /lib and /usr/lib to export line of build script, but if it still gives an error I will have a logfile this time
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Sat Dec 17, 2011 17:29    Post subject: Reply with quote
Here:

Code:
mklibs.py -D \
      -d mipsel-uclibc/tmp/mklibs-out \
      --sysroot /root/DEV/DD-WRT/src/router/mipsel-uclibc/target \
      -L /lib \
      -L /usr/lib \
      --ldlib /lib/ld-uClibc.so.0 \
      --target mipsel-linux-uclibc \
      `cat mipsel-uclibc/tmp/mklibs-progs` 2>&1
I: Using /root/DEV/DD-WRT/src/router/mipsel-uclibc/target/lib/ld-uClibc.so.0 as dynamic linker.
I: library reduction pass 1
891 symbols, 76 unresolved
Library not found: libc.so.6 in path: /lib:/usr/lib
make[1]: *** [optimize-lib] Error 1
make[1]: Leaving directory `/root/DEV/DD-WRT/src/router'
make: *** [install] Error 2
cp: cannot stat `dd-wrt.v24-K26.trx': No such file or directory


Original script line:

Code:
export PATH=/xfs/toolchains/toolchain-mipsel_gcc-linaro_uClibc-0.9.32/bin:$PATH


Line of last try:

Code:
export PATH=/xfs/toolchains/toolchain-mipsel_gcc-linaro_uClibc-0.9.32/bin:/lib:/usr/lib:$PATH
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Tue Dec 27, 2011 18:54    Post subject: Reply with quote
fggs wrote:
Here:

Code:
mklibs.py -D \
      -d mipsel-uclibc/tmp/mklibs-out \
      --sysroot /root/DEV/DD-WRT/src/router/mipsel-uclibc/target \
      -L /lib \
      -L /usr/lib \
      --ldlib /lib/ld-uClibc.so.0 \
      --target mipsel-linux-uclibc \
      `cat mipsel-uclibc/tmp/mklibs-progs` 2>&1
I: Using /root/DEV/DD-WRT/src/router/mipsel-uclibc/target/lib/ld-uClibc.so.0 as dynamic linker.
I: library reduction pass 1
891 symbols, 76 unresolved
Library not found: libc.so.6 in path: /lib:/usr/lib
make[1]: *** [optimize-lib] Error 1
make[1]: Leaving directory `/root/DEV/DD-WRT/src/router'
make: *** [install] Error 2
cp: cannot stat `dd-wrt.v24-K26.trx': No such file or directory


Original script line:

Code:
export PATH=/xfs/toolchains/toolchain-mipsel_gcc-linaro_uClibc-0.9.32/bin:$PATH


Line of last try:

Code:
export PATH=/xfs/toolchains/toolchain-mipsel_gcc-linaro_uClibc-0.9.32/bin:/lib:/usr/lib:$PATH


ah sorry, was away for the holidays, but I believe the problem here is that in DEV/DD-WRT/source/router/lib.mipsel you are missing files, dd-wrt normally links these to the current toolchain in use... also DEV/DD-WRT/opt/libgcc_so_1 needs linked as well

-Fractal
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Tue Dec 27, 2011 19:08    Post subject: Reply with quote
Hi Fractal, merry christmas!

Which lib.mipsel are you using? I've downloaded mine from kc6108 site.

How you linked DEV/DD-WRT/opt/libgcc_so_1?

Thanks!
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Tue Dec 27, 2011 20:09    Post subject: Reply with quote
fggs wrote:
Hi Fractal, merry christmas!

Which lib.mipsel are you using? I've downloaded mine from kc6108 site.

How you linked DEV/DD-WRT/opt/libgcc_so_1?

Thanks!


yep the one from kc's site works great just copy all the files into source/router/lib.mipsel

also ln -s /xfs/toolchain/lib/libgcc_so_1 name

or just copy the file from the toolchain/lib/dir to source/opt

then your build scripts should work.
also have after you do a mega, check svn, I put a patch for iproute2, since they are using it and have made commits against it... so then you can uncomment IPROUTE2 in source/router/configs/broadcom_k26/.config-xxxxx

edit: also replace with this file in glib, its broken in svn. it is fixed in his private repo but the public its broke

http://svn.dd-wrt.com:8000/ticket/2329



-Fractal
fggs
DD-WRT Guru


Joined: 28 Jan 2008
Posts: 1741

PostPosted: Tue Dec 27, 2011 20:17    Post subject: Reply with quote
Thanks Fractal!

I'll test and see..

In my case I just need 15962 big non-nv60k with my patches, I wouldn't worry much with latest builds because it doesn't have wireless drivers for my router..
Fractal
DD-WRT Guru


Joined: 19 Apr 2010
Posts: 1243

PostPosted: Tue Dec 27, 2011 20:23    Post subject: Reply with quote
if you are using that old of a build, I think you are gong to want to use the 4.1.2 toolchain cause I believe up to 17100 used the 4.1.2 toolchain and was switched to linero 4.5.2 after that to reduce bin size.

I would like to get this thread kicked off and help as much as I can, as it seems here there is alot of people with alot of knowledge that can be learned.

-Fractal
Goto page Previous  1, 2, 3 ... 14, 15, 16 ... 23, 24, 25  Next Display posts from previous:    Page 15 of 25
Post new topic   Reply to topic    DD-WRT Forum Index -> Generic Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum