This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Compilation problem


> Has anybody tried something similar to this and gotten it to work?

This is, essentially, a cross-compilation. Please read about
installing gcc as a cross compiler. You have to configure gcc for a
different architecture (e.g. i586-redhat52-linux), and then provide
tools and libraries for that architecture (including binutils).

One problem is that you still use the startup files from /usr/lib, use
-nostartfiles to avoid this, use -v to see what else gets linked.

Another problem is that ld *knows* to find things in /lib and
/usr/lib, that's why you need the cross-binutils. I believe you could
avoid building cross-binutils by writing a linker spec file; check out
SEARCH_DIR in the /usr/lib/ldscripts files.

DISCLAIMER: I never installed a cross-compiler myself, so this is all
theory.

Hope this helps,
Martin


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