Yactfeau


sebt3

homebrew player (P. & C.)
Joined
Sep 9, 2008
Messages
4,885
Age
44
Location
France
Website
sebt3.openpandora.org
What is that ?

Well it's not realy a new toolchain, it is DjWillis' one with a few twists. Changes include :
  • all the libraries on the pandora from the (yet to be officially annonced) openpandora repos,
  • all the requiered *-config script with paths fixed,
  • Libtools config files path fixed too,
  • lua5.1.pc included,
  • a reworked environnement-setup file to be more conveniant
  • Installable anywhere
  • dependencies supported
  • Ivanovic's wrapper-scripts included
  • support qmake,Makfiles,autotools,cmake
In the end, that's a merge between my toolchain I'm using at home (based on the DjWillis' one) and Ivanovic works. This is a fresh start as my toolchain does have a lot's of hack in there, even many nasty one. But it should be as easy to use as mine.

How to update from previous installation ?
See this post.
How to install it ?
There is 2 way to install this :
1) On your own linux box (should be 32bits ready), here are the steps :
  1. Download the SDK file(torrent) (check the file size)
  2. extract it (you'll need either to be root, or have created the directory /usr/local/angstrom/arm and give read/write to the user extracting) :
    Code:
    tar -C /usr/local/angstrom/arm -xjf pandora-toolchain-20110313.tar.bz2
  3. Fix the file permission :
    Code:
    sudo chown -R <your-name>.<your-name> /usr/local/angstrom/arm
  4. Run the installer
    Code:
    /usr/local/angstrom/arm/scripts/installer.sh
  5. Reload your shell (so the bashrc modification are know to your shell)
2) Using the VirtualBox images : here (warning : get a look at the file size before clicking on the next download link), so every Windows/MacOS users (and the lazy ones) can use it
(the user in the image is devel and it's password is devel too)


Behaviour

To be easy to use (and to build), this have a few expectations :
  • You ca install it everywhere. You'll have to create it's directory first and don't forget to run the installer.
  • It expect that all your sources will be sub-folders of $HOME/Pandora, this is configurable though (see PROJECTS_BASEDIR)
  • It expect that you will install into a sub-directory of /mnt/utmp. Once again, that's configurable.
  • It expect that you wants your produced PND goes into $HOME/Pandora/PNDs. Once again, you can configure that in the environnement-setup file.

How to use it ?

Let's say, you want to build a lightweight version of audacious (mine does pack way more stuff).
Create your working directory for the project :
Code:
mkdir ~/Pandora/audacious
Setup your environnement :
Code:
setprj audacious
This will get you in your working directory, set everything requiered to build pandora binaries ; ready this environnement to use the libraries you'll include in the PND.
Download the minimal source code and extract them :
Code:
    wget http://distfiles.atheme.org/libmcs-0.7.2.tgz
    wget http://distfiles.atheme.org/libmowgli-0.7.1.tgz
    wget http://distfiles.atheme.org/audacious-2.4.3.tgz
    tar xf libmcs-0.7.2.tgz
    tar xf libmowgli-0.7.1.tgz
    tar xf audacious-2.4.3.tgz
Build and install libmowgli :
Code:
       cd libmowgli*
      pndconfigure
      make all install
      cd ..
Build and install libmcs :
Code:
      cd libmcs*
     pndconfigure
     make all install
     cd ..
Finally build and install audacious. This one have SSE2 (x86 optimisation) enabled by default, let's disable that :
Code:
      cd audacious*
      pndconfigure --disable-sse2
      make all install
Create a PXML file and a startup script :
Code:
       genpxml
Edit /mnt/utmp/audacious/PXML.xml file to make sure it is valid (sometimes the script does bad things. And as it guess the quatogories out of the .desktop file the developper have done, they are wrong sometime :( .
Make sure you have an icon for it at /mnt/utmp/audacious/icon.png

Finally build the PND :
Code:
        pndmakeauto
And upload $HOME/Pandora/PNDs/audacious.pnd that where you want ;)


But what if the project dont use the autotools (the configure script) ?

If it use Cmake, you're lucky : use pndcmake instead of pndconfigure

If it use qmake, you're lucky : use pndqmake instead of pndconfigure

If it use scons, until sourceforge websvn isnt up, you're out of luck : I cant show you how to do it. See here.

But it use simple Makefile :
Make sure of 2 things :
  1. the Makefile dont force CC and CXX value (and have a look at how it handle CFLAGS and LDFLAGS too)
  2. the Makefile use $(CC) to build c files and use $(CXX) to build cpp files (and link with the same compiler)
 
Last edited by a moderator:
sebt3,

Thanks for this! I already have DJWillis' toolchain working in VirtualBox thanks to your help. This implementation looks very slick. I'm going to setup a fresh Xubuntu VirtualBox and test it out. I like how you included the PXML/PND stuff. Very nice.
 
dgame said:
sebt3,

Thanks for this! I already have DJWillis' toolchain working in VirtualBox thanks to your help. This implementation looks very slick. I'm going to setup a fresh Xubuntu VirtualBox and test it out. I like how you included the PXML/PND stuff. Very nice.
Then, just grab the virtualBox image I linked :) (it was the main goal of that post) it's a standard ubuntu and not a xubuntu, but that works too ;)
 
Last edited by a moderator:
This sounds great mate! Now I will have no choice other than trying this out.
Cheers!
 
currently downloading the virtualbox image. sound really great and easy to use. thanks for you efforts!
 
a few missing bits in my initial post for those installing the toolchain on their own host :
1) to extract the toolchain, you'll need either to be root, or have created the directory /usr/local/angstrom and give read/write to the user extracting

