GP2X Gph-sdk : Try Compiling Ppp


bino

Still Fresh
Joined
Jun 2, 2007
Messages
13
Dear All

this is my first try on compiling with GPH SDK

1. Gph SDK is installed in /gp2xsdk/Tool
2. Porting test with PPP source

First , env set

CODE

export GP2XDEV="/gp2xsdk/Tools"
export PATH="$PATH:$GP2XDEV/bin"

export CC='arm-gp2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib'

export CXX='arm-gp2x-linux-g++ -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib -rpath,/gp2xsdk/Tools/lib'

export CFLAGS='-O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2'

export LDFLAGS='-L/gp2xsdk/Tools/lib'
export LD_LIBRARY_PATH='/gp2xsdk/Tools/lib'
export PKG_CONFIG_PATH='/gp2xsdk/Tools/lib/pkgconfig'



and
CODE

[root@kannel /]# cd /home/bino/ppp-2.4.4
[root@kannel ppp-2.4.4]#
[root@kannel ppp-2.4.4]# ./configure --prefix=/gp2xsdk/Tools/ --build=`uname -m` --host=gp2x --enable-static --enable-shared

Configuring for Linux
Creating Makefiles.
Makefile <= linux/Makefile.top
pppd/Makefile <= pppd/Makefile.linux
pppstats/Makefile <= pppstats/Makefile.linux
chat/Makefile <= chat/Makefile.linux
pppdump/Makefile <= pppdump/Makefile.linux
pppd/plugins/Makefile <= pppd/plugins/Makefile.linux
pppd/plugins/rp-pppoe/Makefile <= pppd/plugins/rp-pppoe/Makefile.linux
pppd/plugins/radius/Makefile <= pppd/plugins/radius/Makefile.linux
pppd/plugins/pppoatm/Makefile <= pppd/plugins/pppoatm/Makefile.linux
[root@kannel ppp-2.4.4]#make



the "make" part.
there is a problem when it start to compile the pppd
Starting from :
CODE

arm-gp2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib -O2 -pipe -Wall -g -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -I../include '-DDESTDIR="/gp2xsdk/Tools/"' -DCHAPMS=1 -DMPPE=1 -DHAS_SHADOW -DHAVE_CRYPT_H=1 -DUSE_CRYPT=1 -DHAVE_MULTILINK -DUSE_TDB=1 -DPLUGIN -DMAXOCTETS -c -o sys-linux.o sys-linux.c
In file included from /gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/route.h:28,
from sys-linux.c:109:
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:30: error: syntax error before "atomic_t"

<snip > ...


/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/route.h:169: error: `oif' undeclared (first use in this function)
In file included from sys-linux.c:124:
pppd.h: At top level:
pppd.h:513: error: 'info' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:66: error: previous declaration of 'info' was here
pppd.h:516: error: 'error' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:52: error: previous declaration of 'error' was here
pppd.h:605: error: 'output' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:58: error: previous declaration of 'output' was here
make[1]: *** [sys-linux.o] Error 1
make[1]: Leaving directory `/home/bino/ppp-2.4.4/pppd'
make: *** [all] Error 2
[root@kannel ppp-2.4.4]#



Note : It's look fine when it compile for another part of PPP, i.e : chat, pppstats , pppdump. At least , no warning or error messages generated.


I tried to compile this ppp source for "plain" linux (not GP2X specific) , and it run well

any recomendation please ..

Sincerely
-bino-
 
bino said:
Dear All

this is my first try on compiling with GPH SDK

1. Gph SDK is installed in /gp2xsdk/Tool
2. Porting test with PPP source

First , env set

CODE

export GP2XDEV="/gp2xsdk/Tools"
export PATH="$PATH:$GP2XDEV/bin"

export CC='arm-gp2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib'

export CXX='arm-gp2x-linux-g++ -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib -rpath,/gp2xsdk/Tools/lib'

export CFLAGS='-O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2'

