The gcc compiler use target-triplets for cross-compilation. I see some of these target triples like "x86_64-pc-linux-gnu" (the most common). I understand what means but I don't know how specify another unix-like system instead "linux-gnu". Is there any document for it? and the "pc" seems be optional (should I care about this?), when I run a "config.guess" script, it returns me "x86_64-unknown-linux-gnu".


In order to cross compile, you must have (or build) a cross-compiler; gcc cannot, by default, just build for any target that it could be configured for. There is a list of possibilities in the gcc source package, I believe.

Building a cross compiler toolchain is not a simple undertaking, so if you want to do that, you have to decide what it's for and ask more specific questions.

There's also a list of hosts/targets with notes here. An asterisk indicates that any value can be used in that position (presumably this makes no difference to the compiler, and is simply a user defined label); the pc you are talking about may be such.


config.guess is the document, actually. But simply building a cross-gcc won't get you far if you don't also have the libraries for the target system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.