This is the mail archive of the crossgcc@sources.redhat.com 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: Cross-compilers _without_ copying all of include & lib


%% Yves Rutschle <y.rutschle@indigovision.com> writes:

  >> I want to avoid this!

  yr> AFAIK that's the normal behaviour for gcc -- in most "normal"
  yr> cases, files on the target are not easy to get to from the build
  yr> machine.

I guess that depends on what you consider "normal".  If you're building
for another UNIX system maybe so.  If you're doing embedded work it's
highly _UN_likely that you don't have a complete image of the embedded
FS available to you at all times.

I have to believe that this situation is common enough that it should be
possible to do it in GCC without huge amounts of effort... but maybe I'm
wrong until --sysroot is available :-P.

  yr> Are you trying to do this to save space? Your hard disk space must
  yr> be at a premium :-)

It's not a disk space issue, it's two things:

 1) I don't want to have to rebuild the compiler every time I make a
    tweak to any header or library, etc.  If the compiler has its own
    locally cached copies of _ALL_ the headers and _ALL_ libraries which
    it is always looking at instead of what's in the real root
    filesystem, then I have to somehow keep those in sync with the real
    target system, which sucks in a major way.

    Remember the root filesystem I'm building against is complete, so
    it's not just libc in the system include and lib directories that
    get copied, but every header and every library in the system.

 2) The cross-compiler is going to be checked into source code control
    (business requirement, no use arguing) and an extra few thousand
    files, while each one is small, do put a burden on the SCM toolkits
    by the sheer number of files.

  yr> In that case, I'd suggest trying to simply remove include/ and
  yr> lib/ and replace them with symlinks to the target's files.

Well, I'm now trying to pre-create the sys-include and lib directories
as symlinks to the real thing: if I put a file COPIED in those
directories with the right format, then gcc's configure.in won't try to
copy them.

Now the problem I'm having is that on the real system the libraries are
split between /lib and /usr/lib (as is normal for any Linux system) and
my symlink can point to only one.  Unfortunately there is data needed
from both.  Of course, the copy would also have this problem since it
would copy only one.  Argh.

  >> Can I just delete those directories? 

  yr> Probably not.

Actually, I'm not so sure about that in one way: it doesn't seem that
the compiler build/install puts any compiler-specific files in those
directories.  So, in that sense they are not needed.

Of course, the compiler is probably built to look in those directories
by default so if I delete them I'll have to add extra arguments to the
compiler invocation to make it look in the right place.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@nortelnetworks.com>   HASMAT--HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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