export LDFLAGS='-L/gp2xsdk/Tools/lib'
export LD_LIBRARY_PATH='/gp2xsdk/Tools/lib'
export PKG_CONFIG_PATH='/gp2xsdk/Tools/lib/pkgconfig'
and
CODE

[root@kannel /]# cd /home/bino/ppp-2.4.4
[root@kannel ppp-2.4.4]#
[root@kannel ppp-2.4.4]# ./configure --prefix=/gp2xsdk/Tools/ --build=`uname -m` --host=gp2x --enable-static --enable-shared

Configuring for Linux
Creating Makefiles.
Makefile <= linux/Makefile.top
pppd/Makefile <= pppd/Makefile.linux
pppstats/Makefile <= pppstats/Makefile.linux
chat/Makefile <= chat/Makefile.linux
pppdump/Makefile <= pppdump/Makefile.linux
pppd/plugins/Makefile <= pppd/plugins/Makefile.linux
pppd/plugins/rp-pppoe/Makefile <= pppd/plugins/rp-pppoe/Makefile.linux
pppd/plugins/radius/Makefile <= pppd/plugins/radius/Makefile.linux
pppd/plugins/pppoatm/Makefile <= pppd/plugins/pppoatm/Makefile.linux
[root@kannel ppp-2.4.4]#make



the "make" part.
there is a problem when it start to compile the pppd
Starting from :
CODE

arm-gp2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib -O2 -pipe -Wall -g -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -I../include '-DDESTDIR="/gp2xsdk/Tools/"' -DCHAPMS=1 -DMPPE=1 -DHAS_SHADOW -DHAVE_CRYPT_H=1 -DUSE_CRYPT=1 -DHAVE_MULTILINK -DUSE_TDB=1 -DPLUGIN -DMAXOCTETS -c -o sys-linux.o sys-linux.c
In file included from /gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/route.h:28,
from sys-linux.c:109:
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:30: error: syntax error before "atomic_t"

<snip > ...


/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/route.h:169: error: `oif' undeclared (first use in this function)
In file included from sys-linux.c:124:
pppd.h: At top level:
pppd.h:513: error: 'info' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:66: error: previous declaration of 'info' was here
pppd.h:516: error: 'error' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:52: error: previous declaration of 'error' was here
pppd.h:605: error: 'output' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:58: error: previous declaration of 'output' was here
make[1]: *** [sys-linux.o] Error 1
make[1]: Leaving directory `/home/bino/ppp-2.4.4/pppd'
make: *** [all] Error 2
[root@kannel ppp-2.4.4]#



Note : It's look fine when it compile for another part of PPP, i.e : chat, pppstats , pppdump. At least , no warning or error messages generated.


I tried to compile this ppp source for "plain" linux (not GP2X specific) , and it run well

any recomendation please ..

Sincerely
-bino-


You use linux OS, I suggess you to use OPEN2X toolchain and his OPEN2X libpack, to start with the best gp2x dev tools available ;)
http://www.open2x.org
 
Last edited by a moderator:
JyCet said:
You use linux OS, I suggess you to use OPEN2X toolchain and his OPEN2X libpack, to start with the best gp2x dev tools available ;)
http://www.open2x.org



Actualy, I just subscribe to their list yesterday ...
I think i need to get more info about open2x first before i jump into it.

They use newer kernel ... means that I'll need to totaly flash my GP2X with their firmware.
And also ... STERM note that it didn't compatible with open2x.

In other hand, Open2X looks quite attractive to me ... since it maintained by community.

Ok ... see you there

-bino-
 
Last edited by a moderator:
Open2x has at least two independent projects: a new firmware (kernel and commands) and an updated toolchain (compiler and libraries). In this case, you need the Open2x toolchain in order to get an updated collection of tools for developers, but you do not have to install anything new on your Gp2x. Just exchange the GPH SDK for the Open2x toolchain in your desktop computer.
 
Hi Juan,

