cross compiler ?
Posted: Mon Mar 12, 2012 5:46 pm
I am curious what the difference between gcc compiler and a cross compiler is?
I thought gcc is a cross compiler on its own since it can compile to x86 , x64 ,...mips ,...etc
gcc -march=mips2 ...etc
But then I see from the tutorials you build gcc for a specific arch with ./configure ..., make,..etc
But what I am wondering about is why can some of the different archs, are just switches to the gcc compiler like mips. And others I don't see a switch for and you may have to build gcc for that specific arch.
My confusion is why don't they just have switch that you specify the arch that you want to compile to. I just don't see any reason for building a specific gcc compilers when somebody could easily implement a compiler switch to specify the different archs to compile to.
My understanding of a cross compiler is a compiler made to compile to a specific arch that is not your standard arch. ( i.e a native arch )
But then I don't see any reason why the make you build/configure gcc for a different arch when they could provide it as a command line switch to gcc at run time ?
I thought gcc is a cross compiler on its own since it can compile to x86 , x64 ,...mips ,...etc
gcc -march=mips2 ...etc
But then I see from the tutorials you build gcc for a specific arch with ./configure ..., make,..etc
But what I am wondering about is why can some of the different archs, are just switches to the gcc compiler like mips. And others I don't see a switch for and you may have to build gcc for that specific arch.
My confusion is why don't they just have switch that you specify the arch that you want to compile to. I just don't see any reason for building a specific gcc compilers when somebody could easily implement a compiler switch to specify the different archs to compile to.
My understanding of a cross compiler is a compiler made to compile to a specific arch that is not your standard arch. ( i.e a native arch )
But then I don't see any reason why the make you build/configure gcc for a different arch when they could provide it as a command line switch to gcc at run time ?