Compiling DD-WRT with OpenVPN feature

14 posts / 0 new
Last post
achilles
achilles's picture
Compiling DD-WRT with OpenVPN feature

Hi all,

I am trying to compile DD-WRT with openvpn feature .

The steps I took for the same are as follows :

1. copy .config_openvpn.v24 to .config under router directory .

2.make clean;make

But make fails and I am getting some strange error messages such as :

/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2562
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
nflow.o: In function `process_netflow_cache':
nflow.c:(.text.process_netflow_cache+0x6bc): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
servers.o: In function `end_servers_r':
servers.c:(.text.end_servers_r+0xf4): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
servers.o: In function `add_server':
servers.c:(.text.add_server+0x90): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
storage.o: In function `flow_update':
storage.c:(.text.flow_update+0x3a4): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
disp.o: In function `display':
disp.c:(.text.display+0x1bc): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
psrc.o: In function `destroy_packet_source':
psrc.c:(.text.destroy_packet_source+0x2c): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
psrc.c:(.text.destroy_packet_source+0x64): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
psrc.c:(.text.destroy_packet_source+0x90): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2346
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2350
psrc.o: In function `create_packet_source':
psrc.c:(.text.create_packet_source+0xe8): relocation truncated to fit: R_MIPS_CALL16 against `free'
/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elf-strtab.c:241
collect2: ld returned 1 exit status
make[1]: *** [rflow] Error 1
make[1]: Leaving directory `/root/Netgear_work/DD-WRT/src/router/rflow'
make: *** [rflow] Error 2

 

 Could any body plz tell me why this happens ... It seems there is some problem in compiling rflow directory ....

I have successfully compiled DD-WRT for mini build (where rflow was absent ) and now need to compile it for OpenVPN ... could anybody plz tell me how to overcome this .. 

Goddchen
Goddchen's picture
Hi achilles :)

Hi achilles :)
I'm currently trying the same (openvpn build)...
but i'm stuck at some other errors (and already fixed some more errors, but not the one that you are facing :( )

/home/goddchen/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elf-strtab.c:241
collect2: ld returned 1 exit status

There are about 20 of those errors... I'm working on it...
A hint: I did "make configure" after copying the new .config file... Perhaps this helps you too?

Goddchen
Goddchen's picture
I found a hint that one needs

I found a hint that one needs to compile that rflow thing first with gcc 3.x and then compile the rest with gcc 4.x. I tried it but all i get is:

~/dd-wrt/dd-wrt_scripts/DD-WRT/src/router/rflow$ make
cc -DIPCAD_VERSION=\"3.6.2\" -DCONFIG_FILE=\"/tmp/etc/ipcad.conf\" -DHAVE_CONFIG_H -D_REENTRANT -D_THREAD_SAFE -DIFST_linux -I -DHAVE_CONFIG_H -W -Wall -ffunction-sections -fdata-sections -Wl,--gc-sections -o main.o -c main.c
main.c:12: error: expected declaration specifiers or â...â before âsetpriorityâ
main.c:12: error: expected declaration specifiers or â...â before âwhichâ
main.c:12: error: expected declaration specifiers or â...â before âwhoâ
main.c:12: error: expected declaration specifiers or â...â before âprioâ
main.c:12: warning: data definition has no type or storage class
main.c:12: warning: type defaults to âintâ in declaration of â_syscall3â
make: *** [main.o] Error 1

achilles
achilles's picture
yep ... I also tried this but

yep ... I also tried this but now I am getting stuck in SNMP directory as their is no Makefile and running ./configure fails ....
I m doing some googling and trying ... lets see if we can fix this ... what I have done upto now is as follows :
1. cd DD-WRT/src/router
2. cp .config_openvpn.v24 .config
3. cp ../linux/linux/.config_std ../linux/linux/.config and
make clean
4. export PATH=/opt/3.4.6/bin:$PATH
5. make rflow
6. export PATH=/opt/4.1.0/bin:$PATH
7. make

U too can try these steps to see if u get any further ..

Goddchen
Goddchen's picture
I also tried this but now I

I also tried this but now I am getting stuck in SNMP directory as their is no Makefile and running ./configure fails ....

I experienced the same problem yesterday. I think i solved it by running ./configure too. Why does it fail for you? Can't ./configure be executed or does the configure process fail at some point?

achilles
achilles's picture
Goddchen said:

Goddchen said:

I also tried this but now I am getting stuck in SNMP directory as their is no Makefile and running ./configure fails ....

I experienced the same problem yesterday. I think i solved it by running ./configure too. Why does it fail for you? Can't ./configure be executed or does the configure process fail at some point?

the configure process is failing for me with error :

checking for a sed that does not truncate output... mkdir: cannot create directory `/root/tmp/sed7743-8183': No such file or directory
: cannot create a temporary directory in /root/tmp

 

Any ideas .....  

Goddchen
Goddchen's picture
not only an idea, i have the

not only an idea, i have the solution :D
just create that directory... it was complaining about not finding /home/goddchen/tmp/ on my machine, i just did
mkdir /home/goddchen/tmp/
and everything went just fine

Goddchen
Goddchen's picture
hm, strange...

hm, strange...
i'm now getting

/home/goddchen/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2562
make[3]: Leaving directory `/home/goddchen/dd-wrt/dd-wrt_scripts/DD-WRT/src/router/lzo/minilzo'
make[3]: Entering directory `/home/goddchen/dd-wrt/dd-wrt_scripts/DD-WRT/src/router/lzo'

so i did the trick with compiling it seperately beforehand with gcc 3.x which worked just fine. Next i went back to src/router directory and did "make" again. The problem is, that "make" removes the compiled stuff and compiles it again with gcc 4.x which of course fails again.
Any idea how i can prevent "make" from removing the compiled files?

achilles
achilles's picture
thnx a lot man ... I am

thnx a lot man ... I am through with the compilation process ... Now I need to create a set up to test OpenVPN feature on DD-WRT on WGR614L ..
I will let u know once I m done with this ... :)

Goddchen
Goddchen's picture
hey, great that I could help

hey, great that I could help YOU this time :)
forget about my last posting, i get this error when i compile with gcc 3.x seperately, too :( I've just overseen it. :( Any idea regarding that error?

Goddchen
Goddchen's picture
hm, what exactly did you do

hm, what exactly did you do to fix that assertion error?

achilles
achilles's picture
Goddchen said:

Goddchen said:
hm, what exactly did you do to fix that assertion error?

I created tmp directory in /root .

But I am not getting this lzo error ... One thing I observed is that in for openvpn related packages some package specific makefiles are missing so it would be better to run a make configure before issuing a make command  ...

Plz try this and let me know the result ... 

Goddchen
Goddchen's picture
damn, i'm still stuck at that

damn, i'm still stuck at that assertion error

/home/dd-wrt/toolchains/4.1.0-uclibc-0.9.28/bin/../lib/gcc/mipsel-linux-uclibc/4.1.0/../../../../mipsel-linux-uclibc/bin/ld: BFD 2.16.1 assertion fail /home/openwrt/trunk/openwrt/toolchain_build_mipsel/binutils-2.16.1/bfd/elfxx-mips.c:2562

it's not something with that tmp directory, i created it.
what else did you do to fix that?

achilles
achilles's picture
OK ... I did nothing specific

OK ... I did nothing specific for this .... I dnt rmmbr if I even got this error or not ...
BTW one more change I would suggest :
In Makefile under linux.v24_2 there is a variable named SUBLEVEL = 37 make it 36..
I dnt know if this is related 2 ur error or not but u can try with it and et me know ..