On Tue, 04 Dec 2007, Neil Williams wrote:
> On Wed, 5 Dec 2007 00:01:22 +0100
> Raphael Hertzog <[EMAIL PROTECTED]> wrote:
> 
> > On Tue, 04 Dec 2007, Neil Williams wrote:
> > > +my @shlibdeps=();
> > > +# ARCH for some awkward builds
> > > +my $crossprefix = Dpkg::Arch::debarch_to_gnutriplet($ENV{ARCH}) if 
> > > ($ENV{ARCH});
> > 
> > What's the role of $ARCH ? And why shall we consider that we're
> > crossbuilding only because this variable is set ?
> 
> Not cross building - building a cross compiler.

Do we need to check twice for building a cross-compiler ? We don't need to
check $ARCH if we already have DEB_TARGET_GNU_TYPE != DEB_BUILD_GNU_TYPE,
no ?

> gcc relies on $ARCH when preparing libgcc1-$arch-cross and other
> toolchain libraries.

Fine, but I don't think that dpkg-shlibdeps has to check $ARCH at all.

> > Without the patch, I get:
> > dpkg-shlibdeps: failure: couldn't find library libc.so.6 needed by
> > debian/libgcc1-arm-cross/usr/arm-linux-gnu/lib/libgcc_s.so.1 (its RPATH
> > is '').

OK, but this means that you can't build a cross-compiler without having
the target libc6 ... which in theory you might not yet have since the
cross-compiler might be your only choice to compile that library.

Is that a real requirement or just a consequence of the fact that
dpkg-shlibdeps got more strict in the checks that it does ?

Maybe, the call to dpkg-shlibdeps should exclude files found below
/usr/$target/ ... this can be easily done with dh_shlibdeps.

> > > +# host for normal cross builds.
> > > +$crossprefix = $ENV{DEB_HOST_GNU_TYPE}
> > > +    if (($ENV{DEB_HOST_GNU_TYPE}) and ($ENV{DEB_HOST_GNU_TYPE} ne 
> > > $ENV{DEB_BUILD_GNU_TYPE}));
> > 
> > I think you should use the functions contained in Dpkg::Arch instead of
> > relying only the environment variables here... 
> 
> Those variables are only defined in a cross build, not when building a
> cross compiler or a toolchain.

Yes and what does that have to do with my remark ? Using the functions
instead of the variables is still nicer to detect a cross build.
My remark was generic and didn't concern the case of building a
cross-compiler at all.

> > Why would we need a special treatment of libs when creating a
> > cross-compiler? The cross-compiler runs on the build arch but is not linked
> > against any lib of the target arch so it doesn't need to scan the
> > directories of the target arch.
> 
> The cross compiler needs to build cross libraries that *are* called
> when preparing the cross compiler itself.

Are called ? You mean that are analyzed by dpkg-shlibdeps ?

Cheers,
-- 
Raphaël Hertzog

Le best-seller français mis à jour pour Debian Etch :
http://www.ouaza.com/livre/admin-debian/


Reply via email to