This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: toolchain's sysroot via environment


Mike, Rod, All,

On Saturday 17 July 2010 20:48:48 Mike Frysinger wrote:
> On Saturday, July 17, 2010 13:08:35 Rod Nussbaumer wrote:
> > This relates to a problem of mine that was solved here a week or so ago.
> > One of the *default* paths was to a directory for which the user (of the
> > cross compiler) had no read access ($HOME of the toolchain builder). The
> > result was that the compiler bombed. Is there a way of *removing* a path
> > from a tool's list of places to find it's stuff? When you say 'you can
> > change it on the command line', does the meaning of 'change' only
> > include adding paths?
> 
> build a proper relocatable toolchain and the default path is always based on 
> the toolchain, not the build location (afaik)

In fact, it is not. Rod indeed build a proper relocatable toolchain with
sysroot support.

When relocated, sysrooted gcc first tries the configured sysroot and if
it can't find it, then it tries to see if it was relocated.

That breaks when the user has no read permissions to a component directory
of the configured sysroot, in which case gcc barfs.

Let's see:
- gcc is configured by UID=1000 with smthg like:
    ./configure --prefix=/home/foo/bar --with-sysroot=/home/foo/bar/sysroot
- gcc is moved away into /opt/buz
- /home/foo is mode 0700
- UID=1001 runs gcc
- gcc tries to open() /home/foo/bar/sysroot, but it fails with EACCESS
  instead of ENOENT
- gcc barfs, saying it was unable to find libc.so (or whatever else it
  was looking for: crti.o...)

In that case, it should treat EACCESS as if the path did not exist, and try
to cater for relocation.

Maybe that'd warrant a PR in gcc bugzilla...

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]