Jump to content


Photo

Yactfeau


  • Please log in to reply
113 replies to this topic

#1 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 01 February 2011 - 03:55 PM

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 :
  • Download the SDK file(torrent) (check the file size)
  • 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) :
    tar -C /usr/local/angstrom/arm -xjf pandora-toolchain-20110313.tar.bz2
  • Fix the file permission :
    sudo chown -R <your-name>.<your-name> /usr/local/angstrom/arm
  • Run the installer
    /usr/local/angstrom/arm/scripts/installer.sh
  • 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 :
mkdir ~/Pandora/audacious
Setup your environnement :
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 :
    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 :
       cd libmowgli*
      pndconfigure
      make all install
      cd ..
Build and install libmcs :
      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 :
cd audacious*
      pndconfigure --disable-sse2
      make all install
Create a PXML file and a startup script :
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 :
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 :
  • the Makefile dont force CC and CXX value (and have a look at how it handle CFLAGS and LDFLAGS too)
  • the Makefile use $(CC) to build c files and use $(CXX) to build cpp files (and link with the same compiler)

Edited by sebt3, 26 September 2011 - 03:52 PM.


#2 dgame

dgame

    GP Mania

  • GP32 Hardcore
  • PipPipPipPipPip
  • 350 posts

Posted 01 February 2011 - 05:06 PM

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.

#3 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 01 February 2011 - 05:21 PM

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 ;)

#4 mcobit

mcobit

    Mega GP Mania

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 841 posts

Posted 01 February 2011 - 05:24 PM

This sounds great mate! Now I will have no choice other than trying this out.
Cheers!

#5 Michoko

Michoko

    GP32 Hardcore

  • Member
  • PipPipPipPip
  • 147 posts
  • Gender:Male
  • Location:France

Posted 01 February 2011 - 06:44 PM

Nice! Thanks for the VirtualBox image, it will allow me to test it quickly!

#6 crow_riot

crow_riot

    Mega GP Mania

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1133 posts
  • Gender:Male
  • Location:.at
  • Interests:music & programming

Posted 01 February 2011 - 07:29 PM

currently downloading the virtualbox image. sound really great and easy to use. thanks for you efforts!

#7 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 01 February 2011 - 08:04 PM

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

Edited by sebt3, 02 February 2011 - 01:52 AM.


#8 b3w

b3w

    Member

  • Member
  • PipPip
  • 9 posts

Posted 02 February 2011 - 06:24 PM

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

#9 b3w

b3w

    Member

  • Member
  • PipPip
  • 9 posts

Posted 02 February 2011 - 10:38 PM

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

...



#10 JJS

JJS

    Member

  • Member
  • PipPip
  • 11 posts

Posted 02 February 2011 - 10:52 PM

./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?
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.

#11 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 03 February 2011 - 12:38 AM

./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)

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 ;)

#12 b3w

b3w

    Member

  • Member
  • PipPip
  • 9 posts

Posted 03 February 2011 - 07:52 PM

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

#13 silver

silver

    GP32 Hardcore

  • Member
  • PipPipPipPip
  • 149 posts

Posted 04 February 2011 - 01:12 AM

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:

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:

...
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.

Edited by silver, 08 February 2011 - 10:20 AM.


#14 sebt3

sebt3

    homebrew player (P. & C.)

  • GP32 Hardcore
  • PipPipPipPipPipPip
  • 1897 posts
  • Gender:Male
  • Location:QC

Posted 06 February 2011 - 02:22 PM

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)

#15 OilySalmon

OilySalmon

    GP32 User

  • Member
  • PipPipPip
  • 45 posts

Posted 06 February 2011 - 11:50 PM

When running pndconfigure, I get the following error:

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: