ivanovic
Active Member
- Joined
- Aug 4, 2006
- Messages
- 784
New version available!
A new version of the stuff mentioned below (including changed/updated instructions) is available. Please go to this post for the latest version of this crosscompiler toolchain installer! In case that your browser is broken, the correct post has number 11!
Hi everybody!
Todays post is about yet another try on getting a nicely working toolchain setup that allows crosscompilation of pandora binaries on x86 based Linux systems. Here a short summary what this is meant to be (and later on what it is *not* meant to be!):
The following part is outdated, please use this post further on for the correct information!!!
Pre start dependencies:
Some notes regarding the scripts:
Now to the most important part, the sdk itself:
Please run the scripts in the order as I list them here. The "topics" are directly the links to the respective scripts.
After step '4' is completed you should have a working SDK installed. So far I tested this SDK on a single box (Gentoo amd64 "unstable"). I was able to compile Wesnoth with it (using cmake) as well as snes9x4p (building via a plain Makefile). Both binaries are working on the pandora, so it looks like a good basis to have others test, too.
The scripts are known to not be perfect and like I mentioned above could even damage your normal system if run as root (should not happen, but who knows...). I plan to further simplify things and shrink the number of scripts used as well as adding some messages when things are not installed on the host system that are required.
Please test this sdk and provide feedback what is working for you and what not. In case you are interested in building Wesnoth, this is the PandoraToolchain.cmake file used, the cmake invocation is the last line in the file.
EDIT1: Changed the file for step '3' to remove all broken symlinks inside the sdk and also remove all binary files for ARM architecture that can't be run on the host arch anyway.
EDIT2: New version available: openpandora_toolchain.sh 2011-01-30
EDIT3:
The first post is outdated, please use this post further on for the correct information!!! Yes, the correct post ist post 11 in this thread.
A new version of the stuff mentioned below (including changed/updated instructions) is available. Please go to this post for the latest version of this crosscompiler toolchain installer! In case that your browser is broken, the correct post has number 11!
Hi everybody!
Todays post is about yet another try on getting a nicely working toolchain setup that allows crosscompilation of pandora binaries on x86 based Linux systems. Here a short summary what this is meant to be (and later on what it is *not* meant to be!):
- Rather easy to setup toolchain that allows compiling binaries for the pandora on a linux host.
- Should support x86 as well as amd64 with multilib support.
- Installable inside a users $HOME without root priviledges.
- Completely based upon the packages that are also used on the pandora. It should use exactly the versions as shipped with the pandora and just those.
- Includes all libs and headers that are also found on the pandora (even some useless progs) but only a small number of binaries that can't be run on the host architecture.
- Should be rather easy to keep in sync with upsteam (aka openpandora.org) version changes.
- An sdk that is able to build the official firmware image. For those you still need an OpenEmbedded based setup so that you can make use of the recipes directly.
- It likely won't work on "pure" 64bit systems because the toolchain, things are based on (codesourcery), is plain x86.
- It will not automatically get all the dependencies that you need to make things work for your distribution. You will have to make your system able to compile things (for itself) before you can start with this toolchain.
- Some things like eg the gettext tools (for generation of translations used in the programs you compile with your toolchain) will have to be provided by your system. Stuff like msgfmt is *not* included!
- This sdk is not meant to be installed systemwide with root priviledges. In my early tests I could have destroyed my whole system if I were using root privs. Those problems have likely be fixed, but better save than sorry, so: don't install with root privs (either logged in as root or using su -c or sudo)!!!
The following part is outdated, please use this post further on for the correct information!!!
- wget
- bash
- sed
- md5sum
- working compile env for host system
Code:
sudo apt-get install libtool git-core build-essential autoconf automake -y
- Make sure to change the variable PNDSDK_DIR in each script to match your system. It has to be exactly the same entry in each of the scripts! Make sure that your current user has permissions to write into this folder.
- After installation the SDK itself requires about 2.0GB on your harddrive. During installation about 640MB are downloaded into a tmp/ folder created where you call the scripts from.
- After installation is done and everything works you can remove the following files/folders:
- all installation scripts (you should consider keeping the "last" script used for fixing the libs since you'll need it when running some updates!)
- the folder "opkg-0.1.8/" (files created during building opkg for your host platform)
- the folder "pkg-config-0.25/" (files created during building a pandora specific pkg-config for your host platform)
- the folder "tmp/" (all downloaded files should have been stored here)
- the file "packages.txt" (the list of packages that we have opkg install, it will get more packages since it also fetches the dependencies, but those are the
- For the moment the files are hosted at a pastebin site. After downloading them there (clicking on "download" will get the job done) you should run "dos2unix" on the files to make sure that they work nicely for you.
Now to the most important part, the sdk itself:
Please run the scripts in the order as I list them here. The "topics" are directly the links to the respective scripts.
- toolchain.sh
This will download and install the codesourcery toolchain. The current scripts rely on the version arm-2009q3-67 since I know it does work and a short test with arm-2010.09-50 resulted in me swearing because it was not working "right from the start". So better stay with this outdated version since it is working... - install_opkg.sh
Get and install opkg for your host system. This is the package manager that we later on rely on to get the packages from openpandora.org. This script does also provide default config files that rely on the official package feeds. - install_libs.sh
Get a list of all the lovely dev packages that are available in the openpandora.org feeds and install all those packages (as well as the -static packages) including their dependencies. This is the major step and will take "a while". It will also install a whole lot of useless things for the sdk itself (many ARM binaries), but this is some collateral damage that I know no way around for the moment. This this step you will see many error messages about missing dependencies. Those are irrelevant and you can just ignore them. The last line should read "Removing package libstdc++-dev from root...". If that is the case, everything is (probably) fine! - fix_libs.sh
Install a pkg-config for the crosscompiler we just setup. Also fix all the paths inside the .pc files as well as "many" libraries. This step is *vital* for a working sdk and has to be repeated whenever new packages are installed/updated using opkg.
After step '4' is completed you should have a working SDK installed. So far I tested this SDK on a single box (Gentoo amd64 "unstable"). I was able to compile Wesnoth with it (using cmake) as well as snes9x4p (building via a plain Makefile). Both binaries are working on the pandora, so it looks like a good basis to have others test, too.
The scripts are known to not be perfect and like I mentioned above could even damage your normal system if run as root (should not happen, but who knows...). I plan to further simplify things and shrink the number of scripts used as well as adding some messages when things are not installed on the host system that are required.
Please test this sdk and provide feedback what is working for you and what not. In case you are interested in building Wesnoth, this is the PandoraToolchain.cmake file used, the cmake invocation is the last line in the file.
EDIT1: Changed the file for step '3' to remove all broken symlinks inside the sdk and also remove all binary files for ARM architecture that can't be run on the host arch anyway.
EDIT2: New version available: openpandora_toolchain.sh 2011-01-30
The first post is outdated, please use this post further on for the correct information!!! Yes, the correct post ist post 11 in this thread.
Last edited by a moderator: