Thread: C Cross Compiler Terminology Question

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4,183

    C Cross Compiler Terminology Question

    Target Triplet - OSDev Wiki

    A, B, and C are three different Triplets

    Build Platform: This is the platform on which the compilation tools are executed.
    Host Platform: This is the platform on which the code will eventually run.
    Target Platform: If this is a compiler, this is the platform that the compiler will generate code for.

    Code:
    Case    Build     Host    Target    Compiler type
    1       A         A       A         Native
    2       A         B       C         Canadian Cross
    3       A         C       C         ??
    4       A         A       C         Cross
    Is case 3 above a cross compiler?

    Thanks

    I am trying to build GCC version 4.6 as a Cross Compiler; but,
    before that I am just trying to build an MSys2 package that calls itself an cross compiler to get the bugs not related to the m6809 target fixed. m6809 AKA MC6809 is a 1980s CPU that was last supported in GCC version 4.6. The MSys2 package is like case 3 above and I am wondering if trying to build it is a waste of time if it is not really a cross compiler.

    Edit: Correction: GCC 4.6 is that last version to support m68hc11 and I have found patches to add m6809 support.


    Tim S.
    Last edited by stahta01; 07-25-2020 at 12:41 AM. Reason: Correction
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #2
    Registered User
    Join Date
    May 2012
    Posts
    505
    A cross compiler generates code for one machine and runs on another. That's all the term means.
    However there's also a problem in "boostrapping" compilers. Compilers are often written in the language they compile. So there's a chicken and egg situation. If you already have a compiler for another platform, you can compile your compiler once, using that compiler. It then becomes a cross compiler, which is used, once, to compile itself. You then have a native compiler.
    I'm the author of MiniBasic: How to write a script interpreter and Basic Algorithms
    Visit my website for lots of associated C programming resources.
    https://github.com/MalcolmMcLean


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 18
    Last Post: 05-03-2014, 06:32 AM
  2. a online cross platform compiler?!
    By Masterx in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-31-2009, 05:31 PM
  3. Cross (compiler | OS) && reuseable code
    By audinue in forum C Programming
    Replies: 6
    Last Post: 07-22-2008, 12:46 PM
  4. Pointer Terminology Question
    By SourceCode in forum C Programming
    Replies: 2
    Last Post: 03-07-2003, 09:11 AM
  5. cross compiler
    By cozman in forum Linux Programming
    Replies: 2
    Last Post: 08-10-2001, 09:28 PM

Tags for this Thread