PDA

Bekijk de volledige versie : Compiling [need HowTo]



FilimoniC
05-11-2005, 06:10
Could smdy tell me how can i compile my .c program for wl500gx?
i tried to search, but coldn't find anything.

hejira
08-11-2005, 16:53
I'd also like to build a .c file for my wl-500g and I'm also not sure how to start. But you know that there is a tutorial on how to set up a build environment for the wl-500g(x) at http://www.macsat.com/BuildEnvironment.php? Unfortunatelly, it ends when the interesting part begins and I don't know how to proceed from there.

Maybe by pushing this thread a bit we'll find someone out there who is able to provide some help on this ;-)

Jean-Fabrice
08-11-2005, 20:13
I'd also like to build a .c file for my wl-500g and I'm also not sure how to start. But you know that there is a tutorial on how to set up a build environment for the wl-500g(x) at http://www.macsat.com/BuildEnvironment.php?
The goal of the build environment is to be build ipk packages for the nslu2 and wl500 starting from an opensource software available somewhere on the Net (apache, php, pound, etc...).


Unfortunatelly, it ends when the interesting part begins and I don't know how to proceed from there.

If your plan is only to compile and run a few set of .c files you've written, the only things you need is this sub-part of Macsat tutorial (apart of the prerequisites) :


mkdir /opt
cd /opt < enter >
wget http://www.asuscom.de/pub/ASUS/wireless/WL-500g-03/GPL_1927.zip < enter >
tar zxf ./GPL_1927.zip < enter >
cp -R /opt/broadcom/opt/brcm /opt < enter >

This will install the Asus cross compilation toolchain (a c compiler able to build stuff for broadcom architecture) on your linux machine.
You will also need Oleg's patched uClibc :


cd /var/tmp
wget http://oleg.wl500g.info/1.9.2.7-6b/wl500g-1.9.2.7-6b.tar.bz2
tar xjf wl500g-1.9.2.7-6b.tar.bz2
cd wl500g-1.9.2.7-6b
make uClibc


When this two points are done, you're ready to compile your own .c stuff using broadcom c compiler :


mipsel-uclibc-gcc -o helloworld helloworld.c


et voila.

JF

FilimoniC
09-11-2005, 04:06
Thanx Very much!

FilimoniC
29-11-2005, 07:24
There is no file: http://www.asuscom.de/pub/ASUS/wireless/WL-500g-03/GPL_1927.zip , can somebody sahre it?

gwl
30-11-2005, 03:08
GPL source code for firmware version 1.9.5.0, is here:

http://support.asus.de/download/download.aspx?SLanguage=en-us

global: http://dlsvr01.asus.com/pub/ASUS/wireless/WL-500g-03/GPL_1950.zip
usa: http://dlsvr03.asus.com/pub/ASUS/wireless/WL-500g-03/GPL_1950.zip
europe: http://dlsvr02.asus.com/pub/ASUS/wireless/WL-500g-03/GPL_1950.zip

beware... it's 170MB...

NOTE: this isn't a zip file... you should rename it to .tar.gz our .tgz and extract it with:
tar -zxvf your_file.tgz

FilimoniC
30-11-2005, 18:37
I'll ask you for new tutorial... I dont know how to make it work with new file (some directories are not exist, some are renamed).. Can anybody help me?

Oleg
02-12-2005, 20:09
1.9.5.0 firmware sources does not contain compiler.
1.9.2.7 does. The actual link is ftp://ftp.asuscom.de/pub/ASUS/wireless/WL-500g-03/GPL_1927.zip

Jean-Fabrice
03-12-2005, 09:49
Oleg,

What is your plan for future custom firmware ?
Are you still working on the 1.9.2.7 branch or did you switch to 1.9.5.0 (which seems to support WDS over WPA, my personnal need ;))

JF

Oleg
03-12-2005, 15:57
JF, I'm now working on 1.9.2.7-6c. Perhaps there would be 1.9.5.0-1 or something, which would be 1.9.2.7 based (but includes 1.9.5.0 fixes), as moving to 1.9.5.0 is a big pain...
JF, actually you should consider switching to OpenWRT, as it has web interface now.

