As it was already mentioned in the comment, by default the target triplet is generated by config.guess script. It's logic is fairly simple. First it uses uname
to get some basic system information:
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
These strings are combined and matched against hardcoded patterns. The result is also hardcoded:
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
...(snip)...
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
...(snip)...
For some systems it is possible to give more meaningful result, like IBM in "rs6000-ibm-aix".
Distribution maintainers simply override this string with their own (also hardcoded):
$ gcc -v
...(snip)...
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10'
...(snip)...
--target=x86_64-linux-gnu
GCC 6 will probably output x86_64-pc-linux-gnu by default: updated config.guess in the upstream repository.
gcc
were Installed with thecore
packages when I was installing Arch.