Thread: Compiling GCC terminology question

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

    Compiling GCC terminology question

    I am trying to build an old version of GCC with Ada language support.
    I have MinGW64 GCC 4.9.4 64 bit that builds okay.
    But, GCC 4.8.5 has build errors.
    I have decided that the code has problems with 64 bit (x86_64);
    so, I decided I need to build MinGW64 GCC 4.9.4 32 bit (i686).

    Is this just called cross compiling when you are just changing this?
    Or is their a special name?

    Tim S.
    "...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
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    I would generally reserve "cross compiler" for when the target machine (maybe it doesn't have the OS or file system to support a compiler) is incapable of hosting a native compiler.

    The water is somewhat muddied if the OS is able to run either a 32-bit or a 64-bit program.
    You can run either version, and still pass the appropriate -march options to target the other width.

    Sure, if your host OS is 32-bit only, and you wanted to produce x86_64 images, then I think you're back in the realm of calling it a cross-compiler.

    gcc - cross-compilation terminologies --- build, host and target - Stack Overflow
    There is a term called 'Canadian cross compilation' when there are three distinct architectures in the chain.

    But if you're just playing around with 32/64 on the same basic underlying architecture, maybe "Canada-lite"?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Thanks Salem.
    Sounds like it is not clear cut what to call my compiler build decided that cross environment compiler will be what I will use if I do documentation of it.
    The MSys2 MinGW has multiple environments; and, I am building in MINGW64 environment for MINGW32 environment.
    It may or may not even be an real cross compiler based on what I know and your information.
    But, since I have yet to get it to work I do not know which method I will use.
    I do plan to try the real cross compiling way next.
    Using these in the configure statement; I have just been doing an isolated build attempts in the past host=build=target; but, that is not working well.
    The below is definitely not an Canadian Cross Compiler.
    Code:
        --build=x86_64-w64-mingw32 \
        --host=i686-w64-mingw32 \
        --target=i686-w64-mingw32 \
    "...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

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    I have decided that reading about Canadian Cross Compiler is over my head at this time. Edit: I have not tried reading about; because normal cross compiler is already hard enough; till I master that I see no reason to try CCC.

    I am going to do the normal cross compiler where build=host and target /= host and see if I can get it to work.
    I have gotten the cross binutils; but, having issues on the cross MinGW64 CRT; I am getting internal compiler errors.
    But, since I am trying to build using GCC 4.x versions and CRT 3 to 6; maybe that is the reason; trying CRT2 and GCC 4.7.4 see if that works.

    Tim S.
    "...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

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Code:
    regular native          build==host==target
    regular cross           build==host!=target
    cross native            build!=host==target
    canadian cross          build!=host!=target
    The above names are from GCC 4.7.4 ada/gcc-interface/Make-lang.in

    Tim S.
    "...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

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    I am making slow progress; I hope to end up with an "cross native" MSYS2 MinGW64 package; but, will settle for an "regular cross" package for GCC 4.9.4.

    Plan is to try MiNGW64 CRT version 2.x (current latest version is 10.x) and Binutils version 2.23.2 (current latest version is 2.39).

    My milestone 1 goal of the work is MinGW64 GCC 4.6.4 with Ada for 32 bit builds. Doing it just because I want to see if I can get Ada code to compile targeting the Radio Shack Color Computer TRS-80 Color Computer - Wikipedia

    Tim S.
    "...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

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    In-tree GMP version 4.3.2 does not work with cross native compiler triplet.
    Last edited by stahta01; 10-18-2022 at 07:40 PM.
    "...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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Cross Compiler Terminology Question
    By stahta01 in forum C Programming
    Replies: 1
    Last Post: 07-26-2020, 05:35 AM
  2. Looking for terminology.
    By Yonut in forum C Programming
    Replies: 3
    Last Post: 06-17-2020, 10:15 AM
  3. Terminology
    By r_james14 in forum C Programming
    Replies: 4
    Last Post: 11-24-2011, 09:37 AM
  4. terminology
    By h_howee in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 05-04-2007, 09:36 PM
  5. Pointer Terminology Question
    By SourceCode in forum C Programming
    Replies: 2
    Last Post: 03-07-2003, 09:11 AM

Tags for this Thread