This is a bit complicated. It depends on how GCC was configured and compiled during installation. On my Ubuntu 16.04 x64 system there is a GCC installation.
If in terminal I type gcc -v
, I'll get --target=x86_64-linux-gnu
, which means GCC will produce code for x64 Linux. --host=x86_64-linux-gnu
means GCC itself is x64 linux application. More of this at the link.
Another useful output to look at is --with-multilib-list=m32,m64,mx32
- it means I could compile for default 64bit application together with two types of 32bit applications (-m32 and -mx32).
Last but not least is --with-tune=generic
, which means apps will be compiled for some generic x64 platform and user should be able to run them anywhere on x64 Linux box.
THere are two options to override - -march
and -mtune
. Arch option will tell compiler to use intruction specific for a given CPU. Tune will tune the code generation to fit best given CPU. CPU is either specific platform (like, say, sandybridge), generic platform (usually a default) or native
, where GCC during compilation will check the host CPU and perform code generation/tuning for it.
Last set of option covers the setting for FPU - you could select which unit to use (x87 or SSE2+), instruction set (SSE2, 3, 4, AVX) etc. MOre into the this link.