2) opkg-target requiere libssl.so.0.9.8, there is chance you have a newer version (probably 1.0.0), then (as root) go to /usr/lib (or lib32 for the 64bits users with multilib support) and :
ln -s libssl.1.0.0 libssl.so.0.9.8

3) cc1 (the gcc C compiler backend) requiere libmpfr.so.1, there is chance you have a newer version (probably 4.0.0), then (as root) go to /usr/lib (or lib32 for the 64bits users with multilib support) and :
ln -s libmpfr.so.4.0.0 libmpfr.so.1

for the last 2 items, check your currently installed version before doing the symlinks

EDIT: fixed one symlink command as mcobit said me on IRC I was wrong.
And He also said that libmowgli should be build before libmcssorry for these errors


EDIT2: I also forgot to say that the users's password in VirtualBox is "devel"
Fixed first post about these

EDIT3: I also forgot to add the pnd_make script.Get it here. and copy it to /usr/local/angstrom/arm/bin/pnd_make
EDIT4: as b3w1 said me on irc, I forgot to add mksquashfs to tthe image, so :
sudo aptitude install squashfs-tools
 
similar projects

devel@devel-VirtualBox:~$ setprj tint2
devel@devel-VirtualBox:~/Pandora/tint2$ ls
tilda-0.9.6 tilda-0.9.6.tar.gz ytint2
devel@devel-VirtualBox:~/Pandora/tint2$

i made ytint2 project after i noticed the small bug
 
I want to learn how to handle all this cross compiling stuff.

had some projects like this error


one small example

...
checking for ncurses.h... yes
configure: creating ./config.status
config.status: creating Makefile
./config.status: line 1182: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin/gawk: cannot execute binary file
config.status: error: could not create Makefile
devel@devel-VirtualBox:~/Pandora/vifm/vifm-0.5$

and a cmake error with pndcmake


devel@devel-VirtualBox:~/Pandora/ytint2/tint2-0.11$ pndcmake
-- checking for modules 'x11;xcomposite;xdamage;xinerama;xrender;xrandr'
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin/pkg-config: 1: Syntax error: word unexpected (expecting ")")
-- package 'x11' not found
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin/pkg-config: 1: Syntax error: word unexpected (expecting ")")
-- package 'xcomposite' not found

...
 
Code:
./config.status: line 1182: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin/gawk: cannot execute binary file
This is because the script is trying to execute an ARM compiled binary because it happened to come across it in the PATH first.

