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]
Other format: [Raw text]

Re: Finding canonical names of systems


On 11/29/06, Michael Eager <eager@eagercon.com> wrote:
Ulf Magnusson wrote:
> How are you supposed to find the canonical name of a system (of known
> type) in CPU-Vendor-OS form in the general case? If you have access to
> a system of that particular type, you can run config.guess to find
> out, but you might not have, and that approach won't work for many
> systems anyway. The canonical name needs to be known e.g. when
> cross-compiling and building cross-compilers.
>
> The only way I could find to get a list of canonical CPU, Vendor and
> OS strings was to dig through /usr/share/gnuconfig/config.sub on my
> GNU/Linux systems, which needless to say is about as bad as it gets
> from a documentation perspective. Is there any other way to get a list
> mapping CPU's, Vendors and OS's to their canonical strings? If there
> isn't, I think it's making things much more complicated than they
> should be.

Strictly speaking, there isn't anything that is a canonical name
for a particular configuration, if you mean a single correct name.
GCC uses the vendor name to simplify figuring out the desired target
architecture.

For most cross-compilations, the vendor name is ignored.  There may
be a multitude of vendors, for example.  (How many MIPS vendors can
you name?)


It would be helpful if the documentation said this. I believe I'm not the only one who immediately went hunting in the docs for some kind of list with different CPU's, vendors and OS's, or at least some guide on how to find a string for your configuration.

Take a look at configure and config.gcc.   Find the architecture you
are interested in.  Look at the names defined for the architecture and
pick the best one.

For example, in configure you will find
   powerpc-*-eabi)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;

This says that powerpc-<whatever>-eabi is a valid configuration.

This is further refined in config.gcc, where you will find
that powerpc-*-eabi is a bit different from powerpc-*-eabisim.


This should also be in the doc, if it is the way you have to do it. Right now, I believe it pretty much glosses over the issue of how to find a suitable string for the configuration you want to represent.

If you are looking for a comprehensive list of all possible
configurations, rather than just trying to find the correct
one for your particular application, you will find that there
are an infinite number of configurations.


I understand this now, but the docs could be more helpful in explaining how to find the string to use for your configuration.

While searching for an answer, I noticed that lots of people seem
to have had problems with cross-compilation that to me look more
like problems in the documentation, which I find a bit sad.

/Ulf Magnusson


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