FilimoniC
03-12-2005, 19:02
Uhmm... Can you advice a recovery method.. Downloaded it twice, both are damaged +(

zork
29-01-2006, 11:14
Hello,
I'm a new french guy :)
I read these how to (http://www.macsat.com/BuildEnvironment.php) but i the end... it's not working and i don't understand why...
I'm running on a gentoo Box.

I have these message :
utopia unslung # make
make readline-stage ncurses-stage
make[1]: Entering directory `/opt/unslung'
#make <bar>-stage <baz>-stage
rm -rf /opt/unslung/builds/readline-5.0 /opt/unslung/builds/readline
zcat /opt/unslung/downloads/readline-5.0.tar.gz | tar -C /opt/unslung/builds -xvf -
readline-5.0/
readline-5.0/doc/
[Snip]
readline-5.0/histfile.c
readline-5.0/histsearch.c
#cat | patch -d /opt/unslung/builds/readline-5.0 -p1
mv /opt/unslung/builds/readline-5.0 /opt/unslung/builds/readline
(cd /opt/unslung/builds/readline; \
AR=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-ar AS=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-as LD=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-ld NM=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-nm CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc CPP="/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -E" GCC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc CXX=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-g++ RANLIB=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-ranlib STRIP=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-strip \
CPPFLAGS="-O2 -pipe -I/opt/unslung/staging/opt/include " \
LDFLAGS=" -L/opt/unslung/staging/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/opt/unslung/staging/opt/lib " \
./configure \
--build=i386-pc-linux-gnu \
--host=mipsel-linux \
--target=mipsel-linux \
--prefix=/opt \
--disable-nls \
--disable-static \
)
checking build system type... i386-pc-linux-gnu
checking host system type... mipsel-unknown-linux-gnu

Beginning configuration for readline-5.0 for mipsel-unknown-linux-gnu

checking whether make sets $(MAKE)... yes
checking for mipsel-linux-gcc... /opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.
make[1]: *** [/opt/unslung/builds/readline/.configured] Erreur 77
make[1]: Leaving directory `/opt/unslung'
make: *** [/opt/unslung/builds/abook/.configured] Erreur 2

Can somebody help me ?

;)

zork
29-01-2006, 11:51
Oh i completly forget to sayed that i have try these : http://wl500g.info/showpost.php?p=22732&postcount=3 and i have these :
utopia wl500g-1.9.2.7-6b # make uClibc
make -C /var/tmp/uClibc all install CROSS=mipsel-linux-
/bin/sh: mipsel-linux-gcc: command not found
/bin/sh: mipsel-linux-gcc: command not found
make[1]: mipsel-linux-gcc : commande introuvable
make[1]: Entering directory `/var/tmp/uClibc'
rm -f include/asm;

The path '/opt/brcm/hndtools-mipsel-linux/mipsel-linux/include/asm' doesn't exist.
I bet you didn't set KERNEL_SOURCE, TARGET_ARCH or UCLIBC_HAS_MMU
correctly when you configured uClibc. Please fix these settings.

make[1]: *** [headers] Erreur 1
make[1]: Leaving directory `/var/tmp/uClibc'
make: *** [uClibc] Erreur 2


The message are clear but i do exactly what they said in the How to...
In the repertory /opt/brcm/ i have
utopia wl500g-1.9.2.7-6b # ls -R /opt/brcm/hndtools-mipsel-linux/include/
/opt/brcm/hndtools-mipsel-linux/include/:
c++

/opt/brcm/hndtools-mipsel-linux/include/c++:
3.2.3

/opt/brcm/hndtools-mipsel-linux/include/c++/3.2.3:
algorithm cfloat csignal cwchar fstream iterator new stdexcept
backward ciso646 cstdarg cwctype functional limits numeric streambuf
bits climits cstddef cxxabi.h iomanip list ostream string
bitset clocale cstdio deque ios locale queue typeinfo
cassert cmath cstdlib exception iosfwd map set utility
cctype complex cstring exception_defines.h iostream memory sstream valarray
cerrno csetjmp ctime ext istream mipsel-linux stack vector

/opt/brcm/hndtools-mipsel-linux/include/c++/3.2.3/backward:
algobase.h complex.h hash_map.h iostream.h multimap.h queue.h streambuf.h tree.h
algo.h defalloc.h hash_set.h istream.h multiset.h rope.h stream.h vector.h
alloc.h deque.h hashtable.h iterator.h new.h set.h strstream
backward_warning.h fstream.h heap.h list.h ostream.h slist.h strstream.h
bvector.h function.h iomanip.h map.h pair.h stack.h tempbuf.h


Nothing about C or ASM just for c++... :(

narcis
07-06-2006, 01:35
checking for mipsel-linux-gcc... /opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
checking for C compiler default output... configure: error: C compiler cannot create executables
See `config.log' for more details.

Well, DID you have a log at the config.log file? There you should probably be able to see what the error was yourself. I had a similar problem recently where I had bogus CFLAGS parameters that I had to get rid of first.

darius
04-01-2009, 11:20
The goal of the build environment is to be build ipk packages for the nslu2 and wl500 starting from an opensource software available somewhere on the Net (apache, php, pound, etc...).

If your plan is only to compile and run a few set of .c files you've written, the only things you need is this sub-part of Macsat tutorial (apart of the prerequisites) :


mkdir /opt
cd /opt < enter >
wget http://www.asuscom.de/pub/ASUS/wireless/WL-500g-03/GPL_1927.zip < enter >
tar zxf ./GPL_1927.zip < enter >
cp -R /opt/broadcom/opt/brcm /opt < enter >

This will install the Asus cross compilation toolchain (a c compiler able to build stuff for broadcom architecture) on your linux machine.
You will also need Oleg's patched uClibc :


cd /var/tmp
wget http://oleg.wl500g.info/1.9.2.7-6b/wl500g-1.9.2.7-6b.tar.bz2
tar xjf wl500g-1.9.2.7-6b.tar.bz2
cd wl500g-1.9.2.7-6b
make uClibc


When this two points are done, you're ready to compile your own .c stuff using broadcom c compiler :


mipsel-uclibc-gcc -o helloworld


et voila.

JF

Hi Jean,

I am trying to compile helloworld.c just to learn how it works.
My hardware is WL-500gP V2, I installed Koppel firmware to get my cellular modem connected.

Aus server is temporary down.

As your HowTo is already some years old, please tell me if the GPL sources are still valid version for my router running today Koppel .
If not, what GPL sources should I select and from what place ?

greetings,

Happy New Year

Darius

BTW I will try to compile Linux Dialog for running my basic shell scripts.

darius
05-01-2009, 21:30
JF, I'm now working on 1.9.2.7-6c. Perhaps there would be 1.9.5.0-1 or something, which would be 1.9.2.7 based (but includes 1.9.5.0 fixes), as moving to 1.9.5.0 is a big pain...
JF, actually you should consider switching to OpenWRT, as it has web interface now.

Hi,

created a toolchain for native compilation use:
ipkg install optware-devel

as advised by al37919

running
/opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc

i get the following errors

======================
[admin@oo /opt]$ mipsel-uclibc-gcc -o helloworld
-sh: mipsel-uclibc-gcc: not found
[admin@oo /opt]$ /opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc
/opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc: /opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc: 1: Syntax error: "(" unexpected
[admin@oo /opt]$ /opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc --help
/opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc: /opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc: 1: Syntax error: "(" unexpected
[admin@oo /opt]$


Any sollution for syntax error "(" ?

And what directory is/was correct to save optware-devel
and how to make

/opt/broadcom/opt/brcm/hndtools-mipsel-uclibc-0.9.19/bin/mipsel-uclibc-gcc

running as
mipsel-uclibc-gcc
only ?

What is your solution ?

Tried to install
mkdir /opt
cd /opt < enter >
wget http://www.asuscom.de/pub/ASUS/wirel...3/GPL_1927.zip < enter >
tar zxf ./GPL_1927.zip < enter >
cp -R /opt/broadcom/opt/brcm /opt < enter >

==========
cd /var/tmp
wget http://oleg.wl500g.info/1.9.2.7-6b/w...2.7-6b.tar.bz2
tar xjf wl500g-1.9.2.7-6b.tar.bz2
cd wl500g-1.9.2.7-6b
make uClibc

but was low on memory (2GB pendrive)
and -j option didn't work.

Today
mipsel-uclibc-gcc

generates syntax error.

I need Linux dialog to test some shell scripts.

What's wrong, any help ?

Darius

FabWL500
04-08-2009, 19:08
I did many and many test looking at your guides and tutorial... I waste a lot of time but... the situation is that:

1) Compiling helloworld.c with mipsel-uclibc-gcc -o hello hello.c
I can obtain hello executable.
If I run hello on the router I get
"./hello: can't load library 'AP'"

2) If after compiling I write mipsel-uclibc-ld hello
I can obtain an a.out executable that works on the router.
If I rename the file a.out -> hello on my PC then I go back to error shown on point 1.
If I copy a.out to the router and then rename it as hello all works well!

3) Compiling helloworld.c with mipsel-uclibc-gcc -static -o hello hello.c
I can get hello executable but when I run it on the router I get segmentation fault...

Please help! I'm becoming mad!

dp79
13-09-2009, 20:42
Hi everyone,

I tried already native compilation, but I didn't succed, so I gave cross compiling a try. I've booted my laptop with ubuntu intrepid and I followed Jean-Fabrice's tutorial, but it doesn't seem to be complete. I noticed, that on oleg.wl500g.info Oleg posted a new toolchain (uClibc 0.9.19), so I installed it as well. What I have so far is the following:
1. The following extracted directories under /opt
hndtools-mipsel-linux
hndtools-mipsel-linux3
hndtools-mipsel-linux3
hndtools-mipsel-uClibc
hndtools-mipsel-uClibc
hndtools-mipsel-uClibc
hndtools-mipsel-uClibc (this one is created by the new toolchain)

2. The following extracted directories under /var/tmp
uClibc-0.9.19
wl50g-1.9.2.7.6b

I have a feeling that after the command "make uClibc" there are still things to do before we execute "mipsel-uclibc-gcc -o helloworld helloworld.c".
When I ran the command "make uClibc", I got these errors:

dp79@Perro:/var/tmp/wl500g-1.9.2.7-6b$ sudo make uClibc
tar xjf uClibc-0.9.19.tar.bz2 -C /var/tmp
Looking for last applied patch
./patch.sh: line 19: patch: command not found
./patch.sh: line 19: patch: command not found
./patch.sh: line 19: patch: command not found
./patch.sh: line 19: patch: command not found
./patch.sh: line 19: patch: command not found
Patching /var/tmp/uClibc-0.9.19 with uClibc-0.9.19-trunc64.patch uClibc-0.9.19-timezones.patch uClibc-0.9.19-dn_expand.patch uClibc-0.9.19-resolv.patch uClibc-0.9.19.diff
./patch.sh: line 33: patch: command not found
./patch.sh: line 37: patch: command not found
Can not apply uClibc-0.9.19.diff cleanly
make: *** [/var/tmp/uClibc] Error 1
This "make" command created the "uClibc-0.9.19" directory, but nothing has been installed, because the system doesn't recognize the "mipsel-uclibc-gcc" command.

Could somebody finish this tutorial and show us how to compile helloworld from the beginning to the end?

Thanks!

dp79

theMIROn
13-09-2009, 20:49
just take a look
http://code.google.com/p/wl500g/wiki/CompilingCustomFirmware?wl=en

dp79
13-09-2009, 21:06
Hi,

Waoh...Fast answer...

I've seen this site, but it is a tutorial for custom firmware and not a tutorial for installing software from source for the existing firmware...
Or you meant, that the process is the same, but instead of the firmware tarball, I use the tarball of the target software?

dp79

outlaw11
16-05-2011, 21:40
Yes

It would really help if there was some updated easy-to-understand how-to for cross-compiling own software.:o

All of the current how-to instructions seem to be outdated or not complete.