Solutions:
1) Can you specify the path to gawk in the configure options? (unlikely I think)
2) All ARM binaries could be removed from /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin because you can never execute them on the host anyway.
Ivanovic has this in his toolchain script, maybe it's something worth copying?
Code:
	cecho "Removing ARM binaries from the host" $green
	# After installing all those lovely programs, remove all files that are
	# inside a "bin/" folder and belong to arm architecture.
	# Steps taken for this:
	# 1) find all files inside the installed sdk with "bin/" in their path
	# 2) call "file" on each file
	# 3) get all files that include ", ARM," in the output, those only run on 
	#    the target arch, not on the host system
	# 4) filter out things that are part of the codesourcery sdk, no idea what
	#    those files with ARM arch are included, but it might have a reason
	# 5) only use the filename of the output
	# 6) get rid of the offending files using rm via xargs
	find $PNDSDK -wholename "*/bin/*" -exec file '{}' ; | grep ", ARM," | grep -v "arm-none-linux-gnueabi" | cut -f1 -d ":" | xargs rm

Unfortunately I can't help you with the second problem as I'm not familiar at all with cmake.


In other news, this toolchain was the first one I successfully managed to compile FFmpeg and MPlayer. They both use bastardized build systems but I managed to get them both to compile with a minimum of environment variable wrestling.
 
Last edited by a moderator:
JJS said:
Code:
./config.status: line 1182: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/bin/gawk: cannot execute binary file
This is because the script is trying to execute an ARM compiled binary because it happened to come across it in the PATH first.
I'll update this toolchain in a few days for fixing a few bugs (like this one ; but I wont update the virtualBox image this month)
JJS said:
In other news, this toolchain was the first one I successfully managed to compile FFmpeg and MPlayer. They both use bastardized build systems but I managed to get them both to compile with a minimum of environment variable wrestling.
Yep, I fighted with this one enough to fix most problem for that in my toolchain ;)
 
Last edited by a moderator:
Thanks for the hint. Now I brought a few little projects up to PND. Others I compiled by editing the Makefiles. Cannot test, because waitng for pandora. Nice to see how current projects from Ivanovic and sebt3 complement one another.

On the other hand I am a bit uncertain with opkg system. cmake and configureoutputs are missing some general libs I thought they are installed. But this is not important at the moment.

More important I miss a new package of ncurses. ncursesw6 is completely missing in Angstrom repo. I compiled ncurses myself, but failed in tic.c
 
Running into some issues compiling PUAE with the toolchain. Running Ubuntu in a VM.

I've pulled the PUAE source via git (and I can compile and run native on Ubuntu box - it also compiles fine native on a Pandora if you add the libs via opkg). Run setprj PUAE.

PUAE is compiled through a shell script that calls another script that runs the autotools:

aclocal -I m4 \
&& automake --foreign --add-missing \
&& autoconf
..
cd src/tools
aclocal
autoconf

and then calls ./configure with some variables. I've added "--host=$TARGET_SYS --prefix=$PND_BASEDIR/$PRJ" to the configure to simulate pndconfigure.
Finally the script runs make clean and make.

The output is:

Code:
Making all in src
make[1]: Entering directory `/home/silver/Pandora/PUAE/src'
make -C tools genblitter
make[2]: Entering directory `/home/silver/Pandora/PUAE/src/tools'
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib -Wl,-rpath,/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib -L/mnt/utmp/PUAE/lib -L/mnt/utmp/PUAE/lib  genblitter.c   -o genblitter
genblitter.c:10:23: error: sysconfig.h: No such file or directory
genblitter.c:14:24: error: genblitter.h: No such file or directory
genblitter.c: In function ‘generate_include’:
genblitter.c:29: error: ‘blitops’ undeclared (first use in this function)
genblitter.c:29: error: (Each undeclared identifier is reported only once
genblitter.c:29: error: for each function it appears in.)
genblitter.c: In function ‘generate_func’:
genblitter.c:48: error: ‘blitops’ undeclared (first use in this function)
make[2]: *** [genblitter] Error 1
make[2]: Leaving directory `/home/silver/Pandora/PUAE/src/tools'
make[1]: *** [tools/genblitter] Error 2
make[1]: Leaving directory `/home/silver/Pandora/PUAE/src'
make: *** [all-recursive] Error 1

so it's not picking up the header files correctly.

Any ideas?

EDIT:

