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] |
I realize that it can be frustrating when you have tried many things and
they all failed, but in terms of posting for help to a mailing list it
doesn't help to omit the details. Without knowing the exact steps you
have taken and the exact error messages, we can only speculate as to
what's going wrong.
The problem with building a cross compiler is that it does not exist in a vacuum. You can't just download the source and build it. A compiler exists in the context of a C library and a kernel, both of which are external projects and not part of gcc. Moreover, gcc is just a glorified text processor -- it's not an assembler or linker, so you also have to provide those, normally from the binutils project. In order to build a working gcc therefore you need to have these other pieces available at build time.
In the case of a native system this is easy as they already exist. But
in the case of a cross compiler they usually don't. So you have to get
them from an existing system, or else build them up from nothing. The
latter is much harder than the former. Fortunately, there are people
that do this kind of thing for you: Linux distributions. You can use
their work as a starting point, and conveniently the fruits of their
labor come in nice individually wrapped packages.
For example in Debian the C library is in a package called libc6, and
the headers are in a package called libc6-dev. In the case of SPARC,
Debian has chosen to also split out the 64 bit versions of these into
their own packages: libc6-sparc64 and libc6-dev-sparc64. Finally there
is the linux-kernel-headers package.
If you simply download and unpack the contents of these packages into a
sysroot directory, and then configure your cross compiler with
--with-sysroot= pointing to it, you should have all you need. I use
Debian here as an example as it is a distro I am familiar with and it
supports SPARC, but really you could do this with any distro's packages.
I put together a small example, see attachment. Run this in an empty
directory and it will download everything that it needs; everything it
creates is in subdirectories so you don't have to worry about anything
polluting the rest of the system. All this does is create a sysroot
containing libc and headers, builds and install binutils, then builds
and installs gcc.
I suggest that you follow up on the crossgcc list if you have any questions, as that tends to be more about building cross compilers than using gcc.
Brian
-- 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] |