Re: Cross compiling under debian

2007-04-18 Thread Guillem Jover
Hi,

On Wed, 2007-04-18 at 09:43:32 +0200, ext Sebastian Mancke wrote:
> So, at the moment I cross compile from my x86 debian, which seems to
> work fine except of the following problems with the debian packaging:
> 
> 1. dh_strip -a (from x86) does not know, how to handle the arm binaries.
> (I have disabled it with: DEB_BUILD_OPTIONS=nostrip)

You need to install binutils-multiarch.

> 2. dh_shlibdeps does not work, because the ldd (from the toolchain)
> tries to use ld-linux.so.3 from my host instead from the rootstrap.
> /home/asteban/maemo/toolchain/scratchbox/compilers/arm-linux-2006q3-27/arm-none-linux-gnueabi/libc/usr/bin/ldd:
> line 166: /lib/ld-linux.so.3: No such file or directory

Neither dh_shlibdeps nor dpkg-shlibdeps should be using ldd on the latest
Debian versions. Also dpkg-shlibdeps needs access to the dpkg db, to
match sonames with package names, so this will not work yet. You could
fix some of the problems with -L, but you'll need dpkg svn's trunk to
get the new --admindir. But admindir is not propagated to the child dpkg,
this needs to be fixed in general so that child processes inherit the
admindir variables (I talked about this in a thread about sbox2).

> 3. dpkg-architecture does not know 'arml'
> It would be possible to hack a fix in the script, like the one in
> scratchbox:
> sub debian_arch_fix
> {
> local ($os, $cpu) = @_;
> ...
> } elsif ("$os-$cpu" eq "gnueabi-linux-arm") {
> return "armel";
> ...
> }

It needs a bit more fixing than that, it's on the 1.14.0 roadmap.
Should be uploaded into unstable RSN.

> The problem 2. is my biggest one. Any suggestions? Cleaner solutions?

Either you wait, or you mess with the two scripts.

> My setup is as follows:
> 
> TOOLCHAIN=~/maemo/toolchain/scratchbox
> ROOTSTRAP=~/maemo/toolchain/rootstrap
> export
> PATH=$TOOLCHAIN/compilers/arm-linux-2006q3-27/bin/:$TOOLCHAIN/compilers/arm-linux-2006q3-27/arm-none-linux-gnueabi/libc/usr/bin/:$PATH
> export CC=`which arm-none-linux-gnueabi-gcc`
> export LD=`which arm-none-linux-gnueabi-ld`
> export AR=`which arm-none-linux-gnueabi-ar`
> export PKG_CONFIG_PATH=$ROOTSTRAP/usr/lib/pkgconfig/
> alias pkg-config='pkg-config --define-variable=prefix=$ROOTSTRAP/usr'
> 
> # no a nice soution
> export DEB_BUILD_OPTIONS=nostrip
> 
> Then I simply run 'fakeroot dpkg-buildpackage -d'

Ideally you should be able to use -aarmel and get it working, but we
are not there yet.

regards,
guillem
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers


Cross compiling under debian

2007-04-18 Thread Sebastian Mancke
Hi,

compiling my packages with Java-JNI-code (e.g. classpath) for maemo does
not work out of the box, because scratchbox does not have all the
required build tools (javac, javah, jar). My long-term goal would be to
use openembedded, but this will need much work, I think.

So, at the moment I cross compile from my x86 debian, which seems to
work fine except of the following problems with the debian packaging:

1. dh_strip -a (from x86) does not know, how to handle the arm binaries.
(I have disabled it with: DEB_BUILD_OPTIONS=nostrip)

2. dh_shlibdeps does not work, because the ldd (from the toolchain)
tries to use ld-linux.so.3 from my host instead from the rootstrap.
/home/asteban/maemo/toolchain/scratchbox/compilers/arm-linux-2006q3-27/arm-none-linux-gnueabi/libc/usr/bin/ldd:
line 166: /lib/ld-linux.so.3: No such file or directory

3. dpkg-architecture does not know 'arml'
It would be possible to hack a fix in the script, like the one in
scratchbox:
sub debian_arch_fix
{
local ($os, $cpu) = @_;
...
} elsif ("$os-$cpu" eq "gnueabi-linux-arm") {
return "armel";
...
}

The problem 2. is my biggest one. Any suggestions? Cleaner solutions?


My setup is as follows:

TOOLCHAIN=~/maemo/toolchain/scratchbox
ROOTSTRAP=~/maemo/toolchain/rootstrap
export
PATH=$TOOLCHAIN/compilers/arm-linux-2006q3-27/bin/:$TOOLCHAIN/compilers/arm-linux-2006q3-27/arm-none-linux-gnueabi/libc/usr/bin/:$PATH
export CC=`which arm-none-linux-gnueabi-gcc`
export LD=`which arm-none-linux-gnueabi-ld`
export AR=`which arm-none-linux-gnueabi-ar`
export PKG_CONFIG_PATH=$ROOTSTRAP/usr/lib/pkgconfig/
alias pkg-config='pkg-config --define-variable=prefix=$ROOTSTRAP/usr'

# no a nice soution
export DEB_BUILD_OPTIONS=nostrip

Then I simply run 'fakeroot dpkg-buildpackage -d'


Regards,
  Sebastian

-- 
tarent Gesellschaft für Softwareentwicklung und IT-Beratung mbH

Heilsbachstr. 24, 53123 Bonn| Poststr. 4-5, 10178 Berlin
fon: +49(228) / 52675-0 | fon: +49(30) / 27594853
fax: +49(228) / 52675-25| fax: +49(30) / 78709617
durchwahl: +49(228) / 52675-17  | mobil: +49(171) / 7673249

Geschäftsführer:
Boris Esser, Elmar Geese, Thomas Müller-Ackermann
HRB AG Bonn 5168
Ust-ID: DE122264941
___
maemo-developers mailing list
maemo-developers@maemo.org
https://maemo.org/mailman/listinfo/maemo-developers