juanvvc said:
Open2x has at least two independent projects: a new firmware (kernel and commands) and an updated toolchain (compiler and libraries). In this case, you need the Open2x toolchain in order to get an updated collection of tools for developers, but you do not have to install anything new on your Gp2x. Just exchange the GPH SDK for the Open2x toolchain in your desktop computer.
I've no cross-compile experience befor, and I'm affraid DJ-Willis will put me on his "Tire Kicker" list :)

Ok , I download and Install the App-toolchain.
Is there any example/docs on how to use it ?
On the open2X website, it only tell me about pointing the CPP to Open2X compler. But how about theother FLAGS and option ?

THe APP-Toolchain looks like didn't include the kernel header, while my first purpose is to compile PPP that will need kernel headers. How to work with it ?

Open2X website stated that the kernel toolchain used different GCC version from the APP-Toolchain. Why they do it ?

Also ... seem like that Open2X choose to maximize the use of SD storage, while I want all my application stored at NAND area. Currently (by default of firmware 2.1.2) there is around 30 MB data at /tmp/mnt/nand, when I got enough knowledge on how to add/delete files permanently to/from it .. I'll consider to put semi-full RUBY interpreter on it. I also pretty sure that it'll enough for my small ruby-script and a couples of BASH script.


enlightment please ....
Sincerely
-bino-
 
Last edited by a moderator:
bino said:
Ok , I download and Install the App-toolchain.
Is there any example/docs on how to use it ?

On the open2X website, it only tell me about pointing the CPP to Open2X compler. But how about theother FLAGS and option ?

THe APP-Toolchain looks like didn't include the kernel header, while my first purpose is to compile PPP that will need kernel headers. How to work with it ?
Hey, the toolchain includes GCC 4.1.1 (arm-open2x-linux-gcc) so use the standard headers, flags, examples and docs :)
 
Last edited by a moderator:
Hi.
juanvvc said:
Hey, the toolchain includes GCC 4.1.1 (arm-open2x-linux-gcc) so use the standard headers, flags, examples and docs :)
I'm lost.

CODE

[root@kannel pppd]# make
arm-open2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -O2 -pipe -Wall -g -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -I../include '-DDESTDIR="/usr/local"' -DCHAPMS=1 -DMPPE=1 -DHAS_SHADOW -DHAVE_CRYPT_H=1 -DUSE_CRYPT=1 -DHAVE_MULTILINK -DUSE_TDB=1 -DPLUGIN -DMAXOCTETS -c -o main.o main.c
arm-open2x-linux-gcc: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by arm-open2x-linux-gcc)
make: *** [main.o] Error 1
[root@kannel pppd]# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
[root@kannel pppd]#





Is there any example on cross-compiling (using open2x) existing common linux App and modules using "./configure" and "make" commands and flags ?


Sincerely
-bino-
 
Last edited by a moderator:
Did you have tested your toochain with a simple "hello world" ?
Did you use makefile ? If yes could you post it here ?
 
bino said:
arm-open2x-linux-gcc: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by arm-open2x-linux-gcc)
From wiki.open2x.org:
QUOTE

Warning: These toolchains need gLibC 2.4 on the host PC (i.e. your desktop), will be updated to fix this soon
 
Last edited by a moderator:
bino said:
THe APP-Toolchain looks like didn't include the kernel header, while my first purpose is to compile PPP that will need kernel headers. How to work with it ?
If you want to compile a module for standard firmware, you must use gcc 2.9.5, because standard firmware kernel was compiled with it. See http://wiki.gp2x.org/wiki/Building_Firmware_2.0.0_modules
If you want to compile for open2x kernel, you should use their "GCC 3.4.4/gLibC 2.3.6 Open2x Kernel Toolchain", not "GCC 4.1.1/gLibC 2.3.6 Open2x Applications Toolchain", which is only for applications, as the name implies.

bino said:
Open2X website stated that the kernel toolchain used different GCC version from the APP-Toolchain. Why they do it ?
Because old 2.4.x kernels do not compile with gcc 4.
 
Last edited by a moderator:
bino said:
Dear All

this is my first try on compiling with GPH SDK

