+++ Marc-André Moreau [2011-06-23 17:40 -0400]:
[I wrote a response to this for 4hrs last night then my mail server crashed and lost it all - <mutter>. trying agin...]
Hi,
I am Marc-Andre from the FreeRDP project, an open source RDP client. I want to work on optimizing FreeRDP for ARM using the NEON processor extensions.
Welome
It is my first time cross-compiling, so thank you for your understanding.
Welcome to the joyful world of cross-building :-)
I have asked some questions on IRC, and read various pages from the wiki, but I haven't managed to successfully cross-compile FreeRDP yet. Compiling directly on the pandaboard works, but it is atrociously slow. I have made a chroot environment following and adapting the instructions from the following wiki page: https://wiki.linaro.org/Platform/DevPlatform/CrossCompile/UsingXdeb
Nothing wrong with this method, and it is reliable, but I find it quicker and easier to use multistrap and do: multistrap -f
I have tried both xdeb and xapt, both causing problems.
xapt:
I managed to fetch and convert packages with xapt, using the following command: sudo xapt -a armel -k -b --suite natty --mirror http://ports.ubuntu.com/ libssl-dev libx11-dev libxv-dev libxkbfile-dev libxcursor-dev libasound2-dev libxcb1 libxcb1-dev libdirectfb-dev libc6 libc6-dev zlib1g zlib1g-dev
The problem is then that xapt will fail to install the converted packages, saying the package architecture is different from the current architecture, as well as missing dependencies. I worked around the problem with this ugly hack:
cd /var/lib/xapt/output/ sudo dpkg -i --force-all *.deb
You are suffering from this problem: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=629595 which is because we are in the middle of a transition to multiarch packages. When xapt/dpkg-cross were written it was assumed that thay would simply ignore multiarched packages. However in practice it turns out that that's not the case and currently they need to be converted back to old-style locations. that needs the -m option supplying to xapt. The version in natty is too old to have option.
So if you do sudo xapt -a armel -b libssl-dev libx11-dev libxv-dev \ libxkbfile-dev libxcursor-dev libasound2-dev libxcb1 libxcb1-dev \ libdirectfb-dev libc6 libc6-dev zlib1g zlib1g-dev libcups2-dev
on a wheezy box/chroot then all that stuff get downloaded, converted and installed correctly.
Following this, I could get the FreeRDP configure script to work, even though it would fail to detect X11 properly:
PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig ./configure --host= arm-linux-gnueabi --with-neon
X11 is detected OK for me: FreeRDP configure result:
Cryptography : openssl TLS : enabled Sound : yes Printer : no CUnit : no X11 : yes DirectFB : no
When trying to build after that, it will still fail to link in the end, complaining about missing libraries such as zlib, X11, crypto, etc. I tried installing various packages more with xapt, but I couldn't get it to work.
If I do PKG_CONFIG_LIBDIR=/usr/arm-linux-gnueabi/lib/pkgconfig dpkg-buildpackage -aarmel
then it all builds OK (on wheezy), except that the printer support is not found. The confiure script needs checking to find out why that's failing. That path-setting shouldn't be neeed either but it's not working without it, even with the cross-version of pkg-config installed. Again, needs further investigation.
You can work round the cups non-identificatin with HAVE_CUPS=1 PKG_CONFIG_LIBDIR=/usr/arm-linux-gnueabi/lib/pkgconfig dpkg-buildpackage -aarmel
To get this working on natty you would need to get the current xapt, an ubuntu port of which is available here:
http://wookware.org/software/repo/ natty main or just here: http://wookware.org/software/repo/pool/main/e/emdebian-crush/xapt_2.2.16ubun...
however there is then a link failure, when it tries to link the wrong arch of libpthread.so: /usr/lib/gcc/arm-linux-gnueabi/4.5.2/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libpthread.so when searching for -lpthread /usr/lib/x86_64-linux-gnu/libpthread.a: could not read symbols: File format not recognized collect2: ld returned 1 exit status
Again - needs looking into.
xdeb:
I tried the following: root@workstation:/# xdeb -a armel --prefer-apt libssl-dev libx11-dev libxv-dev libxkbfile-dev libxcursor-dev libasound2-dev ... No source package found: libssl-dev
Or, alternatively, the following: root@workstation:/# xdeb -a armel --convert libssl-dev libx11-dev libxv-dev libxkbfile-dev libxcursor-dev libasound2-dev .. IOError: [Errno 2] No such file or directory: './libssl-dev'
Here is my sources.list file: root@workstation:/# cat /etc/apt/sources.list deb http://archive.ubuntu.com/ubuntu natty main universe deb-src http://archive.ubuntu.com/ubuntu natty main universe deb [arch=armel] http://ports.ubuntu.com/ natty main universe deb-src [arch=armel] http://ports.ubuntu.com/ natty main universe
That looks OK (except the last line should be: deb-src http://ports.ubuntu.com/ natty main universe (It doesn't actually break anything - just makes no sense - Have I left that in a doc somewhere?)
So for xdeb you want this command:
xdeb -a armel --prefer-apt --only-explicit freerdp
On wheezy that dies quickly with a package conflict: he following packages have unmet dependencies: heimdal-dev : Conflicts: libkrb5-dev but 1.9.1+dfsg-1+b1 is to be installed libdb-dev : Depends: libdb5.1-dev but it is not going to be installed Conflicts: libdb4.8-dev but 4.8.30-8 is to be installed libdb4.8-dev : Conflicts: libdb-dev but 5.1.4 is to be installed libkrb5-dev : Conflicts: heimdal-dev but 1.4.0-6 is to be installed unixodbc-dev : Conflicts: libiodbc2-dev but 3.52.7-2 is to be installed E: Broken packages
Not sure what's going on there, but it's not much use.
On natty things go much better and it downloads, crosses and builds a load of stuff until falling over with :
pkg-deb: building package libosmesa6-armel-cross' in ./libosmesa6-armel-cross_7.10.2-0ubuntu2_all.deb'. dpkg-cross: package libegl1-mesa-drivers doesn't provide any useful files. Skipping.
Which is due to this bug: https://bugs.launchpad.net/ubuntu/+source/xdeb/+bug/731079 (xdeb stops if it comes across a package it thought it should cross which is in fact dpkg-cross 'NULL'). This is rather annoying and I think I have a fix mostly-done but it's not merged yet - need to check where that got to. You can fix it by adding the offending package to the xdeb blacklist )that's how it currently expects to work): so add libosmesa6 to /etc/xdeb/xdeb.conf in the 'blacklist' section.
However after doing that it doesn't get much further before: .:terminate called after throwing an instance of 'std::out_of_range'
I'm stuck at this point. Can anybody point me towards possible solution paths on how to cross-compile FreeRDP for ARM, given the above information?
So, the easiest way to get cross-building is to do it on a debian wheezy machine/chroot where the tools and build work OK. As you want to do neon dev then you may need to install a new-enough cross-toolchain, which probably means a linaro one.
I'll look into the natty build failures and see if we can get that going for you. This is clearly a package that ought to cross OK.
So, now you know why people native-build :-) there are an awful lot fewer things to go wrong and the tools are much more mature. There is plenty of work going on at the moment to improve the situation, and at least your source package is farily well-behaved (many aren't). It does look like it needs a couple of fixes though so a plain dpkg-buildpackage -aarmel would work as expected.
So, is a wheezy-based build sufficient for you for the time being? Or do you have to have it building on natty to do useful dev?
Wookey