[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] [Cross Toolchain] Multiarch and sysrooted toolchain



On Wed, 11 Mar 2009 14:50:19 +0100
Goswin von Brederlow <goswin-v-b@web.de> wrote:

> >
> >  [*]
> >   I have been looking lately into making some cross toolchain
> > improvements, one of them will be to change to a sysrooted cross
> > toolchain, but the current layout we are using by dpkg-cross installs
> > relevant bits under:
> >  <DIR>/{include,bin,lib,lib64}
> >   Mainstream code expects a different layout more LHS compliant,
> >  <DIR>/{usr/include,bin,lib,lib64}

dpkg-cross currently does:
/usr/
  `-- $arch-linux-gnu/
       |-- include/
       |       `-- foo.h
        `-- lib/
             `-- libfoo.so

$ ls /usr/arm-linux-gnu/
bin  include  lib

Very flat but quite simple.

I thought mulitarch wanted:
/usr/
  |-- bin/
  |     `-- $arch-linux-gnu/
  |-- include/
  |     `-- $arch-linux-gnu/
  |             `-- foo.h
  |--  lib64/
  |     `-- $arch-linux-gnu/
   `-- lib/
        `-- $arch-linux-gnu/
              `-- libfoo.so

?

The problem, as I see it, with /usr/include/$arch-linux-gnu/foo.h is
that it makes it impossible to export one entire tree of all
cross-build stuff. i.e. make /usr/$arch-linux-gnu/ available and
everything is in a single place. Instead, three paths need to be
exported.

So which layout do we need for LHS?

/usr/
   `-- $arch-linux-gnu/
       |-- bin/
       |-- lib64/
       !-- lib/
       |-- usr/
       `--  |-- bin/
            |-- include/
            |      `-- foo.h
             `-- lib/
                   `-- libfoo.so

$ ls /usr/arm-linux-gnu/
bin lib64 lib usr
$ ls /usr/arm-linux-gnu/usr
bin include lib
(with or without a symlink of /usr/arm-linux-gnu/usr/lib64
to /usr/arm-linux-gnu/usr/lib) ?

i.e. a complete hierarchy beneath /usr/arm-linux-gnu/ with files that
are normally in /bin/ in /usr/$arch-linux-gnu/bin and files that are
normally in /usr/bin/ in /usr/$arch-linux-gnu/usr/bin, similarly for
lib.

> >    Is there any information arround, maybe LHS, on how to setup <DIR>
> > layout?
> >
> >    Nowadays we are using non multiarch structure as:
> >
> > usr/$arch-linux-gnu
> > |-- bin
> > |-- include
> > |-- lib
> > `-- lib64
> >
> >    But what it should look like in future? /usr/include/$arch-linux-gnu?
> > Would it be reasonable to be using a new layout like:
> >
> > usr/include/$arch-linux-gnu
> 
> That is already standard on i386/amd64 at least. Many /usr/include/*
> files just include the right usr/include/$arch-linux-gnu file
> depending on wether __i386__ or __x86_64__ is set. gcc also looks into
> those dirs on its own. So yes, do use those.

Is that /usr/include/$arch-linux-gnu/usr/include/foo.h ?

> > |-- bin
> 
> All binaries are assumed to do the same thing no matter what
> architecture they are compiled for. As such there is no need to have
> the same binary compiled for different archs at the same time. Also
> any change here would play havock with shebang lines.

binutils-multiarch puts stuff in /usr/$arch-linux-gnu/bin/

$ ls /usr/arm-linux-gnu/bin/
ar  as  ld  nm  objcopy  objdump  ranlib  strip

> >   I am missing some papers on multiarch, are there any kind of
> > information out there.
>
> You are missing the actual multiarch or cross-compile library dirs:
> 
> /usr/$arch-linux-gnu/lib  (cross-compile)
> /usr/lib/$arch-linux-gnu  (multiarch)
>
> I still haven't heart a good reason why multiarch can't use the
> cross-compile dirs as the libraries for each are ment to be
> interchangable (and in fact dpkg-cross demonstrates that already).

Hmm, so dpkg-cross would need to change the path to include/ for
headers but not change the path for libraries?

We'd have:

/usr/arm-linux-gnu/lib/libfoo.so
/usr/include/arm-linux-gnu/include/foo.h
or
/usr/arm-linux-gnu/usr/lib/libfoo.so
/usr/include/arm-linux-gnu/usr/include/foo.h

?

I thought the question was whether we would have:

/usr/lib/arm-linux-gnu/lib/libfoo.so
or
/usr/lib/arm-linux-gnu/usr/lib/libfoo.so
or
/usr/arm-linux-gnu/usr/lib/libfoo.so
or the current
/usr/arm-linux-gnu/lib/libfoo.so

as a conversion of /usr/lib/libfoo.so

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgp7ojl1WWt6v.pgp
Description: PGP signature


Reply to: