public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Michael Hope <michael.hope@linaro.org>
To: Khem Raj <raj.khem@gmail.com>
Cc: paul@mad-scientist.net, "Yann E. MORIN" <yann.morin.1998@free.fr>,
		crossgcc@sourceware.org
Subject: Re: GCC support libraries and sysroot
Date: Sun, 25 Mar 2012 19:26:00 -0000	[thread overview]
Message-ID: <CANLjY-moq4uFNk7Rb2LmVES2mxTSaji+M7J7nxvP0+iX0bcsAg@mail.gmail.com> (raw)
In-Reply-To: <CAMKF1soEYQ0ecBxra25Yofyuf1NKGUn5BjPJXZ9zQRJzSxb=Bw@mail.gmail.com>

On 26 March 2012 07:27, Khem Raj <raj.khem@gmail.com> wrote:
> On Sun, Mar 25, 2012 at 8:16 AM, Paul Smith <paul@mad-scientist.net> wrote:
>> On Sun, 2012-03-25 at 16:36 +0200, Yann E. MORIN wrote:
>>> > It causes GCC to install support
>>> > libraries like libgcc_s.so into the sysroot instead of the default
>>> > location which makes it tricky to replace the sysroot later.
>>>
>>> What I don't really understand is why gcc does not install those libs
>>> in the sysroot. Why are those libs so special that they are "support
>>> libraries" and they do not deserve being installed in the sysroot?
>>> Yes, that's a real question I do not have the answer to.
>>
>> In my environments (although I'm not using crossgcc, I have my own
>> makefile to build a "crosstools suite") I have the same situation as
>> Michael.  I have a single compiler toolsuite, and a number of different
>> sysroots.  I create these sysroots in different ways, depending on the
>> target.  Some of them I just went onto the target system and created a
>> tar file containing the stuff I needed for the sysroot (I have a script
>> that does this).  Others I extract the upstream packages (RPM or DPKG)
>> directly into a separate sysroot area.
>>
>> In any event, I would find it very annoying if GCC copied important
>> internal files/libraries into the sysroot.  I want my sysroots to be
>> read-only and unmodified from the target, and the toolsuite libraries to
>> be contained within the toolsuite environment.  Cross-pollination
>> between those would be extremely frustrating for me.
>>
>> If you did want to preserve this ability I would recommend doing it the
>> other way: use the standard installation environment by default and
>> offer a script that could be invoked to copy the toolsuite libraries
>> into the sysroot.  Not only would that give you a better idea of whether
>> the extra step was necessary (people would know if they needed it,
>> because they'd have to run the extra script), it would also allow
>> sysroots to be updated "on the fly" instead of having them preinstalled.
>>
>>
>> Personally I've not run across any packages which did not build properly
>> unless the compiler libraries existed in the sysroot.  They've all
>> worked fine for me.  However if there were packages that failed, in my
>> opinion that would be an error in the upstream package and should be
>> reported there and fixed.  They're obviously doing something incorrect
>> in their build environments.
>
>
> in the end libgcc and libstdc++ and other gcc runtime libs
> go into target root file system under /lib or /usr/lib so
> them there is a good thing otherwise gcc might link to local versions where
> you are expecting it to use the one from your sysroot.
> or you should construct your sysroot such that you expect these libraries to
> be populated from cross toolchain.

Part of this is due to our abuse of crosstool.  You normally build a
compiler plus a sysroot but we're building a compiler against a
sysroot.  In the normal configuration you'd then copy the sysroot to
the device and want the GCC runtime to come with the copy.  In ours
the device is already set up including a compatible (but not
identical) runtime.

Interesting.  I'll patch this in our branch and send a copy to the
list as a FYI.

-- Michael

--
For unsubscribe information see http://sourceware.org/lists.html#faq

  reply	other threads:[~2012-03-25 19:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23  1:23 Michael Hope
2012-03-23  6:27 ` Building armv7 "cross-native" GCC Douglas Jerome
2012-03-25 14:37 ` GCC support libraries and sysroot Yann E. MORIN
2012-03-25 15:16   ` Paul Smith
2012-03-25 18:28     ` Khem Raj
2012-03-25 19:26       ` Michael Hope [this message]
2012-05-06 16:37 ` Thomas Petazzoni
2012-05-06 20:24   ` Michael Hope
2012-05-09  8:26     ` Thomas Petazzoni
2012-07-16  8:03 ` Maurizio Vitale
2012-07-20  3:56   ` Michael Hope

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANLjY-moq4uFNk7Rb2LmVES2mxTSaji+M7J7nxvP0+iX0bcsAg@mail.gmail.com \
    --to=michael.hope@linaro.org \
    --cc=crossgcc@sourceware.org \
    --cc=paul@mad-scientist.net \
    --cc=raj.khem@gmail.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).