Confusingly, I've discovered if I start a new bash and run the linux build script (no cross compile) successfully, THEN run setprj PUAE, and then run the pandora build - it works, or at least starts compiling the main program and does not get stuck on the above problem.

Instead it crashes out compiling with error:

Code:
...
fsdb.c:346: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
mv -f .deps/fsdb.Tpo .deps/fsdb.Po
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.  -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -DCPUEMU_0 -DCPUEMU_11 -DCPUEMU_12 -DCPUEMU_20 -DCPUEMU_21 -DCPUEMU_31 -DMMU -DFPUEMU -DAMAX -DGAYLE -DNCR -DAGA -DAUTOCONFIG -DFILESYS -DSCSIEMU -DSCSIEMU_LINUX_IOCTL -DA2091 -DCDTV -DCD32 -DBSDSOCKET -DSUPPORT_THREADS -DUSE_SDL -DFDI2RAW -DDEBUGGER -DSAVESTATE -DENFORCER -DACTION_REPLAY -DXARCADE -DDRIVESOUND  -I../src/include -I../src -I../src -I..   -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -fomit-frame-pointer -ffast-math   -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes -DREGPARAM= -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant    -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -MT fsusage.o -MD -MP -MF .deps/fsusage.Tpo -c -o fsusage.o fsusage.c
fsusage.c:204: warning: function declaration isn’t a prototype
fsusage.c: In function ‘get_fs_usage’:
fsusage.c:373: warning: implicit declaration of function ‘CONVERT_BLOCKS’
fsusage.c:373: error: ‘fsd’ undeclared (first use in this function)
fsusage.c:373: error: (Each undeclared identifier is reported only once
fsusage.c:373: error: for each function it appears in.)
make[3]: *** [fsusage.o] Error 1
make[3]: Leaving directory `/home/silver/Pandora/PUAE/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/silver/Pandora/PUAE/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/silver/Pandora/PUAE/src'
make: *** [all-recursive] Error 1

I'll look into this error tomorrow (could be missing dependancy). I note the compile flags are being passed 3 times to the gcc command line - no harm, but not sure why



EDIT: Hmm, still not sorted this. Does not look like a missing dependancy, but unexpected results out of some of the Autotools checks - it checks for SVR2/3/4 etc.. so it knows to access the filesystem to pull filesystem usage information. The results are different from the pandora native tests, breaks when compiling based on the #defines.
 
Hi,

I uploaded a new version of the toolchain (but not the virtualBox image), changes include :
- Included the missing libraries in the toolchain, so no need to hack your system libraries anymore
- Added a few symlinks to help building projects that dont use pkg-config
- Removed the useless ARM binaries
- Added the pnd_make script

Download here. (first post updated too)
 
When running pndconfigure, I get the following error:

Code:
checking whether the C compiler works... no
configure: error: in `/home/dallis/Pandora/Soundconverter/soundconverter-1.5.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

I'm a newbie so I don't quite know how to solve a problem like this. I tried configuring with '--host=arm-angstrom-linux-gnueabi-gcc', but the same thing happened.

Not sure what to do here... :unsure:
 
OilySalmon said:
Code:
See `config.log' for more details
Your answer is here. You'll have a line speaking about cc1. Give it to me, I'll tell you what to do ;)
 
Last edited by a moderator:
sebt3 said:
OilySalmon said:
Code:
See `config.log' for more details
Your answer is here. You'll have a line speaking about cc1. Give it to me, I'll tell you what to do ;)

configure:3103: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib -Wl,-rpath,/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib -L/mnt/utmp/Soundconverter/lib conftest.c >&5
/usr/local/angstrom/arm/libexec/gcc/arm-angstrom-linux-gnueabi/4.3.3/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory
configure:3107: $? = 1configure:3103: /usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib -Wl,-rpath,/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib -L/mnt/utmp/Soundconverter/lib conftest.c >&5
/usr/local/angstrom/arm/libexec/gcc/arm-angstrom-linux-gnueabi/4.3.3/cc1: error while loading shared libraries: libgmp.so.3: cannot open shared object file: No such file or directory

It claims to be missing a library, but it's there, and so is the libgmp-dev package. I'm going look further into this, but I don't really have a first inclination of what to do here.
 