1. Gph SDK is installed in /gp2xsdk/Tool
2. Porting test with PPP source

First , env set

CODE

export GP2XDEV="/gp2xsdk/Tools"
export PATH="$PATH:$GP2XDEV/bin"

export CC='arm-gp2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib'

export CXX='arm-gp2x-linux-g++ -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib -rpath,/gp2xsdk/Tools/lib'

export CFLAGS='-O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2'

export LDFLAGS='-L/gp2xsdk/Tools/lib'
export LD_LIBRARY_PATH='/gp2xsdk/Tools/lib'
export PKG_CONFIG_PATH='/gp2xsdk/Tools/lib/pkgconfig'
and
CODE

[root@kannel /]# cd /home/bino/ppp-2.4.4
[root@kannel ppp-2.4.4]#
[root@kannel ppp-2.4.4]# ./configure --prefix=/gp2xsdk/Tools/ --build=`uname -m` --host=gp2x --enable-static --enable-shared

Configuring for Linux
Creating Makefiles.
Makefile <= linux/Makefile.top
pppd/Makefile <= pppd/Makefile.linux
pppstats/Makefile <= pppstats/Makefile.linux
chat/Makefile <= chat/Makefile.linux
pppdump/Makefile <= pppdump/Makefile.linux
pppd/plugins/Makefile <= pppd/plugins/Makefile.linux
pppd/plugins/rp-pppoe/Makefile <= pppd/plugins/rp-pppoe/Makefile.linux
pppd/plugins/radius/Makefile <= pppd/plugins/radius/Makefile.linux
pppd/plugins/pppoatm/Makefile <= pppd/plugins/pppoatm/Makefile.linux
[root@kannel ppp-2.4.4]#make



the "make" part.
there is a problem when it start to compile the pppd
Starting from :
CODE

arm-gp2x-linux-gcc -O3 -ffast-math -fomit-frame-pointer -mcpu=arm920t -I/gp2xsdk/Tools/include -I/gp2xsdk/Tools/include/libxml2 -L/gp2xsdk/Tools/lib -O2 -pipe -Wall -g -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -I../include '-DDESTDIR="/gp2xsdk/Tools/"' -DCHAPMS=1 -DMPPE=1 -DHAS_SHADOW -DHAVE_CRYPT_H=1 -DUSE_CRYPT=1 -DHAVE_MULTILINK -DUSE_TDB=1 -DPLUGIN -DMAXOCTETS -c -o sys-linux.o sys-linux.c
In file included from /gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/route.h:28,
from sys-linux.c:109:
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:30: error: syntax error before "atomic_t"

<snip > ...


/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/route.h:169: error: `oif' undeclared (first use in this function)
In file included from sys-linux.c:124:
pppd.h: At top level:
pppd.h:513: error: 'info' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:66: error: previous declaration of 'info' was here
pppd.h:516: error: 'error' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:52: error: previous declaration of 'error' was here
pppd.h:605: error: 'output' redeclared as different kind of symbol
/gp2xsdk/Tools/lib/gcc/arm-gp2x-linux/3.4.6/../../../../arm-gp2x-linux/sys-include/net/dst.h:58: error: previous declaration of 'output' was here
make[1]: *** [sys-linux.o] Error 1
make[1]: Leaving directory `/home/bino/ppp-2.4.4/pppd'
make: *** [all] Error 2
[root@kannel ppp-2.4.4]#



Note : It's look fine when it compile for another part of PPP, i.e : chat, pppstats , pppdump. At least , no warning or error messages generated.


I tried to compile this ppp source for "plain" linux (not GP2X specific) , and it run well

any recomendation please ..

Sincerely
-bino-



Hey, I am very interested in getting PPP compiled for the gp2x. Did you have any luck with it? I really want to get Dial-up Networking working through my phone and bluetooth. I can make the necessary bluetooth connections but an missing ppp. Does anyone know of a way to do this?

Thanks and sorry if this was the wrong place to post this.

Christien
 
Last edited by a moderator:
Back
Top