Last edited by a moderator:
What is your distribution ?
OilySalmon said:
It claims to be missing a library, but it's there, and so is the libgmp-dev package. I'm going look further into this, but I don't really have a first inclination of what to do here.
Indeed, /usr/lib/libgmp.so.3 dont exist on your system.
The simplest way to cheat that is t create a symlink to your existant library on your system.
Here is what I do have on my system :
Code:
seb@seb:/usr/lib$ ls -latr libgmp*
-rw-r--r-- 1 root root 383648  9 jan  2010 libgmp.so.3.5.2
lrwxrwxrwx 1 root root     15  4 jui  2010 libgmp.so.3 -> libgmp.so.3.5.2
To create the libgmp.so.3 on my system I would (as root, in that directory) :
Code:
ln -s libgmp.so.3.5.2 libgmp.so.3

Alternativly, you can grab that and extrct it to /usr/local/angstrom/arm/lib. (that will be in futur release).
 
Last edited by a moderator:
Ah! That was the problem! It doesn't seem to have been included, and opkg-target would obviously only check the target system rather than the tools actually being used. Thanks! I think that's why I was so confused. There are so many lib folders in here. :p

EDIT: Hmm... it seems like pndconfigure is set to check /tmp/utmp/* for dependencies, but from some reason it doesn't seem to be doing that. I've satisfied a dependency in the program I want to port, but instead of showing that the dependency is satisfied, I get a missing file error. The dependency I'm talking about is gettext. I'm not sure if that helps you. Maybe I'm not installing it correctly? It installs to the correct directory it seems, and I'm following your directions. The strangest part of this is that it's installed in the toolchain as well as /mnt/utmp/*. So is the dev package.
 
silver said:
Code:
...
fsdb.c:346: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
mv -f .deps/fsdb.Tpo .deps/fsdb.Po
/usr/local/angstrom/arm/bin/arm-angstrom-linux-gnueabi-gcc -DHAVE_CONFIG_H -I.  -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -DCPUEMU_0 -DCPUEMU_11 -DCPUEMU_12 -DCPUEMU_20 -DCPUEMU_21 -DCPUEMU_31 -DMMU -DFPUEMU -DAMAX -DGAYLE -DNCR -DAGA -DAUTOCONFIG -DFILESYS -DSCSIEMU -DSCSIEMU_LINUX_IOCTL -DA2091 -DCDTV -DCD32 -DBSDSOCKET -DSUPPORT_THREADS -DUSE_SDL -DFDI2RAW -DDEBUGGER -DSAVESTATE -DENFORCER -DACTION_REPLAY -DXARCADE -DDRIVESOUND  -I../src/include -I../src -I../src -I..   -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -fomit-frame-pointer -ffast-math   -Wall -Wno-unused -Wno-format -W -Wmissing-prototypes -Wstrict-prototypes -DREGPARAM= -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant    -DPANDORA -O3 -pipe -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant -MT fsusage.o -MD -MP -MF .deps/fsusage.Tpo -c -o fsusage.o fsusage.c
fsusage.c:204: warning: function declaration isn’t a prototype
fsusage.c: In function ‘get_fs_usage’:
fsusage.c:373: warning: implicit declaration of function ‘CONVERT_BLOCKS’
fsusage.c:373: error: ‘fsd’ undeclared (first use in this function)
fsusage.c:373: error: (Each undeclared identifier is reported only once
fsusage.c:373: error: for each function it appears in.)
make[3]: *** [fsusage.o] Error 1
make[3]: Leaving directory `/home/silver/Pandora/PUAE/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/silver/Pandora/PUAE/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/silver/Pandora/PUAE/src'
make: *** [all-recursive] Error 1

...

EDIT: Hmm, still not sorted this. Does not look like a missing dependancy, but unexpected results out of some of the Autotools checks - it checks for SVR2/3/4 etc.. so it knows to access the filesystem to pull filesystem usage information. The results are different from the pandora native tests, breaks when compiling based on the #defines.

For the record, I've sorted this and got a successful cross-compilation by hacking up the sysconfig.h file to match various defines autodetected on the Pandora - might cause other problems, we shall see.
 
Last edited by a moderator:
Back
Top